PWM and WDT resets

Posted on
  • Hi, can anyone give the current state of play with PWM functions with espruin­o_1v84.tve_master_d8dec28_esp826­6?
    Intro states it's not yet implemented, but see code in github
    https://github.com/espruino/Espruino/blo­b/master/targets/esp8266/jshardware.c
    jshPinAnalogOutput

    So I've been playing - trying getting it working. Im getting WDT timeouts when ever I call 'analogWrite' in any of its forms

    
    analogWrite(D4, 0.5);
    =undefined
    

    Working with Web IDE so the following message gets sent to the UART


    ets Jan 8 2013,rst cause:4, boot mode:(3,3)
    wdt reset
    load 0x40100000, len 1396, room 16
    tail 4
    chksum 0x89
    load 0x3ffe8000, len 776, room 4
    tail 4
    chksum 0xe8
    load 0x3ffe8308, len 540, room 4
    tail 8
    chksum 0xc0
    csum 0xc0
    2nd boot version : 1.4(b1)
    SPI Speed : 40MHz
    SPI Mode : DIO
    SPI Flash Size & Map: 32Mbit(512KB+512KB)
    jump to run user1 @ 1000

    Tried a number of combinations:
    Tried pin D14 too

    D4.mode('af_output');
    analogWrite(D4, 0.5,{freq:10});
    D4.mode('output');
    analogWrite(D4, 0.5,{freq:10});
    analogWrite(D4, 0.5,{freq:100, soft:true});
    analogWrite(D4, 0.5);

    PS
    Great project and fun to play with..

  • Hardware PWM doesn't work. The person who added the code didn't get it to work and I haven't looked at it, so I can't really tell you why it's not working. Have you tried the software PWM?

  • Hi, I can't get the software PWM to work either. I get a WDT reset if any call is made to analogWrite(..)

    D4.mode('output');
    =undefined
    analogWrite(D4, 0.1, {soft:true});
    =undefined

    Disconnected

  • Looking at it, there is no software PWM at the moment. It just needs a few lines copying over from the STM32 port - it could probably just do soft PWM for everything (whether requested or not)

  • @tve check this out - should be pretty easy to apply to ESP8266?

    https://github.com/espruino/Espruino/com­mit/a08421af7d18fa1e671904b961f064f6e4b0­707a

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

PWM and WDT resets

Posted by Avatar for jnewcomb @jnewcomb

Actions