4 ms·
Ouch. I'm curious what would cause the PWM output to invert under such condition? Was there a special case built in for <2% that was coded incorrectly, or did i
by MauranKilom 5y ago
Ouch. I'm curious what would cause the PWM output to invert under such condition? Was there a special case built in for <2% that was coded incorrectly, or did it emerge from something else?
- robotresearcher 5y agoMy timing bug, if I recall correctly. I was very inexperienced. I got better but never great at that kind of development.
- xondono 5y agoPWM periods and on-time are implemented in the time domain in hardware, so my guess would be issues with integer algebra. Some hardware implementations are notoriously weird on edge cases. Some manufacturers built PWM modules so 0 setting on the on-time register means “no signal”, while for others it means “minimal on-time” (no signal is achieved by turning off the module). The other bad handled case is when going above period (if period is set at 210 clocks but on time is set to 250). Some implementations wrap around, some get locked in “always on”.
- robotresearcher 5y agoThe uC I used did not have built in PWM. I implemented it using GPIO with excitingly bad results.