28.6 CLC Interrupts
The CLC module has two types of interrupts that can be enabled: rising edge interrupt events and falling edge interrupt events. These events are enabled by the INTP (CLCxCON[11]) and INTN (CLCxCON[10]) control bits, respectively.
A valid occurrence of either interrupt will set the CLCx Interrupt Flag, CLCxIF. This
will occur when the module is enabled (ON = 1
) and either a rising edge
output occurs when INTP = 1
or a falling edge event occurs when
INTN = 1
.
If the initial output state of the CLC logic is ‘1
’ and INTP =
1
, an interrupt will be generated when ON is set to
‘1
’. Likewise, an interrupt will be generated if the initial output
state of the CLC is ‘0
’ and INTN = 1
. These conditions
must be detected and cleared in software. Similarly, a false interrupt could be
generated if INTP or INTN is set while the CLC module is enabled.
The user should be sure to clear any spurious interrupt events that may occur in the initialization process of the CLC module.
If the CLCx Interrupt Enable bit, CLCxIE, is cleared, an interrupt will not be generated. However, the CLCxIF bit will still be set if an interrupt condition occurs. The user can clear the interrupt in the Interrupt Service Routine (ISR) by clearing CLCxIF. See the Interrupt Controller section of the data sheet for more information.