Polling a PWM Fault Pin on a dsPIC® Digital Signal Controllers (DSCs)
How can an application read the fault pin in order to determine status instead of having the PWM module react and shutdown in response to a fault condition?
- One possible way would be to disable the PWM fault override and use the fault pin as an interrupt source. The override function is disabled by setting the FLTMOD bits of the register FCLCONx with 0b11. To enable the fault interrupt set the FLTIEN bit of the PWMx register. The fault pin interrupt service routine would be available to take whatever action is needed.
- The fault pins are readable through the port I/O logic when the High-Speed PWM module is enabled, allowing the application to read the pin values.