I have generated a pwm signal from sample code/video available online and its working fine except its freq is only 76.4 Hz where as the meanwelll LDD driver I want to use requires 100-1Khz signal.
The code iam using is shown below.
I have two questions :
1- how can I increase the freq of this PWM signal to around 100+ Hhz ?
2- the datasheet is giving the formula to calculate the pwm freq but I cant get 76.5 Hz from it so if you can help me analyze why my freq is 76.Hz?
actually PWM is used for varying duty cycle of signal. u can change the frequency also by providing different count. Post your full code for
clear understanding.
You can get formula for calculating pwm frequency in data sheet for example total time periode= Reg count value* (1/(oscfreq/4) )
and 1/total time periode you will get frequency
fix the frequency you want select your crystal frequency value and from the formula calculate reg count value and put value in appropriate reg
I have new issue related to this . my OC3A is working but my OC3B is not with the following settings :
what do I have to do more to enable OC3B ?
Thanks