Specifications

© 2008-2012 Microchip Technology Inc. DS70323E-page 43-89
Section 43. High-Speed PWM
High-Speed PWM
43
Example 43-28: PWM Output Override Control
43.12.2 Override Priority
When the PENH bit (IOCONx<15>) and the PENL bit (IOCONx<14>) are set, the following
priorities apply to the PWM output:
1. If a fault is active, the FLTDAT<1:0> bits (IOCONx<5:4>) override all other potential
sources and set the PWM outputs.
2. If a fault is not active, but a current-limit event is active, the CLDAT<1:0> bits
(IOCONx<3:2>) are selected as the source to set the PWM outputs.
3. If neither a fault nor a current-limit event is active, and a user Override Enable bit is set to
OVRENH and OVRENL, the associated OVRDAT<1:0> bits (IOCONx<7:6>) set the PWM
output.
4. If no override conditions are active, the PWM signals generated by the time base and duty
cycle comparator logic are the sources that set the PWM outputs.
43.12.3 Override Synchronization
If the OSYNC bit (IOCONx<0>) is set, the output overrides performed by the OVRENH bit
(IOCONx<9>), OVRENL bit (IOCONx<8>) and OVRDAT<1:0> bits (IOCONx<7:6>) bits are
synchronized to the PWM time base. Synchronous output overrides occur when the time base is
zero. If PTEN = 0, meaning the PWM timer is not running, writes to IOCONx take effect on the
next T
CY boundary.
43.12.4 Fault/Current-Limit Override and Dead Time Logic
In the event of a Fault and Current-Limit condition, the data in the FLTDAT<1:0>
bits (IOCONx<5:4>) or CLDAT<1:0> bits (IOCONx<3:2>) determine the state of the PWM I/O
pins.
If any of the FLTDAT<1:0> bits (IOCONx<5:4>) or CLDAT<1:0> bits (IOCONx<3:2>) are ‘0’, the
PWMxH and/or PWMxL outputs are driven inactive immediately, bypassing the dead time logic.
This behavior turns off the PWM outputs immediately without any additional delays. This can aid
many power conversion applications that require a fast response to fault shutdown signals to limit
circuitry damage and control system accuracy.
If any of the FLTDAT<1:0> bits (IOCONx<5:4>) or CLDAT<1:0> bits (IOCONx<3:2>) are ‘1’, the
PWMxH and/or PWMxL outputs are driven active immediately passing through the dead time
logic and, therefore, are delayed by the specified dead time value. In this case, dead time is
inserted even if a Fault or Current-Limit condition occurs.
/* Define override state of the PWM outputs. PWMxH and PWMxL outputs will be
at logic level ‘0’when overridden. */
IOCON1bits.OVRDAT = 0;
/* Override PWMxH and PWMxL outputs */
IOCON1bits.OVRENH = 1;
__builtin_nop();
IOCON1bits.OVRENL = 1;
.
.
.
/* Clear overrides of PWMxH and PWMxL outputs */
IOCON1bits.OVRENH = 0;
__builtin_nop();
IOCON1bits.OVRENL = 0;