BLL
Joined: 11 Nov 2006 Posts: 181 Location: Birmingham, UK
|
12F1840 PWM |
Posted: Sat Mar 23, 2019 9:54 am |
|
|
Hi, I am trying to use PWM for the first time and am getting bogged down in the formulae and can't see the wood for the trees!
I am using the internal oscillator at 4MHz - #use delay(internal=4M)
I want a 100kHz signal with duty cycle variable from 0 - 100%
I don't understand the calculation to get the right values for setup_timer_2.
Also, the datasheet has an equation for pulse width and for duty cycle ratio, which I don't follow either!
Can anyone please offer a SIMPLE explanation I can follow?
Thanks
Brian |
|