Looking for a PWM IC, for lazy people.

I have both the $4 board and the $10 one plus the associated software. I can find a pulse width generator but don't see any way to have either the frequency or the duty cycle modified--what am I missing? I can set it but there seems to be no way to vary it once set.
 

danadak

Joined Mar 10, 2018
4,057
Two ways, instead of using clock straight into PWM use clock followed
by freq divider then into PWM. Under SW control change the divider ratio
hence the period fed to PWM clock input. Thats the example I attached
in the earlier post.

Or use the period and compare (duty cycle) APIs of the PWM directly to
change the period under software control. Right click the component, then
datasheet link, and the APIs are in there and their description. I think its
even possible using DMA in the 5LP parts to change the PWM period
using HW only.That's more involved getting the DMA setup though, there
are videos and ap notes on DMA.

Regards, Dana.
 
Top