![Sino Wealth SH69K55A Manual Download Page 21](http://html1.mh-extra.com/html/sino-wealth/sh69k55a/sh69k55a_manual_1283061021.webp)
SH69P55A/K55A
21
Port Interrupt
The PORTB and PORTC are used as port interrupt sources. Since PORTB and PORTC are bit programmable I/Os, only
when the PORTB and PORTC are selected as normal I/O input, the voltage transition from V
DD
to GND applying to the digital
input port can generate a port interrupt. When they are selected as analog input (such as ADC input), Port interrupt request
cannot be generated.
The interrupt control flags are mapped on $388 - $38A of the system register. They can be accessed by the read/write
operation. Those flags are clear to ‘0’ at the initialization by the chip reset.
Port interrupts can be used to wake up the CPU from the HALT or the STOP mode.
System Register $388, $38A:
Port Interrupt Enable Flags Register
Address
Bit 3
Bit 2
Bit 1 Bit
0
R/W
Remarks
$388
PBIEN.3
PBIEN.2
PBIEN.1
PBIEN.0
R/W
PORTB interrupt enable flags register
$38A
PCIEN.3
PCIEN.2
PCIEN.1
PCIEN.0
R/W
PORTC interrupt enable flags register
PB/CIEN.n, (n = 0, 1, 2, 3)
0: Disable port interrupt. (Power on initial)
1: Enable port interrupt.
System Register $389, $38B
: Port Interrupt Request Flags Register
Address
Bit 3
Bit 2
Bit 1 Bit
0
R/W
Remarks
$389 PBIF.3 PBIF.2 PBIF.1 PBIF.0
R/W
PORTB interrupt request flags register
$38B
PCIF.3
PCIF.2
PCIF.1
PCIF.0
R/W
PORTC interrupt request flags register
PB/CIF.n, (n = 0, 1, 2, 3)
0: Port interrupt is not presented. (Power on initial)
1: Port interrupt is presented.
Only writing these bits to “0” is available.
Following is the port interrupt function block-diagram for reference.
IRQEX
Interrupt CPU
IEEX
external interrupt
request generator
PC.3 - 0
Request Flag
(PCIF.3 - 0)
PCCR.3 - 0
Falling Edge
Detector
PBIEN.3 - 0
PB.3 - 0
Request Flag
(PBIF.3 - 0)
PBCR.3 - 0
Falling Edge
Detector
PCIEN.3 - 0
Port Interrupt Programming Notes:
Any one of PORTB & PORTC input pin transitions from V
DD
to GND would set PBIF.x or PCIF.x to “1”, in spite of level of
the other pin of PORTB and PORTC.
If PBIEN.x (or PCIEN.x) = 1and IEEX = 1, the x of PORTB (or PORTC) input pin transitions from V
DD
to GND would
generate an interrupt request (PBIF.x = 1 or PCIF.x = 1) and interrupt the CPU, in spite of level of the other pin of PORTB
(or PORTC).