I hope it is ok to append to this thread,rather than start a new one for a similar issue.
I am trying to use the PCPWM module in my 18F2431.The PIC is clocked at 20MHz.I am able to set up the frequency I need correctly (50Hz;20mS).I am unable to calculate the duty cycle.Assuming a 12bit resolution,I set , for a 25% duty cycle:
PDC0L=0x00;
PDC0H=0x04;
This gives me 3mS not 5mS. Extrapolating from this, I understand am getting a resolution of 12 ~ 13 bits resolution.I read the other thread referenced in this one,but I could not find any ideas.Is there anyway to know how to calculate the duty cycle,or resolution of the PWM exactly ?
I would post my code but it is in C. I hope I can get some suggestions,since there are quite a few experts for 18F2431 here.
Bookmarks