Re: Multi-Button CSM with Pic16LF722A
Just curious as to why there isn't any reference to the PR2 register in the program, for setting up the PWM?
flicker is virtually invisible to the human eye for switching frequencies above 50 Hz, switching losses increase with frequency , other than that the frequency is irrelevant .
fine control of the pwm frequency is possible using pr2 at the expense of resolution . since the frequency is largely irrelevant why not have maximum resolution
If I wanted to increase the pwm frequency to 25Khz, I take it I would have to go to a higher oscillator frequency and use different prescaler values?
depends on required resolution, @4mHz 25kHz is possible with 1:1 prescale and pr2=39 , however maximum duty occurs @ pwm_duty_reg = 160 , ie pw range is 0 to 160 (instead of 0 to 1023 steps as before)
Warning I'm not a teacher
Bookmarks