retepsnikrep
Senior Member
Just a quicky.
I want to program an 08M to provide a 2khz 25% duty pwm signal from the pwm pin.
Using the wizard I found 2khz was too low, but I could acheive 4khz with 4mhz clock, so I am using the 4khz setting but then underclocking the pic to 2mhz.
Will this acheive what I require?
It looks reasonable on the scope, frequency appears OK, but I was a bit worried about the duty, is the duty number a counter/timer?
So If for instance duty is 100 (example number) but underclocked to 2mhz it actually takes twice as long to count the duty period?
So should I have changed duty to 50 (halved it) as well as underclocking chip to maintain the duty interval with correct frequency?
I want to program an 08M to provide a 2khz 25% duty pwm signal from the pwm pin.
Using the wizard I found 2khz was too low, but I could acheive 4khz with 4mhz clock, so I am using the 4khz setting but then underclocking the pic to 2mhz.
Will this acheive what I require?
It looks reasonable on the scope, frequency appears OK, but I was a bit worried about the duty, is the duty number a counter/timer?
So If for instance duty is 100 (example number) but underclocked to 2mhz it actually takes twice as long to count the duty period?
So should I have changed duty to 50 (halved it) as well as underclocking chip to maintain the duty interval with correct frequency?