You are reading a single comment by @CamSwords and its replies. Click here to read the full conversation.
  • Cheers, @DrAzzy, I'll update the firmware. I knew about the timer sharing, though I haven't really looked in to it / understood it yet.

    I did some testing with analogWrite on my digital logic analyser. The timer does have a consistent pulse even when updating the duty cycle more frequently than the pulse width milliseconds. For example, running the code:

    var value = 0.1;
    
    setInterval(function() {
           if (value === 0.1) {
               value = 0.05;
           } else {
               value = 0.1;
           }
           analogWrite(C6, value, { freq: 50 });
    }, 10);
    

    resulted in a consistent pulse width of 20ms, and a consistent duty cycle of 2ms. I assume this takes the most recent duty cycle value when it writes the pulse, therefore it always used the "0.1" value and the "0.05" was never used as the duty cycle. Happiness! At least I've isolated my problem now.

About

Avatar for CamSwords @CamSwords started