PWM Output is Going Low While the CCP is Being Configured
Below are a few ways to address this problem:
- Some PIC18 devices have an enhanced Capture, Compare and Pulse Width
Modulation (CCP) module, which can be configured to run in active - 0 mode and can be used instead of the regular CCP module.
- Set the Pulse Width Modulation (PWM) output pin to "High-Level" after the device reset to stay high until the PWM is configured.
- Use an external inverter and use the PWM accordingly.