39/176
μ
PSD323X
INTERRUPT SYSTEM
There are interrupt requests from 10 sources as
follows.
I
INT0 external interrupt
I
2nd USART interrupt
I
Timer0 interrupt
I
I
2
C interrupt
I
INT1 external interrupt (or ADC interrupt)
I
DDC interrupt
I
Timer1 interrupt
I
USB interrupt
I
USART interrupt
I
Timer2 interrupt
External Int0
I
The INT0canbe eitherlevel-active ortransition-
active depending on Bit IT0 in register TCON.
The flag that actually generates this interrupt is
Bit IE0 in TCON.
I
When an external interrupt is generated, the
corresponding request flag is cleared by the
hardware when the service routine is vectored
to only if the interrupt was transition activated.
I
If the interrupt was level activated then the
interrupt request flag remains set until the
requested interrupt is actually generated. Then
it has to deactivate the request before the
interrupt service routine is completed, or else
another interrupt will be generated.
Timer 0 and 1 Interrupts
I
Timer0 and Timer1 interrupts are generated by
TF0 and TF1 which are set by an overflow of
theirrespectiveTimer/Counterregisters(except
for Timer0 in Mode 3).
I
These flags are cleared by the internal
hardware when the interrupt is serviced.
Timer 2 Interrupt
I
Timer2 interrupt is generated by TF2 which is
set byan overflow of Timer2.This flaghas to be
cleared by the software - not by hardware.
I
It is also generated by the T2EX signal (timer 2
external interrupt P1.1) which is controlled by
EXEN2 and EXF2 Bits in the T2CON register.
This is the definition of Timer 2 as per 90C320
definition.
I
2
C Interrupt
I
The interrupt ofthe I
2
C is generatedby Bit INTR
in the register S2STA.
I
This flag is cleared by hardware.
External Int1
I
The INT1 canbe either level active ortransition
active depending on Bit IT1 in register TCON.
The flag that actually generates this interrupt is
Bit IE1 in TCON.
I
When an external interrupt is generated, the
corresponding request flag is cleared by the
hardware when the service routine is vectored
to only if the interrupt was transition activated.
I
If the interrupt was level activated then the
interrupt request flag remains set until the
requested interrupt is actually generated. Then
it has to deactivate the request before the
interrupt service routine is completed, or else
another interrupt will be generated.
I
The ADC can take over the External INT1 to
generate an interrupt on conversion being
completed
DDC Interrupt
I
The DDC interrupt is generated either by Bit
INTR in the S1STA register for DC2B protocol
or by Bit DDC interrupt in the DDCCON register
for DDC1 protocol or by Bit SWHINT Bit in the
DDCCON register when DDC protocol is
changed from DDC1 to DDC2.
I
Flags excepttheINTRhave to becleared by the
software. INTR flag is cleared by hardware.
USB Interrupt
I
The USB interruptis generatedwhen endpoint0
has transmitted a packet or received a packet,
when endpoint1 orendpoint2 has transmitted a
packet, when the suspend or resume state is
detected and every EOP received.
I
When the USB interrupt is generated, the
corresponding request flag must be cleared by
software. The interrupt serviceroutine will have
to checkthe various USB registers todetermine
the source and clear the corresponding flag.
I
Please see thededicated interrupt control
registers for the USB peripheral for more
information.