4 ms·
PWM 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 not
by xondono 5y ago
PWM 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.