![Sino Wealth SH69K55A Скачать руководство пользователя страница 55](http://html1.mh-extra.com/html/sino-wealth/sh69k55a/sh69k55a_manual_1283061055.webp)
SH69P55A/K55A
55
PORTB, PORTC falling Edge Interrupt
The PORTB and PORTC are used as external 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 VDD 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, $38C of the system register. They can be accessed or tested by the
read/write operation. Those flags are cleared 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.
Port Interrupt Enable Flags Register: $388, $38A
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. (Default)
1: Enable port interrupt.
Port Interrupt Request Flags Register: $389, $38B
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. (Default)
1: Port interrupt is presented.
Only writing these bits to 0 is available.
Application 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).
ADC Interrupt
When the A/D conversion is complete, it will generate an interrupt request (ADIF = 1), if the ADC interrupt is enabled (ADIE = 1),
an external interrupt service routine will start. The ADC interrupt can be used to wake the CPU from HALT mode.
Key Scan Interrupt
When the Key scan is complete, it will generate an interrupt request (KEYIF = 1), if the Key scan interrupt is enabled (KEYIE
= 1), an External interrupt service routine will start. The KEY scan interrupt can be used to wake the CPU from HALT mode.
Other External Interrupt Enable Flags Register: $38C
Address
Bit 3
Bit 2
Bit 1
Bit 0
R/W
Remarks
$38C - - KEYIE
ADIE
R/W
Bit0: ADC interrupt enable flag register
Bit1: Key scan interrupt enable flag register
Other External Interrupt Request Flags Register: $38D
Address
Bit 3
Bit 2
Bit 1
Bit 0
R/W
Remarks
$38D - - KEYIF
ADIF
R/W
Bit0: ADC interrupt request flag register
Bit1: Key scan interrupt request flag register
Only writing these bits to 0 is available.