I was wondering what I need to do if I select USER control on a non-CPP pin, or if I select USER and IFI_PWM on a cpp pin. With the period set up the way you do it (in your example code), if CCPR2L were set to 0xFF, the pwm duty cycle would exceed the period. Would this have an adverse effect on the machine?
**If you select USER control on a non-CCP pin (PWM Outputs 5 - 8), you must write your own code to control those pins. Selecting USER control on a CCP pin (PWM Outputs 1 - 4) and IFI_PWM, will generate the same PWM Signals that the Master would have generated if you use Generate_PWM(…). If Generate_PWM(…) is not called under this situation, the output pins will not be controlled.
Note: When using USER control, the PWM signals are interruptible which can cause stretching of the PWM Output signal, whereas with the MASTER control they are non-interruptible. For more details on the CCP pin, refer to page 154 of the PIC18FXX20 Data Sheet.**
Ricky Torrance
Electrical Engineer
VexLABS