st2032a Sitronix Technology Corporation, st2032a Datasheet - Page 15

no-image

st2032a

Manufacturer Part Number
st2032a
Description
8 Bit Microcontroller With 32k Bytes Rom
Manufacturer
Sitronix Technology Corporation
Datasheet
10.2.4 Port-A Interrupt
Port-A is suitable for the return line inputs of keyboard-scan
because of the port transition interrupt function. Difference
between current value and the data kept previously of Port-A
will generate an interrupt request. The last state of Port-A must
be latched before transition, and this can be done by one read
Operate Port-A interrupt steps:
Ver 2.4
1. Set input mode.
2. Read Port-A.
3. Clear interrupt request flag (IRPT).
4. Set interrupt enable flag (IEPT).
5. Clear CPU interrupt disable flag (I).
6. Read Port-A before ‘ RTI’ instruction in ISR.
PCA[0]
PCA[1]
PCA[2]
PCA[3]
RDPA
PA[1]
PA[2]
PA[3]
PA[0]
D
CK
D
CK
D
CK
D
CK
DFF
DFF
DFF
DFF
Q
Q
Q
Q
FIGURE 10-2 Port Interrupt Logic Diagram
XNOR2
XNOR2
XNOR2
XNOR2
OR2
OR2
OR2
OR2
15/54
PCA[4]
PCA[5]
PCA[6]
PCA[7]
PA[4]
PA[5]
PA[6]
PA[7]
instruction to Port-A. If both INTX and PT interrupts are enabled,
signal edge of PA0 may trigger PT interrupt as well as INTX.
Steps and program example are shown below. Also refer to
FIGURE 10-2 for the block diagram.
Example:
Interrupt subroutine
STZ
LDA
STA
LDA
RMB4
SMB4
CLI
LDA
RTI
.
.
.
.
.
.
D
CK
D
CK
D
CK
CK
D
DFF
DFF
DFF
DFF
NAND8
Q
Q
Q
Q
<PCA
#$FF
<PA
<PA
<IENA
<PA
<IREQ
XNOR2
XNOR2
XNOR2
XNOR2
PTIR
High Level Interrupt
OR2
OR2
OR2
OR2
; Set input mode.
; PA be PULL-UP.
; Keep last state.
; Keep last state.
; Clear IRQ flag.
; Enable INT.
ST2032A
9/13/07

Related parts for st2032a