Thank you very much for making use of Toshiba microcomputer LSIs.
Before use this LSI, refer the section, “Points of Note and Restrictions”.
CMOS 32-bit Microcontroller
TMP92CH21FG/JTMP92CH21
1. Outline and Device Characteristics
The TMP92CH21 is a high-speed advanced 32-bit Microcontroller developed for controlling
equipment which processes mass data.
The TMP92CH21 has a high-performance CPU (900/H1 CPU) and various built-in I/Os.
The TMP92CH21FG is housed in a 144-pin flat package. The JTMP92CH21 is a chip form
product.
Device characteristics are as follows:
(1) CPU: 32-bit CPU (900/H1 CPU)
• Compatible with TLCS-900/L1 instruction code
• 16 Mbytes of linear address space
• General-purpose register and register banks
TMP92CH21
•Micro DMA: 8 channels (250 ns/4 bytes at f
(2) Minimum instruction execution time: 50 ns (at f
= 20 MHz, best case)
SYS
= 20 MHz)
SYS
(3) Internal memory
• Internal RAM: 16 Kbytes (can be used for program, data and display memory)
• Internal ROM: 8 Kbytes (used as boot program)
Possible downloading of user program through either USB,
UART or NAND flash.
(4) External memory expansion
• Expandable up to 512 Mbytes (shared program/data area)
• Can simultaneously support 8,- 16- or 32-bit width external data bus
The following table shows the names and functions of the input/output pins
Table 2.3.1 Pin Names and Functions (1/5)
TMP92CH21
Pin Name
Number of
I/O Function
Pins
D0 to D7 8 I/O Data: Data bus 0 to 7
P10 to P17
D8 to D15
P20 to P27
D16 to D23
KO0 to KO7
P30 to P37
D24 to D31
P40 to P47
A0 to A7
P50 to P57
A8 to A15
P60 to P67
A16 to A23
P70
RD
P71
WRLL
NDRE
P72
WRLU
NDWE
P73
EA24
P74
EA25
P75
WR/
NDR/B
P76
WAIT
8
8
8
8
8
8
1
1
1
1
1
1
1
I/O
I/O
I/O
I/O
Output
I/O
I/O
Output
Output
Output
Output
I/O
Output
Output
Output
I/O
Output
Output
I/O
Output
Output
Output
Output
Output
Output
I/O
Output
Input
I/O
Input
Port 1: I/O port input or output specifiable in units of bits
Data: Data bus 8 to 15
Port 2: I/O port input or output specifiable in units of bits
Data: Data bus 16 to 23
Key output 0 to 7: Pins used of key-scan strobe (Open-drain output programmable)
Port 3: I/O port input or output specifiable in units of bits
Data24: Data bus 24 to 31
Port 4: Output port
Address: Address bus 0 to 7
Port 5: Output port
Address: Address bus 8 to 15
Port 6: I/O port input or output specifiable in units of bits
Address: Address bus 16 to 23
Port70: Output port
Read: Outputs strobe signal to read external memory
Port 71: I/O port
Write: Output strobe signal for writing data on pins D0 to D7
NAND flash read: Outputs strobe signal to read external NAND flash
Port 72: I/O port
Write: Output strobe signal for writing data on pins D8 to D15
Write Enable for NAND flash
Port 73: Output port
Extended Address 24
Port 74: Output port
Extended Address 25
Port 75: I/O port
Read/Write: 1 represents read or dummy cycle; 0 represents write cycle
NAND flash ready (1)/Busy (0) input
Port 76: I/O port
Wait: Signal used to request CPU bus wait
92CH21-7
2009-06-19
TMP92CH21
Table 2.3.2 Pin Names and Functions (2/5)
Pin Name
P80
0CS
P81
1CS
SDCS
P82
2CS
CSZA
SDCS
P83
3CS
P84
WRUL
CSZB
CE0ND
P85
WRUU
CSZC
CE1ND
P86
CSZD
SRULB
P87
CSZE
SRUUB
P90
TXD0
I2SCKO
P91
RXD0
I2SDO
P92
SCLK0
0CTS
I2SWS
P93
LGOE0
P94
LGOE1
P95
CLK32KO
LGOE2
P96
INT4
PX
P97
INT5
PY
PA0 to PA2
KI0 to KI2
PA3 to PA6
KI3 to KI6
LD8 to LD11
PA7
KI7
Number of
Pins
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1 Input
1 Input
3
4
1
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
I/O Function
Port80: Output port
Chip select 0: Outputs “low” when address is within specified address area
Port81: Output port
Chip select 1: Outputs “low” when address is within specified address area
Chip select for SDRAM: Outputs “0” when address is within SDRAM address area
Port82: Output port
Chip select 2: Outputs “Low” when address is within specified address area
Expand chip select: ZA: Outputs “0” when address is within specified address area
Chip select for SDRAM: Outputs “0” when address is within SDRAM address area
Port83: Output port
Chip select 3: Outputs “low” when address is within specified address area
Port84: Output port
Write: Output strobe signal for writing data on pins D16 to D23
Expand chip select: ZB: Outputs “0” when address is within specified address area
Chip select for NAND flash 0: Outputs “0” when NAND flash 0 is enabled
Port85: Output port
Write: Output strobe signal for writing data on pins D24 to D31
Expand chip select: ZC: Outputs “0” when address is within specified address area
Chip select for NAND flash 1: Outputs “0” when NAND flash 1 is enabled
Port86: Output port
Expand chip select: ZD: outputs “0” when address is within specified address area
Data enable for SRAM on pins D16 to D23
Port87: Output port
Expand chip select: ZE: Outputs “0” when address is within specified address area
Data enable for SRAM on pins D24 to D31
I/O
Port90: I/O port
Serial 0 send data: Open-drain output programmable
2
I
S clock output
I/O
Port91: I/O port (Schmitt-input)
Input
Input
Input
Input
Input
Input
Input
Input
Input
Input
Serial 0 receive data
2
I
S data output
I/O
Port92: I/O port (Schmitt-input)
I/O
Serial 0 clock I/O
Serial 0 data send enable (Clear to send)
2
I
S word select output
I/O
Port93: I/O port
Output enable-0 for external TFT-LCD driver
I/O
Port94: I/O port
Output enable-1 for external TFT-LCD driver
Port95: Output port
Output fs (32.768 kHz) clock
Output enable-2 for external TFT-LCD driver
Port 96: Input port (Schmitt-input)
Interrupt request pin4: Interrupt request with programmable rising/falling edge
X-Plus: Pin connectted to X+ for touch screen panel
Port 97: Input port (Schmitt-input)
Interrupt request pin5: Interrupt request with programmable rising/falling edge
Y-Plus: Pin connectted to Y+ for touch screen panel
Port: A0 to A2 port: Pin used to input ports (Schmitt input, with pull-up resistor)
Key input 0 to 2: Pin used for key-on wakeup 0 to 2
Port: A3 to A6 port: Pin used to input ports (Schmitt input, with pull-up resistor)
Key input 3 to 6: Pin used for key-on wakeup 3 to 6
Data bus 8 to 11for LCD driver
Port: A7 port: Pin used to input ports (Schmitt input, with pull-up resistor)
Key input 7: Pin used for key-on wakeup 7
Port C1: I/O port (Schmitt-input)
Interrupt request pin 1: Interrupt request pin with programmable rising/falling edge
8-bit timer 3 output: Timer 3 output
I/O
Port C2: I/O port (Schmitt-input)
Interrupt request pin 2: Interrupt request pin with programmable rising/falling edge
Timer B0 output
I/O
Port C3: I/O port (Schmitt-input)
Interrupt request pin 3: Interrupt request pin with programmable rising/falling edge
I/O
Port C6: I/O port
Key Output 8: Pin used of key-scan strobe (Open-drain output programmable)
Data invert enable for external TFT-LCD driver
I/O
Port C7: I/O port
Expand chip select: ZF: Outputs “0” when address is within specified address area
Shift-clock-1 for external TFT-LCD driver
I/O
Port F0: I/O port (Schmitt-input)
Serial 0 send data: Open-drain output programmable
Serial 1 send data: Open-drain output programmable
I/O
Port F1: I/O port (Schmitt-input)
Serial 0 receive data
Serial 1 receive data
I/O
Port F2: I/O port (Schmitt-input)
I/O
Serial 0 clock I/O
Serial 0 data send enable (Clear to send)
I/O
Serial 1 clock I/O
Serial 1 data send enable (Clear to send)
Port F7: Output port
Clock for SDRAM (When SDRAM is not used, SDCLK can be used as system clock)
Port G0 to G1 port: Pin used to input ports
Analog input 0 to 1: Pin used to Input to AD conveter
Port G2 port: Pin used to input ports
Analog input 2: Pin used to Input to AD conveter
X-Minus: Pin connectted to X− for touch screen panel
Port G3 port: Pin used to input ports
Analog input 3: Pin used to input to AD conveter
Y-Minus: Pin connectted to Y− for touch screen panel
AD trigger: Signal used to request AD start
92CH21-9
2009-06-19
TMP92CH21
Table 2.3.4 Pin Names and Functions (4/5)
Pin Name
PJ0
SDRAS
SRLLB
PJ1
SDCAS
SRLUB
PJ2
SDWE
SRWR
PJ3
SDLLDQM
PJ4
SDLUDQM
PJ5
SDULDQM
NDALE
PJ6
SDUUDQM
NDCLE
PJ7
SDCKE
PK0
LCP0
PK1
LLP
PK2
LFR
PK3
LBCD
PL0 to PL3
LD0 to LD3
PL4 to PL7
LD4 to LD7
Port J0: Output port
Row address strobe for SDRAM
Data enable for SRAM on pins D0 to D7
Port J1: Output port
Column address strobe for SDRAM
Data enable for SRAM on pins D8 to D15
Port J2: Output port
Write enable for SDRAM
Write for SRAM: Strobe signal for writing data
Port J3: Output port
Data enable for SDRAM on pins D0 to D7
Port J4: Output port
Data enable for SDRAM on pins D8 to D15
I/O
Port J5: I/O port
Data enable for SDRAM on pins D16 to D23
Address latch enable for NAND flash
I/O
Port J6: I/O port
Data enable for SDRAM on pins D24 to D31
Command latch enable for NAND flash
Port J7: Output port
Clock enable for SDRAM
Port K0: Output port
LCD driver output pin
Port K1: Output port
LCD driver output pin
Port K2: Output port
LCD driver output pin
Port K3: Output port
LCD driver output pin
Port L0 to L3: Output port
Data bus for LCD driver
I/O
Port L4 to L7: I/O port
Data bus for LCD driver
Port M1: Output port
Melody/alarm output pin
Port M2: Output port
RTC alarm output pin
Melody/alarm output pin (inverted)
Note: The output functions SDULDQM, NDALE of PJ5-pin and SDUUDQM, NDCLE of PJ6-pin cannot be
used simultaneously. Therefore, 32-bit SDRAM and NAND-Flash cannot be used at the same time.
VREFH 1 Input Pin for reference voltage input to AD converter (H)
VREFL 1 Input Pin for reference voltage input to AD converter (L)
AVCC 1 − Power supply pin for AD converter
AVSS 1 − GND pin for AD converter (0 V)
DVCC 4 − Power supply pins (All VCC pins should be connected to the power supply pin)
DVSS 3 − GND pins (0 V) (All pins should be connected to GND (0 V))
Number of
Pins
I/O Function
USB-data connecting pin
Connect pull-up resistor to both pins to avoid through current when USB is not in use.
Operation mode:
Fix to AM1 = “0”, AM0 = “1” for 16-bit external bus starting
Fix to AM1 = “1”, AM0 = “0” for 32-bit external bus starting
Fix to AM1 = “1”, AM0 = “1” for BOOT (32-bit internal MROM) starting
Note: Use a 9.0 MHz oscillator at pins X1/X2 when USB is used.
92CH21-11
2009-06-19
3. Operation
This section describes the basic components, functions and operation of the TMP92CH21.
3.1 CPU
The TMP92CH21 contains an advanced high-speed 32-bit CPU (TLCS-900/H1 CPU)
3.1.1 CPU Outline
The TLCS-900/H1 CPU is a high-speed, high-performance CPU based on the
TLCS-900/L1 CPU. The TLCS-900/H1 CPU has an expanded 32-bit internal data bus to
process instructions more quickly.
The following is an outline of the CPU:
Table 3.1.1 TMP92CH21 Outline
Parameter TMP92CH21
Width of CPU address bus 24 bits
Width of CPU data bus 32 bits
Internal operating frequency Max 20 MHz
Minimum bus cycle
Internal RAM 32-bit 1-clock access
1-clock access (50 ns at f
= 20MHz)
SYS
TMP92CH21
Internal boot ROM 32-bit 2-clock access
Internal I/O
External SRAM, Masked ROM
External SDRAM 16- or 32-bit min. 1-clock access
External NAND flash
Minimum instruction
execution cycle
Conditional jump
Instruction queue buffer 12 bytes
Instruction set
CPU mode Maximum mode only
Micro DMA 8 channels
8- or 16-bit 2-clock access or
8- or 16-bit 5 to 6-clock access
8- or 16- or 32-bit 2-clock access
(waits can be inserted)
8-bit min. 4-clock access
(waits can be inserted)
1-clock (50 ns at f
2-clock (100 ns at f
Compatible with TLCS-900/L1
(LDX instruction is deleted)
=20MHz)
SYS
=20MHz)
SYS
92CH21-12
2009-06-19
3.1.2 Reset Operation
When resetting the TMP92CH21, ensure that the power supply voltage is within the
operating voltage range, and that the internal high-frequency oscillator has stabilized.
Then hold the
At reset, since the clock doubler (PLL) is bypassed and the clock-gear is set to 1/16, the
system clock operates at 1.25 MHz (fc = 40 MHz).
When the reset has been accepted, the CPU performs the following:
• Sets the program counter (PC) as follows in accordance with the reset vector stored
• Sets the stack pointer (XSP) to 00000000H.
• Sets bits <IFF2:0> of the status register (SR) to 111 (thereby setting the interrupt
• Clears bits <RFP1:0> of the status register to 00 (there by selecting register bank
When the reset is released, the CPU starts executing instructions according to the
program counter settings. CPU internal registers not mentioned above do not change when
the reset is released.
When the reset is accepted, the CPU sets internal I/O, ports and other pins as follows.
•Initializes the internal I/O registers as shown in the “Special Function Register”
RESET
input low for at least 20 system clocks (16 µs at fc = 40 MHz).
at address FFFF00H to FFFF02H:
PC<7:0> ← data in location FFFF00H
PC<15:8> ← data in location FFFF01H
PC<23:16> ← data in location FFFF02H
level mask register to level 7).
0).
table in section 5.
TMP92CH21
•Sets the port pins, including the pins that also act as internal I/O, to
general-purpose input or output port mode.
Internal reset is released as soon as external reset is released.
Memory controller operation cannot be ensured until the power supply becomes stable
after power-on reset. External RAM data provided before turning on the TMP92CH21 may
be corrupted because the control signals are unstable until the power supply becomes
stable after power on reset.
VCC (3.3 V)
RESET
High-frequency oscillation stabilized time
+20 system clock
0 s (Min)
Figure 3.1.1 Power on Reset Timing Example
92CH21-13
2009-06-19
TMP92CH21
Read
Write
0FFFF00H
DATA-IN
((After reset released, starting 1
wait read cycle)
fsys×(13.5~14.5) clock
Pull up (Internal)
High-Z
Sampling
(Output mode)
(Output mode)
(Input mode)
(Input mode)
DATA-IN
DATA-OUT
32-bit external bus (AM1:0=10).
Note: This chart shows timing for a reset using a
sys
RESET
f
A23∼A0
CS2
CS0,1, 3
D0∼D31
RD
SRxxB
D0∼D31
WRxx
SRWR
PF7
SRxxB
PM1~PM2
PJ3~PJ4, PJ7
P40~P47,P50~P57
PL0~PL3
P74~P72, PK0~PK3,
PA0~PA7
P71~P72, P75~P76,
P90~P94, P96~P97,
PJ5~PJ6, PL4~PL7,
PF0~PF1, PG0~PG3,
PC0~PC3, PC6~PC7,
Figure 3.1.2 TMP92CH21 Reset Timing Chart
92CH21-14
2009-06-19
3.1.3 Setting of AM0 and AM1
Set AM1 and AM0 pins as shown in Table 3.1.2 according to system usage.
TMP92CH21
Table 3.1.2 Operation Mode Setup Table
Operation Mode
16-bit external bus starting
(MULTI 16 mode)
32-bit external bus starting
(MULTI 32 mode)
Boot (32-bit internal MROM) starting
(BOOT mode)
Mode Setup Input Pin
RESET AM1 AM0
0 1
1 0
1 1
92CH21-15
2009-06-19
=
3.2 Memory Map
Figure 3.2.1 is a memory map of the TMP92CH21.
000000H
000100H
001D00H
002000H
006000H
Internal I/O
(8 Kbytes)
Internal RAM
(16 Kbytes)
Direct area (n)
64-Kbyte area
(nn)
TMP92CH21
010000H
3FE000H
400000H
F00000H
F10000H
FFFF00H
FFFFFFH
Boot (Internal MROM)
External memory
Provisional emulator control
External memory
Vector table (256 bytes)
(8 Kbytes)
(64 Kbytes)
(Note 1)
(Note 2)
(Note 3)
16-Mbyte area
(R)
(
−R)
+)
(R
+ R8/16)
(R
(R
+ d8/16)
(nnn)
(
Internal area)
Figure 3.2.1 Memory Map
Note 1: Boot program (Internal MROM) is mapped only for BOOT mode. For other starting modes, its area (3FE000H to 3FFFFFH)
is mapped to external-memory.
Note 2: The Provisional emulator control area, mapped F00000H to F0FFFFH after reset, is for emulator use and so is not available.
When emulator
Note 3: Do not use the last 16-byte area (FFFFF0H to FFFFFFH). This area is reserved for an emulator.
WR signal and RD signal are asserted, this area is accessed. Ensure external memory is used.
92CH21-16
2009-06-19
3.3 Clock Function and Stand-by Function
The TMP92CH21 contains (1) clock gear, (2) clock doubler (PLL), (3) stand-by controller and
(4) noise reduction circuits. They are used for low power, low noise systems.
This chapter is organized as follows:
3.3.1 Block diagram of system clock
3.3.2 SFR
3.3.3 System clock controller
3.3.4 Clock doubler (PLL)
3.3.5 Noise reduction circuits
3.3.6 Stand-by controller
TMP92CH21
92CH21-17
2009-06-19
TMP92CH21
The clock operating modes are as follows: (a) single clock mode (X1, X2 pins only), (b) dual
clock mode (X1, X2, XT1 and XT2 pins) and (c) triple clock mode (X1, X2, XT1 and XT2 pins and
PLL).
Figure 3.3.1 shows a transition figure.
Reset
(f
/32)
OSCH
IDLE2 mode
(I/O operate)
IDLE1 mode
(Operate only oscillator)
IDLE2 mode
(I/O operate)
IDLE1 mode
(Operate only oscillator)
IDLE2 mode
(I/O operate)
IDLE1 mode
(Operate only oscillator)
Instruction
Interrupt
Instruction
Interrupt
(f
OSCH
(a) Single clock mode transition figure
Instruction
Interrupt
Instruction
Interrupt
Instruction
Interrupt
NORMAL
(f
OSCH
Instruction
Instruction
Interrupt
(b) Dual clock mode transition figure
Release reset
NORMAL mode
/gear value/2)
Reset
(f
/32)
OSCH
Release reset
mode
/gear value/2)
Interrupt
SLOW mode
(fs/2)
Instruction
Interrupt
Instruction
Interrupt
Instruction
Interrupt
STOP mode
(Stops all circuits)
STOP mode
(Stops all circuits)
STOP mode
(Stops all circuits)
Reset
(f
/32)
NORMAL
(f
OSCH
OSCH
Release reset
mode
/gear value/2)
IDLE2 mode
(I/O operate)
IDLE1 mode
Instruction
Interrupt
Instruction
Interrupt
(Operate only oscillator)
Interrupt
Instruction
Instruction
Note
Instruction
Interrupt
SLOW mode
(fs/2)
Instruction
Interrupt
Instruction
Interrupt
IDLE2 mode
(I/O operate)
IDLE1 mode
(Operate only oscillator)
IDLE2 mode
(I/O operate)
IDLE1 mode
(Operate oscillator and PLL)
Instruction
Interrupt
Instruction
Interrupt
Instruction
Note
NORMAL mode
(4 × f
Using PLL
OSCH
value/2)
Instruction
STOP mode
(Stops all circuits)
/gear
(c) Triple clock mode transition figure
Note 1: It is not possible to control PLL in SLOW mode when shifting from SLOW mode to NORMAL mode with use of PLL.
(PLL start up/stop/change write to PLLCR0<PLLON>, PLLCR1<FCSEL> register)
Note 2: When shifting from NORMAL mode with use of PLL to NORMAL mode, execute the following setting in the same order.
1) Change CPU clock (PLLCR0<FCSEL>
2) Stop PLL circuit (PLLCR1<PLLON>
Note 3: It is not possible to shift from NORMAL mode with use of PLL to STOP mode directly.
NORMAL mode should be set once before shifting to STOP mode. (Sstop the high-frequency oscillator after stopping
PLL.)
← “0”)
← “0”)
Figure 3.3.1 System Clock Block Diagram
The clock frequency input from the X1 and X2 pins is called fc and the clock frequency input from the XT1 and XT2 pins is called
fs. The clock frequency selected by SYSCR1<SYSCK> is called the clock f
clock of f
, and one cycle of f
FPH
is defined as one state.
SYS
92CH21-18
. The system clock f
FPH
is defined as the divided
SYS
2009-06-19
÷2÷16÷
φ
φ
÷
3.3.1 Block Diagram of System Clock
TMP92CH21
SYSCR0<XTEN >
XT1
XT2
X1
X2
Low-frequency
oscillator
SYSCR0<XEN >
High-frequency
oscillator
f
(48 MHz) = f
USB
f
SYS
φT0
f
OSCH
f
IO
OSCH
SYSCR0<WUEF>
SYSCR2<WUPTM1:0>
Warm-up timer
(High/low-frequency oscillator)
Lock up timer
(PLL)
PLLCR1<PLLON>,
fs
Clock doubler
× 16/3
PLLCR0<LUPFG>
f
= f
PLL
OSCH
(PLL)
TMRA0 to 3,TMRB0
Prescaler
SIO0 to SIO1
Prescaler
× 4
Selector
PLLCR0<FCSEL>
USBCR1<USBCLKE>
fc
fc/2
fc/4
fc/8
4
8
Clock-gear
fc/16
SYSCR1<SYSCK>
SYSCR1<GEAR2:0>
USB
Controller
CPU
RAM, ROM
Interrupt
controller
I2S
I/O ports
f
FPH
÷2
LCDC
Memory
controller
NAND flash
controller
TSI
÷4 ÷8
÷2
fs
f
f
IO
T
T0
SYS
RTC
fs
MLD/ALM
ADC
WDT
SDRAMC
Figure 3.3.2 Block Diagram of System Clock
Table 3.3.1 Selection Example for f
High-frequency
Oscillation: f
OSCH
System Clock:
OSCH
f
SYS
(a) USB in use, with PLL 9.0 MHz 18 MHz 48 MHz
(b) USB not in use, with PLL 10.0 MHz (max) 20 MHz (max)−
(c) USB not in use, without PLL
40.0 MHz (max) 20 MHz (max)−
Note: When using USB, the high-frequency oscillator should be 9.0 MHz.
USB Clock: f
USB
92CH21-19
2009-06-19
3.3.2 SFR
SYSCR0
(10E0H)
SYSCR1
(10E1H)
SYSCR2
(10E2H)
TMP92CH21
7 6 5 4 3 2 1 0
Bit symbol XEN XTEN WUEF
Read/Write R/W R/W
Reset state 1 1 0
Function High-
frequency
oscillator
(fc)
0: Stop
1: Oscillation
Lowfrequency
oscillator
(fs)
0: Stop
1: Oscillation
Warm-up
timer
0: Write
don’t care
1: Write
start
timer
0: Read
end
warm-up
1: Read
do not end
warm-up
7 6 5 4 3 2 1 0
Bit symbol SYSCK GEAR2 GEAR1 GEAR0
Read/Write R/W R/W
Reset state 0 1 0 0
Function
Select
system clock
0: fc
1: fs
Select gear value of high-frequency (fc)
000: fc
001: fc/2
010: fc/4
011: fc/8
100: fc/16
101: (Reserved)
110: (Reserved)
111: (Reserved)
7 6 5 4 3 2 1 0
Bit symbol − WUPTM1WUPTM0HALTM1HALTM0
Read/Write R/W R/W R/W R/W R/W
Note 1: The unassigned registers, SYSCR0<bit5:3>, SYSCR0<bit1:0>, SYSCR1<bit7:4>, and
SYSCR2<bit6, bit1:0> are read as undefined value.
Note 2: Low-frequency oscillator is enabled on reset.
Figure 3.3.3 SFR for System Clock
92CH21-20
2009-06-19
EMCCR0
(10E3H)
EMCCR1
(10E4H)
EMCCR2
(10E5H)
TMP92CH21
7 6 5 4 3 2 1 0
Bit symbol PROTECT EXTIN
Read/Write R R/W R/W R/W
Reset state 0 0 1 1
Function Protect flag
0: OFF
1: ON
Bit symbol
Read/Write
Reset state
Function
Bit symbol
Read/Write
Reset state
Function
Note: When restarting the oscillator from the stop oscillation state (e.g. restarting the oscillator in STOP mode), set
EMCCR0<DRVOSCH>, <DRVOSCL>=”1”.
Switch the protect ON/OFF by writing the following to 1st-KEY, 2nd-KEY
1st-KEY: write in sequence EMCCR1
2nd-KEY: write in sequence EMCCR1
1: External
clock
= 5AH, EMCCR2 = A5H
= A5H, EMCCR2 = 5AH
DRVOSCH DRVOSCL
fc oscillator
driver ability
1: Normal
0: Weak
fs oscillator
driver ability
1: Normal
0: Weak
Figure 3.3.4 SFR for System Clock
92CH21-21
2009-06-19
PLLCR0
(10E8H)
PLLCR1
(10E9H)
TMP92CH21
7 6 5 4 3 2 1 0
Bit symbol FCSEL LUPFG
Read/Write R/W R
Reset state 0 0
Lock up
timer
status flag
0: Not end
1: End
Function Select fc
clock
0: f
OSCH
1: f
PLL
Note: Ensure that the logic of PLLCR0<LUPFG> is different from 900/L1’s DFM.
7 6 5 4 3 2 1 0
Bit symbol PLLON
Read/Write R/W
Reset state 0
Function Control
on/off
0: OFF
1: ON
PxDR
(xxxxH)
Figure 3.3.5 SFR for PLL
7 6 5 4 3 2 1 0
Bit symbol Px7D Px6D Px5D Px4D Px3D Px2D
Read/Write R/W
Reset state 1 1 1 1 1 1 1 1
Function Output/input buffer drive-register for stand-by mode
(Purpose and use)
This register is used to set each pin status at stand-by mode.
All ports have registers of the format shown above. (“x” indicates the port name.)
For each register, refer to “3.5 Function of ports”.
Before “Halt” instruction is executed, set each register according to the expected pin-status. They will be effective
after the CPU has executed the “Halt” instruction.
This is the case regardless of stand-by mode (IDLE2, IDLE1 or STOP).
The output/input buffer control table is shown below.
OE PxnD Output BufferInput Buffer
0 0 OFF OFF
0 1 OFF ON
1 0 OFF OFF
1 1 ON OFF
Note 1: OE denotes an output enable signal before stand-by mode.
Basically, PxCR is used as OE.
Note 2: “n” in PxnD denotes the bit number of PORTx.
Px0D
Px1D
Figure 3.3.6 SFR for Drive Register
92CH21-22
2009-06-19
3.3.3 System Clock Controller
TMP92CH21
The system clock controller generates the system clock signal (f
) for the CPU core and
SYS
internal I/O. It contains two oscillation circuits and a clock gear circuit for high-frequency
(fc) operation. The register SYSCR1<SYSCK> changes the system clock to either fc or fs,
SYSCR0<XEN> and SYSCR0<XTEN> control enabling and disabling of each oscillator,
and SYSCR1<GEAR2:0> sets the high-frequency clock gear to either 1, 2, 4, 8 or 16 (fc, fc/2,
fc/4, fc/8 or fc/16). These functions can reduce the power consumption of the equipment in
which the device is installed.
The combination of settings <XEN> = 1, <SYSCK> = 0 and <GEAR2:0> = 100 will cause
the system clock (f
For example, f
) to be set to fc/32 (fc/16 × 1/2) after reset.
SYS
is set to 1.25 MHz when the 40 MHz oscillator is connected to the X1
SYS
and X2 pins.
(1) Switching from normal mode to slow mode
When the resonator is connected to the X1 and X2 pins, or to the XT1 and XT2 pins,
the warm-up timer can be used to change the operation frequency after stable
oscillation has been attained.
The warm-up time can be selected using SYSCR2<WUPTM1:0>.
This warm-up timer can be programmed to start and stop as shown in the following
examples 1 and 2.
Table 3.3.2 shows the warm-up time.
Note 1: When
using an oscillator (other than
a resonator) with stable oscillation, a warm-up
timer is not needed.
Note 2: The warm-up timer is operated by an oscillation clock. Hence, there may be some
SET 6, (SYSCR0) ; Enables low-frequency oscillation.
SET 2, (SYSCR0) ; Clears and starts warm-up timer.
WUP: BIT 2, (SYSCR0) ;
JR NZ, WUP ;
SET 3, (SYSCR1) ; Changes f
RES 7, (SYSCR0) ; Disables high-frequency oscillation.
X: Don’t care,
<XEN>
X1, X2 pins
<XTEN>
XT1, XT2 pins
Changing from high-frequency (fc) to low-frequency (fs).
− X
B ; Sets warm-up time to 216/fs.
Detects stopping of warm-up timer.
from fc to fs.
SYS
−: No change
TMP92CH21
Warm-up timer
End of warm-up timer
<SYSCK>
System clock f
SYS
Counts up by f
Enables
low-frequency
Counts up by fs
SYS
fc
Clears and starts
warm-up timer
Chages f
from fc to fs
End of warm-up timer
fs
Disabiles
SYS
high-frequency
92CH21-24
2009-06-19
1 0 −
X
r
r
Example 2: Setting the clock
Changing from low-frequency (fs) to high-frequency (fc).
SET 7, (SYSCR0) ; Enables high-frequency oscillation.
SET 2, (SYSCR0) ; Clears and starts warm-up timer.
WUP: BIT 2, (SYSCR0) ;
JR NZ, WUP ;
RES 3, (SYSCR1) ; Changes f
RES 6, (SYSCR0) ; Disables low-frequency oscillation.
X: Don’t care,
<XEN>
X1, X2 pins
<XTEN>
XT1, XT2 pins
−: No change
− X
B ; Sets warm-up time to 214/fc.
Detects stopping of warm-up timer.
SYS
TMP92CH21
from fs to fc.
Warm-up timer
End of warm-up timer
<SYSCK>
System Clock f
SYS
Counts up by f
Enables
high-frequency
SYS
Clears and starts
warm-up time
Counts up by fc
Changes f
from fs to fc
End of warm-up
time
fcfs
SYS
Disables
low-frequency
92CH21-25
2009-06-19
TMP92CH21
(2) Clock gear controller
f
is set according to the contents of the clock gear select register
FPH
SYSCR1<GEAR2:0> to either fc, fc/2, fc/4, fc/8 or fc/16. Using the clock gear to select a
lower value of f
reduces power consumption.
FPH
Example 3: Changing to a high-frequency gear
SYSCR1 EQU 10E1H
LD (SYSCR1), XXXX0000B;Changes f
LD (DUMMY), 00H ;Dummy instruction
X: Don’t care
SYS
to fc/2.
(High-speed clock gear changing)
To change the clock gear, write the register value to the SYSCR1<GEAR2:0>
register.It is necessary for the warm-up time to elapse before the change occurs after
writing the register value.
There is the possibility that the instruction following the clock gear changing
instruction is executed by the clock gear before changing.To execute the instruction
following the clock gear switching instruction by the clock gear after changing, input
the dummy instruction as follows (instruction to execute the write cycle).
Instruction to be executed after clock gear has changed
SYS
to fc/4.
92CH21-26
2009-06-19
X X X XX X
X X XX X
A
3.3.4 Clock Doubler (PLL)
TMP92CH21
PLL outputs the f
clock signal, which is four times as fast as f
PLL
OSCH
. A
low-speed-frequency oscillator can be used, even though the internal clock is
high-frequency.
A reset initializes PLL to stop status, so setting to PLLCR0, PLLCR1 register is needed
before use.
As with an oscillator, this circuit requires time to stabilize. This is called the lock up time
and it is measured by a 16-stage binary counter. Lock up time is about 1.6 ms at f
OSCH
= 10
MHz.
Note 1: Input frequency range for PLL
The input frequency range (High-frequency oscillation) for PLL is as follows:
f
= 6 to 10 MHz (VCC = 3.0 to 3.6 V)
OSCH
Note 2: PLLCR0<LUPFG>
The logic of PLLCR0<LUPFG> is different from 900/L1’s DFM.
Exercise care in determining the end of lock up time.
The following is an example of settings for PLL starting and PLL stopping.
LD (SYSCR1), − − − − 1 − − − B ; Change the system clock f
LD (PLLCR0),
LD (PLLCR1), 0
LD (SYSCR0), 0
−
0 −
− − − − − − −
− − − − − − −
B ; Change the internal clock (fC) f
B ; PLL stop
B ; High-frequency oscillator stop
PLL
to fs
PLL
to
f
OSCH
(OK) PLL use mode (f
operation mode (f
) → Set the STOP mode → High-frequency oscillator
PLL
) → PLL stop → Halt (High-frequency oscillator stop)
OSCH
LD (SYSCR2), −
LD (PLLCR0),
LD (PLLCR1), 0
HALT
−
01−
0 −
− − − − − − −
B ; Set the STOP mode
(This command can be executed before use of PLL)
B ;Change the system clock f
B ;PLL stop
; Shift to STOP mode
PLL
to f
OSCH
(Error) PLL use mode (f
) → Set the STOP mode → Halt (High-frequency
PLL
oscillator stop)
LD (SYSCR2), −
HALT
01−
B ; Set the STOP mode
(This command can execute before use of PLL)
; Shift to STOP mode
92CH21-30
2009-06-19
3.3.5 Noise Reduction Circuits
Noise reduction circuits are built-in, allowing implementation of the following features.
(1) Reduced drivability for high-frequency oscillator
(2) Reduced drivability for low-frequency oscillator
(3) Single drive for high-frequency oscillator
(4) SFR protection of register contents
(1) Reduced drivability for high-frequency oscillator
(Purpose)
Reduces noise and power for oscillator when a resonator is used.
(Block diagram)
Resonator
C1
X1 pin
f
OSCH
Enable oscillation
EMCCR0<DRVOSCH>
TMP92CH21
C2
X2 pin
(Setting method)
The drive ability of the oscillator is reduced by writing “0” to
EMCCR0<DRVOSCH> register. At reset, <DRVOSCH> is initialized to “1” and the
oscillator starts oscillation by normal drivability when the power-supply is on.
Note: This function (EMCCR0<DRVOSCH> = “0”) is available when
f
= 6 to 10 MHz.
OSCH
92CH21-31
2009-06-19
TMP92CH21
(2) Reduced drivability for low-frequency oscillator
(Purpose)
Reduces noise and power for oscillator when a resonator is used.
(Block diagram)
C1
Resonator
C2
XT1 pin
Enable oscillation
EMCCR0<DRVOSCL>
fS
XT2 pin
(Setting method)
The drive ability of the oscillator is reduced by writing 0 to the
EMCCR0<DRVOSCL> register. At reset, <DRVOSCL> is initialized to “1”.
(3) Single drive for high-frequency oscillator
(Purpose)
Remove the need for twin drives and prevent operational errors caused by noise
input to X2 pin when an external oscillator is used
.
(Block diagram)
f
OSCH
X1 pin
Enable oscillation
EMCCR0<DRVOSCH>
X2 pin
(Setting method)
The oscillator is disabled and starts operation as buffer by writing “1” to
EMCCR0<EXTIN> register. X2 pin’s output is always “1”.
At reset, <EXTIN> is initialized to “0”.
92CH21-32
2009-06-19
(4) Runaway prevention using SFR protection register
(Purpose)
Prevention of program runaway caused by introduction of noise.
Write operations to a specified SFR are prohibited so that the program is
protected from runaway caused by stopping of the clock or by changes to the
memory control register (memory controller, MMU) which prevent fetch
operations.
Runaway error handling is also facilitated by INTP0 interruption.
Execute and release of protection (write operation to specified SFR) becomes
possible by setting up a double key to EMCCR1 and EMCCR2 registers.
(Double key)
1st KEY: writes in sequence, 5AH at EMCCR1 and A5H at EMCCR2
2nd KEY: writes in sequence, A5H at EMCCR1 and 5AH at EMCCR2
Protection state can be confirmed by reading EMCCR0<PROTECT>.
At reset, protection becomes OFF.
INTP0 interruption also occurs when a write operation to the specified SFR is
executed with protection in the ON state.
92CH21-33
2009-06-19
3.3.6 Stand-by Controller
(1) HALT modes and port drive register
When the HALT instruction is executed, the operating mode switches to IDLE2,
IDLE1 or STOP mode, depending on the contents of the SYSCR2<HALTM1:0> register
and each pin-status is set according to the PxDR register, as shown below:
7 6 5 4 3 2 1 0
PxDR
(xxxxH)
Bit symbol Px7D Px6D Px5D Px4D Px3D Px2D
Read/Write R/W
Reset state 1 1 1 1 1 1 1 1
Function Output/input buffer drive register for stand-by mode
(Purpose and use)
• This register is used to set each pin status at stand-by mode.
• All ports have this registers of the format shown above. (“x” indicates the port name.)
• For each register, refer to 3.5 function of ports.
• Before “Halt” instruction is executed, set each register according to the expected pin status. They will be effective
after the CPU has executed the “Halt” instruction.
• This is the case regardless of stand-by mode (IDLE2, IDLE1 or STOP).
• The Output/Input buffer control table is shown below.
Note 1: OE denotes an output enable signal before stand-by mode.
Basically, PxCR is used as OE.
Note 2: “n” in PxnD denotes the bit number of PORTx
The subsequent actions performed in each mode are as follows:
1. IDLE2: only the CPU halts.
OE PxnD Output BufferInput Buffer
0 0 OFF OFF
0 1 OFF ON
1 0 OFF OFF
1 1 ON OFF
TMP92CH21
Px0D
Px1D
The internal I/O is available to select operation during IDLE2 mode by setting
the following register.
Table 3.3.3 shows the register settin
g operat
ion during IDLE2 mode.
Table 3.3.3 SFR Setting Operation during IDLE2 Mode
2. IDLE1: Only the oscillator, RTC (real-time clock) and MLD continue to operate.
3. STOP: All internal circuits stop operating.
92CH21-34
2009-06-19
TMP92CH21
The operation of each of the different HALT modes is described in Table 3.3.4.
T
able 3.3.4 I/O Operation duri
ng HALT Modes
HALT Mode IDLE2 IDLE1 STOP
SYSCR2<HALTM1:0> 11 10 01
CPU Stop
I/O ports Depend on PxDR register setting
TMRA, TMRB
Block
SIO
AD converter
WDT
I2S, LCDC, SDRAMC,
Interrupt controller,
USBC,
RTC, MLD
Available to select
operation block
Stop
Operate
Operate
(2) How to release the HALT mode
These halt states can be released by resetting or requesting an interrupt. The halt
release sources are determined by the combination of the states of the interrupt mask
register <IFF2:0> and the HALT modes. The details for releasing the halt status are
shown in Table 3.3.5.
Release by in
terrupt requesting
he HALT mode release method depends on the status of the enabled
T
interrupt .When the interrupt request level set before executing the HALT
instruction exceeds the value of the interrupt mask register, the interrupt is
processed depending on its status after the HALT mode is released, and the CPU
status executing the instruction that follows the HALT instruction. When the
interrupt request level set before executing the HALT instruction is less than the
value of the interrupt mask register, HALT mode release is not executed. (in
non-maskable interrupts, interrupt processing is processed after releasing the
HALT mode regardless of the value of the mask register.) However only for INT0 to
INT4, INTKEY, INTRTC, INTALM and INTUSB interrupts, even if the interrupt
request level set before executing the halt instruction is less than the value of the
interrupt mask register, HALT mode release is executed. In this case, the interrupt
is processed, and the CPU starts executing the instruction following the HALT
instruction, but the interrupt request flag is held at “1”.
Release by resetting
Release of all halt statuses is executed by resetting.
When the STOP mode is released by RESET, it is necessary to allow enough
resetting time (see Table 3.3.6) for operation of the
oscillator to
stabilize.
When releasing the HALT mode by resetting, the internal RAM data keeps the
state before the HALT instruction is executed. However the other settings contents
are initialized. (Releasing due to interrupts keeps the state before the HALT
instruction is executed.)
92CH21-35
2009-06-19
Table 3.3.5 Source of Halt State Clearance and Halt Clearance Operation
TMP92CH21
Status of Received Interrupt
Interrupt Enabled
Interrupt level) ≥ (Interrupt mask)
(
Interrupt Disabled
Interrupt level) < (Interrupt mask)
(
HALT Mode IDLE2 IDLE1 STOP IDLE2 IDLE1 STOP
INTWD ♦× × − − −
INT0 to INT4 (Note 1) ♦ ♦ ♦*1 ○ ○○*1
INTALM0 to INTALM4 ♦ ♦ × ○ ○ ×
INTTA0 to INTTA3,
INTTB0 to INTTB1
INTRX0 to INTRX1,
TX0 to TX1
♦: After clearing the HALT mode, CPU starts interrupt processing.
○: After clearing the HALT m ode, CPU resumes executin g starting from the instruction follo wing the HALT
instruction.
×: Cannot be used to release the HALT mode.
−: The priority level (interrupt request level) of non-maskable interrupts is fixed to 7, the highest priority
level. This combination is not available.
*1: Release of the HALT mode is executed after warm-up time has elapsed.
*2: 6 interrupts of all 24 INTUSB sources can release Halt state from IDLE1 mode, allowing for the
construction of low power dissipation systems. However, the method of use is limited as below.
Shift to IDLE1 mode :
Execute Halt instruction when the flag of INT_SUS or INT_CLKSTOP is “1” ( SUSPEND state )
Release from IDLE1 mode :
Release Halt state by INT_RESUME or INT_CLKON request (release SUSPEND request)
Release Halt state by INT_URST_STR or INT_URST_END request (RESET request)
Example: Releasing IDLE1 mode
An INT0 interrupt clears the halt state when the device is in IDLE1 mode.
Address
8200H LD (PCFC), 01H ; Sets PC0 to INT0.
8203H LD (IIMC), 00H ; Selects INT0 interrupt rising edge.
8206H LD (INTE0AD), 06H ; Sets INT0 interrupt level to 6.
8209H EI 5 ; Sets interrupt level to 5 for CPU.
820BH LD (SYSCR2), 28H ; Sets HALT mode to IDLE1 mode.
820EH HALT ; Halts CPU.
INT0 INT0 interrupt routine
RETI
820FH LD XX, XX
92CH21-36
2009-06-19
r
TMP92CH21
(3) Operation
1. IDLE2 mode
In IDLE2 mode only specific internal I/O operations, as designated by the
IDLE2 setting register, can take place. Instruction execution by the CPU stops.
Figure 3.3.7 illustrates an example of the timing for clearance of the IDLE2
de halt state by an interrupt.
mo
X1
A0 to A23
D0 to D31
RD
WR
Interrupt for
release
Figure 3.3.7
Data
IDLE2
mode
Timing Chart for IDLE2 Mode Halt State Cleared by Interrupt
Data
2. IDLE1 mode
In IDLE1 mode, only the internal oscillator and the RTC and MLD continue to
operate. The system clock stops.
In the halt state, the interrupt request is sampled asynchronously with the
system clock; however, clearance of the halt state (e.g., restart of operation) is
synchronous with it.
Figure 3.3.8 illustrates the timing for clearance of the IDLE1 mode halt state by
an interrupt.
X1
A0 to A23
D0 to D31
RD
WR
Interrupt fo
release
Figure 3.3.8 Timing Char
Data
IDLE1
mode
t for IDLE1 Mode Halt State Cleared by Interrupt
92CH21-37
Data
2009-06-19
r
3. STOP mode
oscillator.
warm-up time has elapsed, in order to allow oscillation to stabilize.
an interrupt.
TMP92CH21
When STOP mode is selected, all internal circuits stop, including the internal
After STOP mode has been cleared system clock output starts when the
Figure 3.3.9 illustrates the timing for clearance of the STOP mode halt state by
Warm-up time
X1
A0 to A23
D0 to D31
Data
Data
RD
WR
Interrupt fo
release
STOP
mode
Figure 3.3.9 T
iming Chart for STOP Mode Halt State Cleared by Interrupt
Table 3.3.6 Example of Warm-up Time after Releasing STOP Mode
at f
SYSCR1
<SYSCK>
0 (fc) 6.4 μs 409.6 μs 1.638 ms
1 (fs) 7.8 ms 500 ms 2000 ms
8
) 10 (214) 11 (216)
01 (2
SYSCR2<WUPTM1:0>
= 40 MHz, fs = 32.768 kHz
OSCH
92CH21-38
2009-06-19
TMP92CH21
Table 3.3.7 Input Buffer State Table
Input Buffer State
In HALT mode (IDLE1/2/STOP)
<PxDR>
as
= 1 <PxDR> = 0
When used
as
Input pin
When used
as
Function pin
When used
Input pin
as
Port Name
Input
Function
Name
During
Reset
When the CPU is
operating
When used
as
Function pin
When used
as
Input pin
When used
Function pin
D0 to D7 D0 to D7 OFF − OFF − OFF −
P10 to P17 D8 to D15
P20 to P27 D16 to D23
P30 to P37 D24 to D31
P60 to P67 −
P71 to P72 −
P75
NDRB
P76 WAIT
16bit start : OFF
32bit start : OFF
Boot start : ON
16bit start : ON
32bit start : OFF
Boot start : ON
16bit start : OFF
32bit start : OFF
Boot start : ON
ON upon
external
read
OFF OFF
− − −
ON ON OFF
P90 −−−−
P91 RXD0
P92
CTS0,
SCLK0
P93 to P94 −−−−
1
*
P96
INT4
P97 INT5
1
PA0 to PA7
*
KI0-KI7
ON
PC0 INT0
ON ON OFF
ON
ON
OFF
ON ON OFF
PC1 INT1
PC2 INT2
PC3 INT3
PC6 to PC7 −
PF0 −
− − −
PF1 RXD0/1
PF2
PG0 to PG2
*
PG3
PJ5 to PJ6 −
PL4 to PL7 −
CTS0/1
SCLK0/1
2
*
−−−−
2
ADTRG
OFF
ON
ON
ON upon
ON
port read
− ON − ON −
ON: The buffer is always turned on. A current flows through the input
buffer if the input pin is not driven.
OFF:
The buffer is always turned off.
ON
ON
OFF
OFF
ON
*1: Port having a pull-up/pull-down resistor.
*2: AIN input does not cause a current to flow through the
The buffer is always turned on.*1: Port having a pull-up/pull-down resistor.
OFF:
The buffer is always turned off.
−: Not applicable
In HALT mode (IDLE1/2/STOP)
<PxDR>=1 <PxDR>=0
as
When used
as
Output pin
When used
as
Function pin
When used
as
Output pin
OFF
ON
OFF
IDLE2/1:ON,
−
STOP: output ”H”
IDLE2/1:ON,
STOP: output ”HZ”
92CH21-41
2009-06-19
3.4 Interrupts
Interrupts are controlled by the CPU Interrupt mask register <IFF2:0> (bits12 to 14 of the
status register) and by the built-in interrupt controller.
The TMP92CH21 has a total of 50 interrupts divided into the following five types:
A fixed individual interrupt vector number is assigned to each interrupt source.
Any one of six levels of priority can also be assigned to each maskable interrupt.
Non-maskable interrupts have a fixed priority level of 7, the highest level.
When an interrupt is generated, the interrupt controller sends the priority of that interrupt
to the CPU. When more than one interrupt is generated simultaneously, the interrupt
controller sends the priority value of the interrupt with the highest priority to the CPU. (The
highest priority level is 7, the level used for non-maskable interrupts.)
The CPU compares the interrupt priority level which it receives with the value held in the
CPU interrupt mask register <IFF2:0>. If the priority level of the interrupt is greater than or
equal to the value in the interrupt mask register, the CPU accepts the interrupt.
However, software interrupts and illegal instruction interrupts generated by the CPU are
processed irrespective of the value in <IFF2:0>.
The value in the interrupt mask register <IFF2:0> can be changed using the EI instruction
(EI num sets <IFF2:0> to num). For example, the command EI 3 enables the acceptance of all
non-maskable interrupts and of maskable interrupts whose priority level, as set in the
interrupt controller, is 3 or higher. The commands EI and EI 0 enable the acceptance of all
non-maskable interrupts and of maskable interrupts with a priority level of 1 or above (hence
both are equivalent to the command EI 1).
The DI instruction (sets <IFF2:0> to 7) is exactly equivalent to the EI 7 instruction. The DI
instruction is used to disable all maskable interrupts (since the priority level for maskable
interrupts ranges from 1 to 6). The EI instruction takes effect as soon as it is executed.
In addition to the general purpose interrupt processing mode described above, there is also a
micro DMA processing mode.
In micro DMA mode the CPU automatically transfers data in one-byte, two-byte or four-byte
blocks; this mode allows high-speed data transfer to and from internal and external memory
and internal I/O ports.
In addition, the TMP92CH21 also has a software start function in which micro DMA
processing is requested in software rather than by an interrupt.
Figure 3.4.1 is a flowchart showing overall interrupt processing.
Internal I/O interrupts: 26 sources
Micro DMA transfer end interrupts: 8 sources
External interrupts: 7 sources
Interrupts on external pins (INT0 to INT5, INTKEY)
92CH21-42
2009-06-19
TMP92CH21
Interrupt processing
Micro DMA soft
start request
Interrupt specified
by micro DMA
start vector ?
NO
YES
Clear interrupt request flag
General-purpose
interrupt
processing
Interrupt vector calue “V”
read interrupt request F/F clear
PUSH PC
PUSH SR
SR<IFF2:0> ← Level of
INTNEST ← INTNEST + 1
PC ← (FFFF00H + V)
accepted
interrupt + 1
Data transfer by micro
DMA
COUNT ← COUNT − 1
COUNT = 0
NO
Micro DMA
processing
YES
Clear vector register
generating micro DMA
transfer end interrupt
(INTTC0 to 7)
Interrupt processing
program
RETI instruction
POP SR
POP PC
INTNEST ← INTNEST − 1
End
Figure 3.4.1 Interrupt and Micro DMA Processing Sequence
92CH21-43
2009-06-19
3.4.1 General-purpose Interrupt Processing
When the CPU accepts an interrupt, it usually performs the following sequence of
operations. However, in the case of software interrupts and illegal instruction interrupts
generated by the CPU, the CPU skips steps (1) and (3), and executes only steps (2), (4) and
(5).
(1) The CPU reads the interrupt vector from the interrupt controller.
When more than one interrupt with the same priority level has been generated
simultaneously, the interrupt controller generates an interrupt vector in accordance
with the default priority and clears the interrupt requests.
(The default priority is determined as follows: the smaller the vector value, the
higher the priority.)
(2) The CPU pushes the program counter (PC) and status register (SR) onto the top of the
stack (pointed to by XSP).
(3) The CPU sets the value of the CPU’s interrupt mask register <IFF2:0> to the priority
level for the accepted interrupt plus 1. However, if the priority level for the accepted
interrupt is 7, the register’s value is set to 7.
TMP92CH21
(4) The CPU increments the interrupt nesting counter INTNEST by 1.
(5) The CPU jumps to the address given by adding the contents of address FFFF00H + the
interrupt vector, then starts the interrupt processing routine.
On completion of interrupt processing, the RETI instruction is used to return control to
the main routine. RETI restores the contents of the program counter and the status
register from the stack and decrements the interrupt nesting counter INTNEST by 1.
Non-maskable interrupts cannot be disabled by a user program. Maskable interrupts,
however, can be enabled or disabled by a user program. A program can set the priority level
for each interrupt source. (A priority level setting of 0 or 7 will disable an interrupt
request.)
If an interrupt request is received for an interrupt with a priority level equal to or greater
than the value set in the CPU interrupt mask register <IFF2:0>, the CPU will accept the
interrupt. The CPU interrupt mask register <IFF2:0> is then set to the value of the priority
level for the accepted interrupt plus 1.
If during interrupt processing, an interrupt is generated with a higher priority than the
interrupt currently being processed, or if, during the processing of a non-maskable
interrupt processing, a non-maskable interrupt request is generated from another source,
the CPU will suspend the routine which it is currently executing and accept the new
interrupt. When processing of the new interrupt has been completed, the CPU will resume
processing of the suspended interrupt.
If the CPU receives another interrupt request while performing processing steps (1) to (5),
the new interrupt will be sampled immediately after execution of the first instruction of its
interrupt processing routine. Specifying DI as the start instruction disables nesting of
maskable interrupts.
A reset initializes the interrupt mask register <IFF2:0> to 111, disabling all maskable
interrupts.
Table 3.4.1 shows the TMP92CH21 interrupt vectors and micro DMA start vectors.
FFFF00H to FFFFFFH (256 bytes) is designated as the interrupt vector area.
92CH21-44
2009-06-19
Table 3.4.1 TMP92CH21 Interrupt Vectors and Micro DMA St art Vectors
51 (Reserved) 00C8H FFFFC8H 32H
52 INTAD: AD conversion end 00CCH FFFFCCH 33H
53 INTTC0: Micro DMA end (Channel 0) 00D0H FFFFD0H 34H
54 INTTC1: Micro DMA end (Channel 1) 00D4H FFFFD4H 35H
55 INTTC2: Micro DMA end (Channel 2) 00D8H FFFFD8H 36H
56 INTTC3: Micro DMA end (Channel 3) 00DCH FFFFDCH 37H
57 INTTC4: Micro DMA end (Channel 4) 00E0H FFFFE0H 38H
58 INTTC5: Micro DMA end (Channel 5) 00E4H FFFFE4H 39H
59 INTTC6: Micro DMA end (Channel 6) 00E8H FFFFE8H 3AH
60 INTTC7: Micro DMA end (Channel 7) 00ECH FFFFECH 3BH
−
to
−
Type
Maskable
(Reserved)
Interrupt Source and Source of
Micro DMA Reque st
Vector
Value
00F0H
:
00FCH
Address Refer
to Vector
FFFFF0H
:
FFFFFCH
Micro
DMA Start
Vector
−
to
−
Note 1: Micro DMA default priority.
Micro DMA initiation takes priority over other maskable interrupts.
Note 2: When initiating micro DMA, set at edge detect mode.
92CH21-46
2009-06-19
3.4.2 Micro DMA Processing
In addition to general purpose interrupt processing, the TMP92CH21 also includes a
micro DMA function. Micro DMA processing for interrupt requests set by micro DMA is
performed at the highest priority level for maskable interrupts (level 6), regardless of the
priority level of the interrupt source.
Because the micro DMA function is implemented through the CPU, when the CPU is
placed in a stand-by state by a Halt instruction, the requirements of the micro DMA will be
ignored (pending).
Micro DMA supports 8 channels and can be transferred continuously by specifying the
micro DMA burst function as below.
Note: When using the micro DMA transfer end interrupt, always write “1” to bit 7 of SIMC register.
(1) Micro DMA operation
When an interrupt request is generated by an interrupt source specified by the micro
DMA start vector register, the micro DMA triggers a micro DMA request to the CPU at
interrupt priority level 6 and starts processing the request. The eight micro DMA
channels allow micro DMA processing to be set for up to eight types of interrupt at
once.
When micro DMA is accepted, the interrupt request flip-flop assigned to that
channel is cleared. Data in one-byte, two-byte or four-byte blocks, is automatically
transferred at once from the transfer source address to the transfer destination
address set in the control register, and the transfer counter is decremented by 1. If the
value of the counter after it has been decremented is not 0, DMA processing ends with
no change in the value of the micro DMA start vector register. If the value of the
decremented counter is 0, a micro DMA transfer end interrupt (INTTC0 to INTTC7) is
sent from the CPU to the interrupt controller. In addition, the micro DMA start vector
register is cleared to 0, the next micro DMA operation is disabled and micro DMA
processing terminates.
If micro DMA requests are set simultaneously for more than one channel, priority is
not based on the interrupt priority level but on the channel number: the lower the
channel number, the higher the priority (channel 0 thus has the highest priority and
channel 7 the lowest).
If an interrupt request is triggered for the interrupt source in use during the interval
between the time at which the micro DMA start vector is cleared and the next setting,
general purpose interrupt processing is performed at the interrupt level set. Therefore,
if the interrupt is only being used to initiate micro DMA (and not as a general-purpose
interrupt), the interrupt level should first be set to 0 (i.e., interrupt requests should be
disabled).
TMP92CH21
If micro DMA and general purpose interrupts are being used together as described
above, the level of the interrupt which is being used to initiate micro DMA processing
should first be set to a lower value than all the other interrupt levels. (Note) In this
case, edge triggered interrupts are the only kinds of general interrupts which can be
accepted.
Note: If the priority level of micro DMA is set higher than that of other interrupts, CPU operates as follows.
In case INTxxx interrupt is generated first and then INTyyy interrupt is generated between checking
“Interrupt specified by micro DMA start vector” (in the Figure 3.4.1) and reading interrupt vector with
setting below. The vector shifts to that of INT
This is because the priority level of INTyyy is higher than that of INTxxx.
In the interrupt routine, CPU reads the vector of INTyyy because cheking of micro DMA has finished.
And INTyyy is generated regardless of transfer counter of micro DMA.
INTxxx: level 1 without micro DMA
INTyyy: level 6 with micro DMA
yyy at the time.
92CH21-47
2009-06-19
A
TMP92CH21
Although the control registers used for setting the transfer source and transfer
destination addresses are 32 bits wide, this type of register can only output 24-bit
addresses. Accordingly, micro DMA can only access 16 Mbytes (the upper eight bits of a
32-bit address are not valid).
Three micro DMA transfer modes are supported: one-byte transfers, two-byte
(one-word) transfer and four-byte transfer. After a transfer in any mode, the transfer
source and transfer destination addresses will either be incremented or decremented,
or will remain unchanged. This simplifies the transfer of data from memory to memory,
from I/O to memory, from memory to I/O, and from I/O to I/O. For details of the various
transfer modes, see section 3.4.2 (1), detailed description of the transfer mode register.
Since a transfer counter is a 16-bit counter, up to 65536 micro DMA processing
operations can be performed per interrupt source (provided that the transfer counter
for the source is initially set to 0000H).
Micro DMA processing can be initiated by any one of 34 different interrupts – the 33
interrupts shown in the micro DMA start vectors in Table 3.4.1 and a micro DMA soft
start.
Figure 3.4.2 shows a 2-byte transfer carried out us
ing a micro
DMA cycle in transfer
destination address INC mode (micro DMA transfers are the same in every mode
except counter mode). (The conditions for this cycle are as follows: Both source and
destination memory are internal RAM and multiples by 4 numbered source and
destination addresses.)
1 state
(1)
fSYS
23 to A0
Note: In fact, src and dst address are not output to A23 to A0 pins
because they are internal RAM address.
(2) (3) (4) (5)
src
dst
Figure 3.4.2 Timing for Micro DMA Cycle
State (1), (2):
State (3):
State (4):
Instruction fetch cycle (Prefetches the next instruction code) Micro DMA read cycle Micro DMA write cycle
State (5): (The same as in state (1), (2))
92CH21-48
2009-06-19
TMP92CH21
(2) Soft start function
The TMP92CH21 can initiate micro DMA either with an interrupt or by using the
micro DMA soft start function, in which micro DMA is initiated by a write cycle which
writes to the register DMAR.
Writing 1 to any bit of the register DMAR causes micro DMA to be performed once.
(If write “0” to each bit, micro DMA doesn’t operate). On completion of the transfer, the
bits of DMAR which support the end channel are automatically cleared to 0.
Only one channel can be set once for DMA request. (Do not write “1” to plural bits.)
When writing again 1 to the DMAR register, check whether the bit is “0” before
writing “1”. If read “1”, micro DMA transfer isn’t started yet.
When a burst is specified by the DMAB register, data is transferred continuously
from the initiation of micro DMA until the value in the micro DMA transfer counter is 0.
If execatee soft start during micro DMA transfer by interrupt source, micro DMA
transfer counter doesn’t change. Don’t use Read-modify-write instruction to avoid
writign to other bits by mistake.
Symbol Name Address 7 6 5 4 3 2 1 0
DREQ7 DREQ6DREQ5DREQ4DREQ3DREQ2 DREQ1 DREQ0
R/W
0 0 0 0 0 0 0 0
1: DMA request in software
DMAR
DMA
Request
109H
(Prohibit
RMW)
(3) Transfer control registers
The transfer source address and the transfer destination address are set in the
following registers. An instruction of the form LDC cr, r can be used to set these
registers.
DMAD7 DMA destination address register 7
DMAC7 DMA counter register 7
DMAM7DMA mode regis t er 7
32 bits
8 bits
16 bits
92CH21-49
2009-06-19
(4) Detailed description of the transfer mode register
0 0 0 Mode
DMAMn[4:0] Mode Description
0 0 0 z z Destination INC mode
(DMADn+) ← (DMASn)
DMACn ← DMACn − 1
If DMACn = 0 then INTTCn
0 0 1 z z Destination DEC mode
(DMADn−) ← (DMASn)
DMACn ← DMACn − 1
If DMACn = 0 then INTTCn
0 1 0 z z Source INC mode
(DMADn) ← (DMASn+)
DMACn ← DMACn − 1
If DMACn = 0 then INTTCn
0 1 1 z z Source DEC mode
(DMADn) ← (DMASn−)
DMACn ← DMACn − 1
If DMACn = 0 then INTTCn
1 0 0 z z Source and destination INC mode
(DMADn+) ← (DMASn+)
DMACn ← DMACn − 1
If DMACn = 0 then INTTCn
1 0 1 z z Source and destination DEC mode
(DMADn−) ← (DMASn−)
DMACn ← DMACn − 1
If DMACn = 0 then INTTCn
1 1 0 z z Source and destination Fixed mode
(DMADn) ← (DMASn)
DMACn ← DMACn − 1
If DMACn = 0 then INTTCn
1 1 1 0 0 Counter mode
DMASn ← DMASn + 1
DMACn ← DMACn − 1
If DMACn = 0 then INTTCn
ZZ: 00 = 1-byte transfer
01 = 2-byte transfer
10 = 4-byte transfer
11 = (Reserved)
DMAM0 to DMAM7
TMP92CH21
Execution
State Number
5 states
5 states
5 states
5 states
6 states
6 states
5 states
5 states
Note1: N stands for the micro DMA channel number (0 to 7)
DMADn+/DMASn+: Post-increment (register value is incremented after transfer)
DMADn−/DMASn−: Post-decrement (register value is decremented after transfer)
“I/O” signifies fixed memory addresses; “memory” signifies incremented or decremented memory
addresses.
Note2: The transfer mode register should not be set to any value other than those listed above.
Note3: The execution state number shows number of best case (1-state memory access).
92CH21-50
2009-06-19
3.4.3 Interrupt Controller Operation
The block diagram in Figure 3.4.3 shows the interrupt circuits. The left hand side of the
diagram shows the interrupt controller circuit. The right hand side shows the CPU
interrupt request signal circuit and the halt release circuit.
For each of the 52 interrupts channels there is an interrupt request flag (consisting of a
flip-flop), an interrupt priority setting register and a micro DMA start vector register. The
interrupt request flag latches interrupt requests from the peripherals. The flag is cleared to
zero in the following cases: when a reset occurs, when the CPU reads the channel vector of
an interrupt it has received, when the CPU receives a micro DMA request (when micro
DMA is set), when a micro DMA burst transfer is terminated, and when an instruction that
clears the interrupt for that channel is executed (by writing a micro DMA start vector to the
INTCLR register).
An interrupt priority can be set independently for each interrupt source by writing the
priority to the interrupt priority setting register (e.g., INTE0AD or INTE12). 6 interrupt
priorities levels (1 to 6) are provided. Setting an interrupt source’s priority level to 0 (or 7)
disables interrupt requests from that source. The priority of non-maskable interrupt
(watchdog timer interrupts) is fixed at 7. If more than one interrupt request with a given
priority level are generated simultaneously, the default priority (the interrupt with the
lowest priority or, in other words, the interrupt with the lowest vector value) is used to
determine which interrupt request is accepted first.
The 3rd and 7th bit of the interrupt priority setting register indicate the state of the
interrupt request flag and thus whether an interrupt request for a given channel has
occurred.
If several interrupts are generated simultaneously, the interrupt controller sends the
interrupt request for the interrupt with the highest priority and the interrupt’s vector
address to the CPU. The CPU compares the mask value set in <IFF2:0> of the status
register (SR) with the priority level of the requested interrupt; if the latter is higher, the
interrupt is accepted. Then the CPU sets SR<IFF2:0> to the priority level of the accepted
interrupt + 1. Hence, during processing of the accepted interrupt, new interrupt requests
with a priority value equal to or higher than the value set in SR<IFF2:0> (e.g., interrupts
with a priority higher than the interrupt being processed) will be accepted.
When interrupt processing has been completed (e.g., after execution of a RETI
instruction), the CPU restores to SR<IFF2:0> the priority value which was saved on the
stack before the interrupt was generated.
The interrupt controller also includes eight registers which are used to store the micro
DMA start vector. Writing the start vector of the interrupt source for the micro DMA
processing (see Table 3.4.1), enables the corresponding interrupts to be processed by micro
DM
A proc
DMAS and DMAD) prior to micro DMA processing.
essing. The values must be set in the micro DMA parameter registers (e.g.,
TMP92CH21
92CH21-51
2009-06-19
g
r
A
r
r
A
i
t
t
7
During
STOP
During
IDLE1
Halt release
TMP92CH21
Micro DMA request
Micro DMA channel
specification
3
INTALM, INTUSB
if IFF = 7 then 0
RESET
Interrupt
mask F/F
Interrupt request
signal
EI 1 to 7
DI
Interrupt
level detect
3
3
If INTRQ2 to 0 ≥ IFF
2 to 0 then 1.
RESET
INT01 to INT4, INTKEY,INTRTC,
IFF2 to 0
D2
D3
D4
D5
D6
generator
Interrupt vector
D7
Interrupt vector
read
8 input OR
8
3
A
B
C
0 1 2 3 4 5 6
7
priority decoder
Micro DMA channel
1
nal to CPU
Interrupt request
si
Priority encoder
INTRQ2 to 0
3
A
B
C
Highest
priority
interrupt
1 2 3 4 5
level select
7
6
1
D0
D1
6
45
6
Interrupt controller CPU
V = 20H
V = 24H
Decode
Y1
V = 28H
V = 30H
V = 2CH
Y2
Y3
Y4
Y5
Y6
Dn + 3
B
C
V = 40H
V = 44H
V = 34H
V = 38H
V = 48H
V = 3CH
V = D0H
V = 4CH
V = E0H
V = E4H
V = D4H
V = D8H
V = E8H
V = DCH
V = ECH
Soft start
:
DMA0V
DMA1V
DMA7V
S
Selector
6
51
Interrupt request F/F
Interrupt request F/F
S Q
R
RESET
Priority setting register
errup
n
Dn
vector read
CLR
D Q
Dn + 1
Dn + 2
Interrupt vector read
S Q
Micro DMA acknowledge
R
D Q
Interrupt
request F/F
D5
D4
D3
Reset
D2
Micro DMA start vector setting registe
CLR
D1
D0
INTTC0
RESET
INTTC0
INTTC1
INTTC2
INTTC3
INTTC4
INTTC5
INTTC6
zero
interrupt
INTTC7
INTWD
INT0
INT1
INT2
INT3
INT4
INTALM0
INTALM1
INTALM2
INTALM3
INTALM4
counte
Micro DM
Figure 3.4.3 Block Diagram of Interrupt Controller
Note: When using the micro DMA transfer end interrupt, always write “1”.
F5H
(Prohibit
RMW)
0 1 1
Always
write “0”
(Note)
0: INTRX1
IR1LE IR0LE
edge
mode
1: INTRX1
level
mode
0: INTRX0
edge
mode
1: INTRX0
level
mode
INTRX1 level enable
0 Edge detect INTRX1
1 “H” level INTRX1
INTRX0 rising edge enable
0 Edge detect INTRX0
1 “H” level INTRX0
92CH21-57
2009-06-19
TMP92CH21
(4) Interrupt request flag clear register
The interrupt request flag is cleared by writing the appropriate micro DMA start
vector, as given in Table 3.4.1, to the register INTCLR.
For exampl
e, to clear the interrupt flag INT0, perform the following register
operation after execution of the DI instruction.
INTCLR ← 0AH Clears interrupt request flag INT0.
Symbol Name Address 7 6 5 4 3 2 1 0
CLRV7 CLRV6CLRV5CLRV4CLRV3CLRV2 CLRV1 CLRV0
W
0 0 0 0 0 0 0 0
Interrupt vector
INTCLR
Interrupt
clear
control
F8H
(Prohibit
RMW)
(5) Micro DMA start vector registers
These registers assign micro DMA processing to sets which source corresponds to
DMA. The interrupt source whose micro DMA start vector value matches the vector set
in one of these registers is designated as the micro DMA start source.
When the micro DMA transfer counter value reaches zero, the micro DMA transfer
end interrupt corresponding to the channel is sent to the interrupt controller, the micro
DMA start vector register is cleared, and the micro DMA start source for the channel is
cleared. Therefore, in order for micro DMA processing to continue, the micro DMA start
vector register must be set again during processing of the micro DMA transfer end
interrupt.
If the same vector is set in the micro DMA start vector registers of more than one
channel, the lowest numbered channel takes priority.
Accordingly, if the same vector is set in the micro DMA start vector registers for two
different channels, the interrupt generated on the lower numbered channel is executed
until micro DMA transfer is complete. If the micro DMA start vector for this channel
has not been set in the channel’s micro DMA start vector register again, micro DMA
transfer for the higher-numbered channel will be commenced. (This process is known
as micro DMA chaining.)
Specifying the micro DMA burst function causes micro DMA transfer, once started,
to continue until the value in the transfer counter register reaches zero. Setting any of
the bits in the register DMAB which correspond to a micro DMA channel (as shown
below) to 1 specifies that any micro DMA transfer on that channel will be a burst
transfer.
Symbol Name Address 7 6 5 4 3 2 1 0
DBST7 DBST6DBST5DBST4DBST3DBST2 DBST1 DBST0
DMAB
DMA
burst
108H
0 0 0 0 0 0 0 0
R/W
1: DMA burst request
92CH21-60
2009-06-19
TMP92CH21
(7) Notes
The instruction execution unit and the bus interface unit in this CPU operate
independently. Therefore, immediately before an interrupt is generated, if the CPU
fetches an instruction which clears the corresponding interrupt request flag, the CPU
may execute this instruction in between accepting the interrupt and reading the
interrupt vector. In this case, the CPU will read the default vector 0004H and jump to
interrupt vector address FFFF04H.
To avoid this, an instruction which clears an interrupt request flag should always be
placed after a DI instruction. And in the case of setting an interrupt enable again by EI
instruction after the execution of clearing instruction, execute EI instruction after
clearing and more than 3−instructions (e.g., “NOP” × 3 times).
If it placed EI instruction without waiting NOP instruction after execution of
clearing instruction, interrupt will be enabled before request flag is cleared.
In the case of changing the value of the interrupt mask register <IFF2:0> by
execution of POP SR instruction, disable an interrupt by DI instruction before
execution of POP SR instruction.
In addition, please note that the following two circuits are exceptional and demand
special attention.
INT0 level mode
INTRX In level mode (the register SIMC<IRxLE> set to “0”), the interrupt
In level mode INT0 is not an edge triggered interrupt. Hence, in level
mode the interrupt request flip-flop for INT0 does not function. The
peripheral interrupt request passes through the S input of the flip-flop
and becomes the Q output. If the interrupt input mode is changed from
edge mode to level mode, the interrupt request flag is cleared
automatically.
If the CPU enters the interrupt response sequence as a result of INT0
going from 0 to 1, INT0 must then be held at 1 until the interrupt
response sequence has been completed. If INT0 is set to level mode
so as to release a halt state, INT0 must be held at 1 from the time
INT0 changes from 0 to 1 until the halt state is released. (Hence, it is
necessary to ensure that input noise is not interpreted as a 0, causing
INT0 to revert to 0 before the halt state has been released.)
When the mode changes from level mode to edge mode, interrupt
request flags which were set in level mode will not be cleared.
Interrupt request flags must be cleared using the following sequence.
DI
LD (IIMC), 00H ; Switches from level to edge.
LD (INTCLR), 0AH ; Clears interrupt request flag.
NOP ; Wait EI execution
NOP
NOP
EI
request flip-flop can only be cleared by a reset or by reading the serial
channel receive buffer. It cannot be cleared by writing INTCLR
register.
Note: The following instructions or pin input state changes are equivalent to
instructions which clear the interrupt request flag.
INT0: Instructions which switch to level mode after an interrupt request ha s been
generated in edge mode.
The pin input changes from high to low after an interrupt request has been
generated in level mode. (“H” → “L”)
INTRX: Instructions which read the receive buffer.
INTRX: Instructions which read the receive buffer.
92CH21-61
2009-06-19
−
−
3.5 Function of Ports
The TMP92CH21 I/O port pins are shown in Table 3.5.1 and Table 3.5.2. In addition to
functioning as general-purpose I/O ports, these pins are also used by the internal CPU and I/O
functions. Table 3.5.3 to Table 3.5.5 list the I/O registers and their specificatio
Table 3.5.1 Port Functions (1/2)
(
R: PD = with programmable pull-down resistor, U = with pull-up resistor)
Port Name Pin Name
Port 1 P10 to P17 8 I/O − Bit D8 to D15
Port 2 P20 to P27 8 I/O − Bit D16 to D23, KO0 to KO7
Port 3 P30 to P37 8 I/O − Bit D24 to D31
Port 4 P40 to P47 8 Output− (Fixed) A0 to A7
Port 5 P50 to P57 8 Output− (Fixed) A8 to A15
Port 6 P60 to P67 8 I/O − Bit A16 to A23
Port 7
Table 3.5.3 I/O Registers and Specifications (1/3)
Port Pin Name Specification
Port 1 P10 to P17
Port 2 P20 to P27
Port 3 P30 to P37
Port 6 P60 to P67
Port 7
P71 to P72
P75 to P76
P70 to P76 Output port X 1 0
P70
P71
P72
P73 EA24 output X 1
P74
P76
Port 8
P80 to P87 Output Port X 0 0
P80 0CS output X 1 0
P82
P83 3CS output X 1 0
P84
P85
P87
Input port X 0 0
Output port X 1 0
D8 to D15 bus X X 1
Input port X 0 0 0
Output port X 1 0 0
D16 to D23 bus X X 1 0
KO0 to KO7 X 1 0 1
Input port X 0 0
Output port X 1 0
D24 to D31 bus X X 1
Output port X 0 Port 4 P40 to P47
A0 to A7 output X
Output port X 0 Port 5 P50 to P57
A8 to A15 output X
Input port X 0 0
Output port X 1 0
A16 to A23 output X X 1
Input port X 0 0
RD output
WRLL output
NDRE output
WRLU output
NDWE output
EA25 output
R/W output X 1 1 P75
input X 0 1
NDR/
B
WAIT input X 0
1CS output X 1 0 P81
SDCS output X X
2CS output X 1 0
CSZA Output X 0 1
SDCS output X 1 1
CSZB output X 1 0
WRUL output X 0 1
CE0ND output X 1 1
CSZC output X 1 0
WRUU output X 0 1
CE1ND output X 1 1
CSZD output X 1 0 P86
SRULB output X X 1
CSZE output X 1 0
SRUUB output X
TMP92CH21
X: Don’t care
I/O Register
Pn PnCR PnFC PnFC2
None
None
None
None
X None 1
1 1 1
0 1 1
1 1
0 1 1
X
None
None
X 1
None
1
None
1
None
None
1
1
1
1
92CH21-64
2009-06-19
Table 3.5.4 I/O Registers and Specifications (2/3)
Port Pin Name Specification
Port 9
Port A
Port C
Port F
Note: To use P92-pin as SCLK0 input or 0CTS input, set “1” to PF<PF2>
P90 to P94,
P96 to P97
P90 to P94 X 1 0 0
P95
P90
P92
P93 LGOE0 output X 0 1
P94 LGOE1 output X 0 1
P96 INT4 input X None 1
P97 INT5 input
PA3 to PA6 LD8 to LD11 output X
PC6 to PC7
PC0
PC2
PC3 INT3 input X 0 1
PC7
PF0 to PF2 Input port X
PF0 to PF2,
PF7
PF0
PF2
PF7 SDCLK output X None 1
Input port X 0 0
Output port
TXD0 output X 1 1 0
I2SCKO output X 0 1 0
TXD0 output (Open drain) X 1 1 1
RXD0 input X 0 0 P91
I2SDO output X 0 1
SCLK0 output X 1 1
I2SWS output X 0 1
SCLK0,
LGOE2 output X 0 1 P95
CLK32KO output X 1 0
Input port X 0 0 PA0 to PA7
KI0 to KI7 input X 0 1
Input port X 0 0 PC0 to PC3
Output port X 1 0
INT0 input X 0 1
TA1OUT output X
INT1 input X 0 1 PC1
TA3OUT output X 1 1
INT2 input X
TB0OUT0 output X
LDIV output X 1 1 PC6
KO8 output (Open drain) X 0 1
LCP1 output X 1 1
CSZF output X 0 1
Output port X 1 0
TXD0 output X 1 1 0
TXD1 output X 0 1 0
TXD0/TXD1 output (Open drain) X 1/0 1 1
RXD0 input X 0 0 PF1
RXD1 input X 0 0
SCLK0 output X 1 1
SCLK1 output X 0 1
SCLK0, 0CTS input X 0 0
SCLK1,
0CTS input (Note1)
1CTS input X 0 0
TMP92CH21
X: Don’t care
I/O Register
Pn PnCR PnFC PnFC2
0
X 0 0 0
X 0 0
None
X None 1
None
1 0
1 1
0 1
1 1
0 0 0
None
None
None
None
None
None
None
None
92CH21-65
2009-06-19
TMP92CH21
Table 3.5.5 I/O Registers and Specifications (3/3)
X: Don’t care
Port Pin Name Specification
I/O Register
Pn PnCRPnFC PnFC2
Port G
Port J
Port K
Port L
Port M
PG3 ADTRG input
PG2 MX output
PG3 MY output
PJ0 to PJ7 Output port X 1 0
PJ5 to PJ6
PJ0 SDRAS , SRLLB output X 1
PJ1 SDCAS , SRLUB output X 1
PJ2 SDWE , SRWR output X 1
PJ3 SDLLDQM output X 1
PJ4 SDLUDQM output 1
PJ7 SDCKE output X None 1
PK0 to PK3 Output port X 0
PK0 LCP0 output X 1
PK1 LLP output X 1
PK2 LFR output X 1
PK3 LBCD output X
PL4 to PL7
PL0 to PL7
Input Port
Output Port
LD0 to LD7 output
Output Port
MLDALM output 0 1
ALARM output 1
X 0 0
None
1
None
1
X 0 0
X 1 0
X 1 1
X 0
None
1
None
None
None
None
92CH21-66
2009-06-19
(
r
r
3.5.1 Port 1 (P10 to P17)
Port 1 is an 8-bit general-purpose I/O port. Bits can be individually set as either inputs or
outputs by control register P1CR and function register P1FC.
In addition to functioning as a general-purpose I/O port, port1 can also function as a data
bus (D8 to D15).
AM1 AM0 Function Setting after Reset is Released
External write enable
TMP92CH21
0 0 Don’t use this setting
0 1 Data bus (D8 to D15)
1 0 Data bus (D8 to D15)
1 1 Input port
P1CR register
P1FC register
P1 register
Port read data
External read enable
D8 to D15
D8 to D15
S
1
0
Selecto
Figure 3.5.1 Port 1
S
0
1
Selecto
P10 to P17
D8 to D15)
92CH21-67
2009-06-19
TMP92CH21
Port 1 register
7 6 5 4 3 2 1 0
P1
(0004H)
Bit symbol P17 P16 P15 P14 P13 P12 P11 P10
Read/Write R/W
Reset State Data from external port (Output latch register is cleared to “0”)
Port 1 Control register
7 6 5 4 3 2 1 0
P1CR
(0006H)
Bit symbol P17C P16C P15C P14C P13C P12C P11C P10C
Read/Write W
Reset State 0 0 0 0 0 0 0 0
Function 0: Input 1: Output
Port 1 Function register
7 6 5 4 3 2 1 0
P1FC
(0007H)
Bit symbol P1F
Read/Write W
Reset State 0/1 Note 2
Function 0: Port
1: Data bus
(D8 to D15)
Port 1 Drive register
7 6 5 4 3 2 1 0
P1DR
(0081H)
Bit symbol P17D P16D P15D P14D P13D P12D P11D P10D
Read/Write W
Reset State 1 1 1 1 1 1 1 1
Function Input/Output buffer drive register for standby mode
Note1: Read-modify-write is prohibited for P1CR and P1FC.
Note2: It is set to “Port” or “Data bus” by AM pin setting.
Figure 3.5.2 Register for Port 1
92CH21-68
2009-06-19
)
r
r
3.5.2 Port 2 (P20 to P27)
Port 2 is an 8-bit general-purpose I/O port. Bits can be individually set as either inputs or
outputs by control register P2CR and function register P2FC.
In addition to functioning as a general-purpose I/O port, port 2 can also function either as
a data bus (D16 to D23) or keyboard interface pin KO0 to KO7 which can be set to
open-drain output buffer.
TMP92CH21
AM1 AM0 Function Setting after Reset is Released
0 0 Don’t use this setting
0 1 Input port
1 0 Data bus (D16 to D23)
1 1 Input port
External write enable
D16 to D23
Port read data
D16 to D23
External read enable
P2CR register
P2FC register
P2 register
Figure 3.5.3 Port 2
S
Selecto
P2FC2 register
S
0
1
Selecto
1
0
Open-drain
enable
P20 to P27
(D16 to D23,
KO0 to KO7
92CH21-69
2009-06-19
TMP92CH21
Port 2 register
7 6 5 4 3 2 1 0
P2
(0008H)
Bit symbol P27 P26 P25 P24 P23 P22 P21 P20
Read/Write R/W
Reset State Data from external port (Output latch register is cleared to “0”)
Port 2 Control register
7 6 5 4 3 2 1 0
P2CR
(000AH)
Bit symbol P27C P26C P25C P24C P23C P22C P21C P20C
Read/Write W
Reset State 0 0 0 0 0 0 0 0
Function 0: Input 1: Output
Port 2 Function register
7 6 5 4 3 2 1 0
P2FC
(000BH)
Bit symbol P2F
Read/Write W
Reset State
Note 2
Function 0: Port
1: Data bus
(D16to D23)
0/1
Port 2 Function register 2
7 6 5 4 3 2 1 0
P2FC2
(0009H)
Bit symbol P27F2 P26F2 P25F2 P24F2 P23F2 P22F2 P21F2 P20F2
Read/Write W
Reset State 0 0 0 0 0 0 0 0
Function 0: CMOS output 1: Open-drain output
Port 2 Drive register
7 6 5 4 3 2 1 0
P2DR
(0082H)
Bit symbol P27D P26D P25D P24D P23D P22D P21D P20D
Read/Write W
Reset State 1 1 1 1 1 1 1 1
Function Input/Output buffer drive register for standby mode
Note 1: Read-modify-write instruction is prohibited for P2CR, P2FC and P2FC2.
Note 2: It is set to “Port” or “Data bus” by AM pin setting.
Figure 3.5.4 Register for Port 2
92CH21-70
2009-06-19
r
r
3.5.3 Port 3 (P30 to P37)
Port 3 is an 8-bit general-purpose I/O port. Bits can be individually set as either inputs or
outputs by control register P3CR and function register P3FC.
In addition to functioning as a general-purpose I/O port, port 3 can also function as a data
bus (D24 to D31).
AM1 AM0 Function Setting after Reset is Released
External write enable
TMP92CH21
0 0 Don’t use this setting
0 1 Input port
1 0 Data bus (D24 to D31)
1 1 Input port
P3CR register
P3FC register
P3 register
D24 to D31
Port read data
D24 to D31
External read enable
S
1
0
Selecto
Figure 3.5.5 Port 3
S
0
1
Selecto
P30 to P37
(D24 to D31)
92CH21-71
2009-06-19
TMP92CH21
Port 3 register
7 6 5 4 3 2 1 0
P3
(000CH)
Bit symbol P37 P36 P35 P34 P33 P32 P31 P30
Read/Write R/W
Reset State Data from external port (Output latch register is cleared to “0”)
Port 3 Control register
7 6 5 4 3 2 1 0
P3CR
(000EH)
Bit symbol P37C P36C P35C P34C P33C P32C P31C P30C
Read/Write W
Reset State 0 0 0 0 0 0 0 0
Function 0: Input 1: Output
Port 3 Function register
7 6 5 4 3 2 1 0
P3FC
(000FH)
Bit symbol − − − P3F
Read/Write W W
Reset State 0 0 0 0/1 Note 2
Function Always write “0” 0: Port
1: Data bus
(D24 to D31)
Port 3 Drive register
7 6 5 4 3 2 1 0
P3DR
(0083H)
Bit symbol P37D P36D P35D P34D P33D P32D P31D P30D
Read/Write W
Reset State 1 1 1 1 1 1 1 1
Function Input/Output buffer drive register for standby mode
Note 1: Read-modify-write instruction is prohibited for P3CR, P3FC and P3FC2.
Note 2: It is set to “Port” or “Data bus” by AM pin setting.
Figure 3.5.6 Register for Port 3
92CH21-72
2009-06-19
r
3.5.4 Port 4 (P40 to P47)
Port 4 is an 8-bit general-purpose output port.
In addition to functioning as a general-purpose output port, port 4 can also function as an
address bus (A0 to A7).
AM1 AM0 Function Setting after Reset is Released
A0 to A7
Port read data
0 0 Don’t use this setting
0 1 Address bus (A0 to A7)
1 0 Address bus (A0 to A7)
1 1 Output port
P4FC register
P4 register
S
0
1
Selecto
TMP92CH21
P40 to P47
(A0 to A7)
Figure 3.5.7 Port 4
92CH21-73
2009-06-19
TMP92CH21
Port 4 register
7 6 5 4 3 2 1 0
P4
(0010H)
Bit symbol P47 P46 P45 P44 P43 P42 P41 P40
Read/Write R/W
Reset State 0 0 0 0 0 0 0 0
Port 4 Function register
7 6 5 4 3 2 1 0
P4FC
(0013H)
Bit symbol P47F P46F P45F P44F P43F P42F P41F P40F
Read/Write W
Reset State
Note 2
Function 0: Port 1: Address bus (A0 to A7)
0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
Port 4 Drive register
7 6 5 4 3 2 1 0
P4DR
(0084H)
Bit symbol P47D P46D P45D P44D P43D P42D P41D P40D
Read/Write W
Reset State 1 1 1 1 1 1 1 1
Function Input/Output buffer drive register for standby mode
Note 1: Read-modify-write is prohibited for P4FC.
Note 2: It is set to “Port” or “Address bus” by AM pin setting.
Figure 3.5.8 Register for Port 4
92CH21-74
2009-06-19
r
3.5.5 Port 5 (P50 to P57)
Port 5 is an 8-bit general-purpose output port.
In addition to functioning as a general-purpose I/O port, port 5 can also function as an
address bus (A8 to A15).
AM1 AM0 Function Setting after Reset is Released
TMP92CH21
0 0 Don’t use this setting
0 1 Address bus (A8 to A15)
1 0 Address bus (A8 to A15)
1 1 Output port
P5FC register
P5 register
A8 to A15
Port read data
S
0
1
Selecto
P50 to P57
(A8 to A15)
Figure 3.5.9 Port 5
92CH21-75
2009-06-19
TMP92CH21
Port 5 register
7 6 5 4 3 2 1 0
P5
(0014H)
Bit symbol P57 P56 P55 P54 P53 P52 P51 P50
Read/Write R/W
Reset State 0 0 0 0 0 0 0 0
Port 5 Function register
7 6 5 4 3 2 1 0
P5FC
(0017H)
Bit symbol P57F P56F P55F P54F P53F P52F P51F P50F
Read/Write W
Reset State
Note 2
Function 0: Port 1: Address bus (A8 to A15)
0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
Port 5 Drive register
7 6 5 4 3 2 1 0
P5DR
(0085H)
Bit symbol P57D P56D P55D P54D P53D P52D P51D P50D
Read/Write W
Reset State 1 1 1 1 1 1 1 1
Function Input/Output buffer drive register for standby mode
Note 1: Read-modify-write is prohibited for P5FC.
Note 2: It is set to “Port” or “Address bus” by AM pin setting.
Figure 3.5.10 Register for Port 5
92CH21-76
2009-06-19
r
r
3.5.6 Port 6 (P60 to P67)
Port 6 is an 8-bit general-purpose I/O port. Bits can be individually set as either inputs or
outputs by control register P6CR and function register P6FC.
In addition to functioning as a general-purpose I/O port, port 6 can also function as an
address bus (A16 to A23).
AM1 AM0 Function Setting after Reset is Released
(Reserved)
TMP92CH21
0 0 Don’t use this setting
0 1 Address bus (A16 to A23)
1 0 Address bus (A16 to A23)
1 1 Input port
P6CR register
P6FC register
P6 register
S
A16 to A23
Port read data
S
Selecto
0
1
Selecto
1
0
P60 to P67
(A16 to A23)
Figure 3.5.11 Port 6
92CH21-77
2009-06-19
TMP92CH21
Port 6 register
7 6 5 4 3 2 1 0
P6
(0018H)
Bit symbol P67 P66 P65 P64 P63 P62 P61 P60
Read/Write R/W
Reset State Data from external port (Output latch register is cleared to “0”)
Port 6 Control register
7 6 5 4 3 2 1 0
P6CR
(001AH)
Bit symbol P67C P66C P65C P64C P63C P62C P61C P60C
Read/Write W
Reset State 0 0 0 0 0 0 0 0
Function 0: Input 1: Output
Port 6 Function register
7 6 5 4 3 2 1 0
P6FC
(001BH)
Bit symbol P67F P66F P65F P64F P63F P62F P61F P60F
Read/Write W
Reset State
Note 2
Function 0: Port 1: Address bus (A16 to A23)
0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
Port 6 Drive register
7 6 5 4 3 2 1 0
P6DR
(0086H)
Bit symbol P67D P66D P65D P64D P63D P62D P61D P60D
Read/Write W
Reset State 1 1 1 1 1 1 1 1
Function Input/Output buffer drive register for standby mode
Note 1: Read-modify-write is prohibited for P6CR and P6FC.
Note 2: It is set to “Port” or “Address bus” by AM pin setting.
Figure 3.5.12 Register for Port 6
92CH21-78
2009-06-19
r
r
r
3.5.7 Port 7 (P70 to P76)
Port 7 is a 7-bit general-purpose I/O port (P70, P73 and P74 are used for output only).
Bits can be individually set as either inputs or outputs by control register P7CR and
function register P7FC.
In addition to functioning as a general-purpose I/O port, P70 to P76 pins can also
function as interface pins for external memory.
A reset initializes P70, P73 and P74 pins to output port mode, and P71, P72, P75 and P76
pin to input port mode.
AM1 AM0 Function Setting after Reset is Released
RD , EA24, EA25
Port read data
NDRE , NDWE
WRLL , WRLU
Port read data
P7CR register
0 0 Don’t use this setting
0 1 RD pin
1 0 RD pin
1 1 P70 output port
P7FC register
P7 register
P7FC register
P7 register
S
0
S
0
1
Selecto
1
Selecto
S
1
0
S
0
1
Selecto
TMP92CH21
P70(RD )
P73(EA24)
P74(EA25)
P71 ( WRLL ,NDRE )
WRLU ,NDWE )
P72 (
Figure 3.5.13 Port 7
92CH21-79
2009-06-19
TMP92CH21
P7CR register
P7FC register
R/ W
P7 register
Port read data
NDR/
B
S
S
0
1
Selector
1
0
P75 (R/ W , NDR/B)
P7CR register
P7FC register
P7 register
P76 ( WAIT )
Port read data
WAIT
Figure 3.5.14 Port 7
92CH21-80
2009-06-19
TMP92CH21
Port 7 register
7 6 5 4 3 2 1 0
P7
(001CH)
Bit symbol P76 P75 P74 P73 P72 P71 P70
Read/Write R/W
Reset State
Data from external port
(Output latch register is
set to “1”)
0 0
Data from external port
(Output latch register is
set to “1”)
1
Port 7 Control register
7 6 5 4 3 2 1 0
P7CR
(001EH)
Bit symbol P76C P75C P72C P71C
Read/Write W W
Reset State 0 0 0 0
Function
0: Input port,
WAIT
1:Output port
0: Input port,
NDR/B
1:Output port,
W
R/
Refer to following table
Port 7 Function register
7 6 5 4 3 2 1 0
P7FC
(001FH)
Bit symbol P76F P75F P74F P73F P72F P71F P70F
Read/Write W
Reset State 0 0 0 0 0 0 0/1 Note 2
Function
Refer to following table0: port
1: EA25
0: port
1: EA24
Refer to following table 0: port
1:
RD
Port 7 Drive register
7 6 5 4 3 2 1 0
P7DR
(0087H)
Bit symbol P76D P75D P94D P73D P72D P71D P70D
Read/Write R/W
Reset State 1 1 1 1 1 1 1
Function Input/Output buffer drive register for standby mode
P72 Setting
<P72C>
<P72F>
0
1 (Reserved)
P76 Setting
<P76C>
<P76F>
0 Input port Output port
1 WAIT input(Reserved)
Note 1: Read-modify-write is prohibited for P7CR and P7FC.
Note 2: It is set to “Port” or “
Note 3: When
NDRE
and
0 1
Input port
0 1
RD ” by AM pin setting.
are used, set registers in the following order to avoid outputting a negative glitch.
NDWE
Output port
NDWE output
(at <P72>
WRLH
(at <P72>
= 0)
output
= 1)
P71 Setting
<P71C>
<P71F>
0
1 (Reserved)
P75 Setting
<P75C>
<P75F>
0 Input port Output port
1 NDR/B input R/Woutput
0 1
Input port
0 1
Output port
output
NDRE
at (<P71>
WRLL output
(at <P71>
= 0)
= 1)
Order Register Bit2 Bit1
(1) P7 0 0
(2) P7FC 1 1
(3) P7CR 1 1
Figure 3.5.15 Register for Port 7
92CH21-81
2009-06-19
3.5.8 Port 8 (P80 to P87)
Ports 80 to 87 are 8-bit output ports. Resetting sets the output latch of P82 to “0” and the
output latches of P80 to P81, P83 to P87 to “1”.
Port 8 can also be set to function as an interface pin for external memory using function
register P8FC.
Writing “1” in the corresponding bit of P8FC and P8FC2 enables the respective functions.
Resetting <P80F> to <P87F> of P8FC to “0” and P8FC2 to “0”, sets all bits to output
ports.
AM1 AM0 Function Setting after Reset is Released
Reset
Internal data bus
Port 82 Initial State
0 0 Don’t use this setting
0 1 “0” Output port
1 0 “0” Output port
1 1 “1” Output port
0 Output port 2CS output
1 CSZA output SDCS output
0 1
2CS or CSZA
Figure 3.5.17 Register for Port 8
92CH21-83
2009-06-19
3.5.9 Port 9 (P90 to P97)
P90 to P94 are 5-bit general-purpose I/O ports. I/O can be set on a bit basis using the
control register. Resetting sets P90 to P94 to input port and all bits of output latch to“1”.
P95 is 1-bit general-purpose output port and P96 to P97 are 2-bit general-purpose input
ports. P90 to P92 function as SIO or I
P96 to P97 as input pins for external interruption (INT4, INT5). In addition, P95 functions
as the output pin for a low frequency oscillator, P96 to P97 as PX and PY pins for a touch
screen interface.
Setting the corresponding bits of P9CR and P9FC enables the respective functions.
Resetting resets the P9FC to “0”, and sets all bits except P95 to input ports.
(1) Port 90 (TXD0, I2SCKO), Port91 (RXD0, I2SDO), Port 92 (SCLK0,
Ports 90 to 92 are general-purpose I/O ports. They also function as either SIO0 or I
Each pin is detailed below.
SIO mode
P90 TXD0
P91 RXD0
P92 SCLK0
Internal data bus
TXD0, I2SCKO output
(SIO0 module)
(Data output)
(Data input)
(Clock input or
output)
Reset
Direction control
P9CR write
Function control
P9FC write
S
Output latch
P9 write
P9 read
2
S, P93 to 95 as output pins for an LCD controller and
UART, IrDA mode
(SIO0 module)
TXD0
(Data output)
RXD0
(Data input)
A
Selector
B
Selector
0CTS
S
S
B
A
(Clear to send)
2
I
S mode
2
S module)
(I
I2SCKO
(Clock output)
I2SDO
(Data output)
I2SWS
(Word select
output)
Open-drain enable
P9FC2<P90F2>
TMP92CH21
CTS0 I2SWS)
SIO mode
(I2S module)
I2SCKO
(Clock output)
I2SDO
(Data output)
(No use)
P90 (TXD0, I2SCKO)
2
S.
Figure 3.5.18 P90
92CH21-84
2009-06-19
TMP92CH21
Reset
Direction control
P9CR write
Function control
Internal data bus
SCLK0,I2SWS output
P9FC write
S
Output latch
P9 write
I2SDO output
P9 read
S
A
Selector
B
S
B
Selector
A
(to Port F1) P91RXD0 input
(to Port F2) P92SCLK0 input
P91 (RXD0, I2SDO)
P92 (SCLK0,
0CTS , I2SWS)
Figure 3.5.19 P91 and P92
(2) P93 (LGOE0), P94 (LGOE1)
Reset
Direction control
P9CR write
Function control
Internal data bus
P9FC write
S
Output latch
P9 write
LGOE0, LGOE1
P9 read
S
A
Selector
B
S
Selector
P93(LGOE0),
P94(LGOE1)
B
A
Figure 3.5.20 Port 93 and 94
92CH21-85
2009-06-19
y
TMP92CH21
(3) P95 (CLK32KO, LGOE2)
Reset
Direction control
P9CR write
Function control
Internal data bus
P9FC write
Output latch
P9 write
LGOE2
fs
S
A
Selector
B
C
P95 (LGOE2, CLK32KO)
P9 read
Figure 3.5.21 Port 95
(4) P96 (INT4, PX), P97 (INT5, PY)
Reset
Internal data bus
Function control
P9FC write
TSICR0<PXEN>
<
TSICR0<TSI7>
AVCC
>
Switch for TSI
Typ.20
Ω
P9 read
TSICR1<DBC7>
P96 (INT4, PX)
P97 (INT5, PY)
Only for P96
INT4
INT5
Rising/Falling
edge detection
IIMC<I4EDGE,
I5EDGE>
S
A
Selector
B
TSICR0<TWIEN, TSI7>
TSICR0<PXEN>
TSICR0<TSI7>
De-bounce
circuit
Pull-down resistor
t
p.200kΩ
Figure 3.5.22 Port 96, 97
92CH21-86
2009-06-19
Register
Port 9
(0024H)
Reset State Data from external port0 Data from external port (Output latch register is set to “1”)
7 6 5 4 3 2 1 0
Bit symbol P97 P96 P95 P94 P93 P92 P91 P90 P9
Read/Write R R/W
TMP92CH21
Port 9 Function Register
(0026H)
Reset State 0 0 0 0 0 0
Function Refer to following table
7 6 5 4 3 2 1 0
Bit symbol P95C P94C P93C P92C P91C P90C P9FC
Read/Write W
Port 9 Function Register
(0027H)
Reset State 0 0 0 0 0 0 0 0
Function 0: Input port
P92 Setting
<P92C>
<P92F>
0
1 I2SWS output SCLK0 output
P95 Setting
<P95C>
<P95F>
0 Output port CLK3 2KO output
1 LGOE2 output (Reserved)
7 6 5 4 3 2 1 0
Bit symbol P97F P96F P95F P94F P93F P92F P91F P90F P9FC
Read/Write W
1: INT5
0 1
Input port
SCLK0, 0CTS input
0 1
Output port
0: Input port
1: INT4
P91 Setting
<P91C>
<P91F>
P94 Setting
<P94C>
<P94F>
0 1
0
1 I2SDO output (Reserved)
0 Input portOutput port
1 LGOE1 output (Reserved)
Input port
RXD0 input
0 1
Output port
Refer to following table
P90 Setting
<P90C>
<P90F>
0
1 I2SCKO output TXD0 output
P93 Setting
<P93C>
<P93F>
0 Input port Output port
1 LGOE0 output (Reserved)
0 1
Input port Output port
0 1
Port 9 Function Register 2
(0025H)
Reset State 0
Function 0:CMOS
7 6 5 4 3 2 1 0
Bit symbol P90F2 P9FC2
Read/Write W
1:Opendrain
Port 9 Drive Register
(0089H)
Reset State 1 1 1 1 1 1 1 1
Function Output/Input buffer drive register for standby mode
Note: Read-modify-write is prohibited for P9CR, P9FC and P9FC2.
7 6 5 4 3 2 1 0
Bit symbol P97D P96D P95D P94D P93D P92D P91D P90D P9DR
Read/Write R/W
Figure 3.5.23 Register for Port 9
92CH21-87
2009-06-19
3.5.10 Port A (PA0 to PA7)
Ports A0 to A7 are 8-bit input ports with pull-up resistor. In addition to functioning as
general-purpose I/O ports, ports A0 to A7 can also, as a keyboard interface, operate a
key-on wakeup function. The various functions can each be enabled by writing a “1” to the
corresponding bit of the port A function register (PAFC).
Resetting resets all bits of the register PAFC to “0” and sets all pins to be input port.
When PAFC = “1”, if the input of any of KI0 to KI7 pins fall down, an INTKEY interrupt
is generated. An INTKEY interrupt can be used to release all HALT modes.
92CH21-88
2009-06-19
TMP92CH21
Port A Register
7 6 5 4 3 2 1 0
PA
(0028H)
Bit symbol PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0
Read/Write R/W
Reset State Data from external port
Port A Function Register
7 6 5 4 3 2 1 0
PAFC
(002BH)
Bit symbol PA7F PA6F PA5F PA4F PA3F PA2F PA1F PA0F
Read/Write W
Reset State 0 0 0 0 0 0 0 0
Function 0: Key input disable 1: Key input enable
Port A Control Register
7 6 5 4 3 2 1 0
PACR
(002AH)
Bit symbol PA6C PA5C PA4C PA3C
Read/Write W
Reset State 0 0 0 0
Function 0: Input port or Key input
1: LD11 to LD8 output
Port A Drive register
7 6 5 4 3 2 1 0
PADR
(008AH)
Bit symbol PA7D PA6D PA5D PA4D PA3D PA2D PA1D PA0D
Read/Write W
Reset State 1 1 1 1 1 1 1 1
Function Input/Output buffer drive register for standby mode
Note: Read-modify-write is prohibited for PACR and PAFC.
Figure 3.5.25 Register for Port A
92CH21-89
2009-06-19
3.5.11 Port C (PC0 to PC3, PC6 to PC7)
PC0 to PC3, PC6 and PC7 are 6-bit general-purpose I/O ports. Each bit can be set
individually for input or output. Resetting sets port C to an input port.
In addition to functioning as a general-purpose I/O port, port C can also function as an
output pin for timers (TA1OUT, TA3OUT and TB0OUT0), input pin for external
interruption (INT0 to INT3), output pin for memory (
output pin for LCD driver (LDIV, LCP1). These settings are made using the function
register PCFC. The edge select for external interruption is determined by the IIMC register
in the interruption controller.
Bit symbol PC7 PC6 PC3 PC2 PC1 PC0 PC
Read/Write R/W R/W
Data from external port
(Output latch register is
set to “1”)
(Output latch register is set to “1”)
Port C Control Register
(0032H)
Reset State 0 0 0 0 0 0
Function Refer to following table Refer to following table
7 6 5 4 3 2 1 0
Bit symbol PC7C PC6C PC3C PC2C PC1C PC0C PCCR
Read/Write W W
Port C Function Register
(0033H)
Reset State 0 0 0 0 0 0
Function Refer to following table Refer to following table
PC2 Setting
<PC2C>
<PC2F>
0 Input port Output port
1 INT2 TB0OUT
PC7 Setting
<PC7C>
<PC7F>
0 Input port Output port
1 CSZF Output LCP1 Output
7 6 5 4 3 2 1 0
Bit symbol PC7F PC6F PC3F PC2F PC1F PC0F PCFC
Read/Write W W
PC1 Setting
0 1
0 1
<PC1F>
PC6 Setting
<PC6F>
<PC1C>
0 1
0 Input portOutput port
1 INT1 TA3OUT
<PC6C>
0 1
0 Input portOutput port
1
KO8
(Open drain)
LDIV Output
PC0 Setting
<PC0C>
<PC0F>
0 Input port Output port
1 INT0 TA1OUT
PC3 Setting
<PC3C>
<PC3F>
0 Input port Output port
1 INT3 (Reserved)
0 1
0 1
Port C Drive Register
PCDR
(008CH)
7 6 5 4 3 2 1 0
Bit symbol PC7D PC6D PC3D PC2D PC1D PC0D
Read/Write R/W R/W
Reset State 1 1 1 1 1 1
Function Input/Output buffer drive
register for standby mode
Note: Read-modify-write is prohibited for the registers PCCR and PCFC.
Input/Output buffer drive register for standby mode
Figure 3.5.30 Register for Port C
92CH21-93
2009-06-19
3.5.12 Port F (PF0 to PF2, PF7)
Ports F0 to F2 are 3-bit general-purpose I/O ports. Each bit can be set individually for
input or output. Resetting sets PF0 to PF2 to be input ports. It also sets all bits of the
output latch register to “1”. In addition to functioning as general-purpose I/O port pins, PF0
to PF2 can also function as the I/O for serial channels 0 and 1. A pin can be enabled for I/O
by writing a “1” to the corresponding bit of the port F function register (PFFC).
Port F7 is a 1-bit general-purpose output port. In addition to functioning as a
general-purpose output port , PF7 can also function as the SDCLK output. Resetting sets
PF7 to be an SDCLK output port.
(1) Port F0 (TXD0, TXD1), F1 (RXD0, RXD1), F2 (SCLK0,
Ports F0 to F2 are general-purpose I/O ports. They also function as either SIO0 or
SIO1. Each pin is detailed below.
SIO mode
(SIO0 module)
PF0
PF1
PF2
(Data output)
(Clock input or output)
TXD0
RXD0
(Data input)
SCLK0
UART, IrDA mode
(SIO0 module)
TXD0
(Data output)
RXD0
(Data input)
0CTS
(Clear to send)
CTS0 SCLK1,CTS1 )
SIO mode
(SIO1 module)
TXD1
(Data output)
RXD1
(Data input)
SCLK1
(Clock input or output)
TMP92CH21
UART mode
(SIO1 module)
TXD1
(Data output)
RXD1
(Data input)
1CTS
(Clear to send)
Reset
Direction control
PFCR write
Function control
Internal data bus
PFFC write
S
Output latch
PF write
TXD0
TXD1
PF read
S
Selector
S
Selector
PF0 (TXD0, TXD1)
Open drain
set possible
PFFC2<PF0F2>
B
A
Figure 3.5.31 Port F0
92CH21-94
2009-06-19
TMP92CH21
Reset
Direction control
Internal data bus
PFCR write
S
Output latch
PF write
PF read
RXD0
RXD1
Selector
PFFC<PF1F>
S
A
Selector
B
PF1 (RXD0,RXD1)
S
B
A
P91RXD0 input
Figure 3.5.32 Port F1
Reset
Direction control
Internal data bus
PFCR write
S
Output latch
PF write
Function control
SCLK0 output
SCLK1 output
Selector
S
PF2 (SCLK0,
SCLK1,
0CTS ,
1CTS )
SCLK0 input,0CTS input
SCLK1 input,
PFFC write
PF read
1CTS input
S
Selector
S
B
Selector
A
A
B
P92SCLK0 input
Figure 3.5.33 Port F2
92CH21-95
2009-06-19
Reset
Function control
PFFC write
Internal data bus
S
Output latch
PF write
PF read
SDCLK
S
A
Selector
B
PF7 (SDCLK)
TMP92CH21
Figure 3.5.34 Port F7
92CH21-96
2009-06-19
TMP92CH21
Port F Register
(003CH)
Reset State
7 6 5 4 3 2 1 0
Bit symbol PF7 PF2 PF1 PF0 PF
Read/Write R/W R/W
1
External data
(Output latch register is set to “1”)
Port F Control Register
(003EH)
Reset State 0 0 0
Function Refer to following table
7 6 5 4 3 2 1 0
Bit symbol PF2C PF1C PF0C PFCR
Read/Write W
Port F Functon Register
(003FH)
Reset State 1 0 0 0
Function 0: Output
7 6 5 4 3 2 1 0
Bit symbol PF7F PF2F PF1F PF0F PFFC
Read/Write W W
Refer to
following
table
1: SDCLK
Refer to
following
table
RXD0 pin
selection
0: Port F1
1: Port 91
PF2 Setting
<PF2C>
<PF2F>
Input port or
SCLK1, 1CTS input or
0
SCLK0, 0CTS input
From PF2 pin at <PF2> = 0
From P92 pin at <PF2> = 1
1 SCLK1 output
0 1
Output
port
SCLK0
output
PF1 Setting
<PF1C>
<PF1F>
0
1
0 1
Input port or
RXD0/RXD1 input
Output
port
PF0 Setting
<PF0C>
<PF0F>
0 Input port Output port
1 TXD1 output TXD0 output
0 1
Port F Functon Register 2
(003DH)
Reset State 0
Function Output buffer
7 6 5 4 3 2 1 0
Bit symbol PF0F2 PFFC2
Read/Write W
0: CMOS
1: Open drain
Port F Drive Register
PFDR
(008FH)
7 6 5 4 3 2 1 0
Bit symbol PF7D PF2D PF1D PF0D
Read/Write R/W R/W
Reset State 1 1 1 1
Function Input/Output
buffer drive
register for
standby
mode
Note: Read-modify-write is prohibited for the registers PFCR, PFFC and PFFC2.
Input/Output buffer drive register for
standby mode
Figure 3.5.35 Register for Port F
92CH21-97
2009-06-19
3.5.13 Port G (PG0 to PG3)
PG0 to PG3 are 4-bit input ports and can also be used as the analog input pins for the
internal AD converter. PG3 can also be used as the ADTRG pin for the AD converter.
PG2 and PG3 can also be used as the MX and MY pins for a touch screen interface.