Some PWM registers are double-buffered, see the RP2040 datasheet for more detail. New register values for CC and TOP are latched only at wrap point, for glitch-free operation. You can't change it faster than one PWM cycle per change, unless someone knows a cool trick.
A PIO might be more flexible. Glitch-free PWM is still desirable I assume. One PWM cycle per CC/TOP change might still meet your needs, there are phase discontinuities [1] but since it's a square PWM wave the errors might smooth out somewhere further on... maybe?
[1] I was reading https://www.notblackmagic.com/bitsnpieces/afsk/ interesting stuff.
A PIO might be more flexible. Glitch-free PWM is still desirable I assume. One PWM cycle per CC/TOP change might still meet your needs, there are phase discontinuities [1] but since it's a square PWM wave the errors might smooth out somewhere further on... maybe?
[1] I was reading https://www.notblackmagic.com/bitsnpieces/afsk/ interesting stuff.
Statistics: Posted by katak255 — Thu Sep 26, 2024 1:59 am