Generating a PWM Signal with High Speed PWM Module Fails on dsPIC33EP Family
Why does generating a PWM signal with high-speed PWM module fail on the dsPIC33EP family? PWMxH pin is always zero, indicating that PWMx generator provides no output.
One of the reasons that this may happen is incorrect values in FCLCONx register and IOCONx registers. Incorrect or incomplete register initialization commonly occurs when the registers are write-protected MCUs that implement a form of write protection on the said registers. An unlock sequence is required before the registers can be updated.
Writing to FCLCON1 Register Required Unlock Sequence
Writing to IOCON1 Register Required Unlock Sequence
For more information on the unlock sequence, read "Section 14. High-Speed PWM" reference manual.