The information contained herein is subject to change without notice. 021023 _ D
TOSHIBA is continually working to improve the quality and reliability of its products. Nevertheless,
semiconductor devices in general can malfunction or fail due to their inherent electrical sensitivity and
vulnerability to physical stress.
It is the responsibility of the buyer, when utilizing TOSHIBA products, to comply with the standards
of safety in making a safe design for the entire system, and to avoid situations in which a malfunction
or failure of such TOSHIBA products could cause loss of human life, bodily injury or damage to
property.
In developing your designs, please ensure that TOSHIBA products are used within specified operating
ranges as set forth in the most recent TOSHIBA products specifications.
Also, please keep in mind the precautions and conditions set forth in the “Handling Guide for
Semiconductor Devices,” or “TOSHIBA Semiconductor Reliability Handbook” etc. 021023_A
The Toshiba products listed in this document are intended for usage in general electronics applications
(computer, personal equipment, office equipment, measuring equipment, industrial robotics, domestic
appliances, etc.).
These Toshiba products are neither intended nor warranted for usage in equipment that requires
extraordinarily high quality and/or reliability or a malfunction or failure of which may cause loss of
human life or bodily injury (“Unintended Usage”). Unintended Usage include atomic energy control
instruments, airplane or spaceship instruments, transportation instruments, traffic signal instruments,
combustion control instruments, medical instruments, all types of safety devices, etc. Unintended
Usage of Toshiba products listed in this document shall be made at the customer's own risk. 021023_B
The products described in this document shall not be used or embedded to any downstream products
of which manufacture, use and/or sale are prohibited under any applicable laws and regulations.
060106_Q
The information contained herein is presented only as a guide for the applications of our products. No
responsibility is assumed by TOSHIBA for any infringements of patents or other rights of the third
parties which may result from its use. No license is granted by implication or otherwise under any
patent or patent rights of TOSHIBA or others. 021023_C
The products described in this document may include products subject to the foreign exchange and
foreign trade laws. 021023_F
For a discussion of how the reliability of microcontrollers can be predicted, please refer to Section 1.3
of the chapter entitled Quality and Reliability Assurance/Handling Precautions. 030619_S
When UART is used, settings of RXDNC are limited depending on the transfer clock specified by BRG. The com-
bination "O" is available but please do not select the combination "–".
The transfer clock generated by timer/counter interrupt is calculated by the following equation :
Transfer clock [Hz] = Timer/counter source clock [Hz] ÷ TTREG set value
2.1.2 Program Memory (MaskROM).................................................................................................................. 9
2.1.3 Data Memory (RAM)............................................................................................................................... 10
2.3.4 System clock reset.................................................................................................................................. 32
7.1.2 Control .................................................................................................................................................... 71
7.1.3 Function .................................................................................................................................................. 72
7.2.2 Control .................................................................................................................................................... 73
11.9.4 Receive Data Buffer Full..................................................................................................................... 114
11.9.5 Transmit Data Buffer Empty ............................................................................................................... 114
11.9.6 Transmit End Flag .............................................................................................................................. 115
12.6.1 4-bit and 8-bit transfer modes ............................................................................................................. 122
12.6.2 4-bit and 8-bit receive modes ............................................................................................................. 124
12.6.3 8-bit transfer / receive mode ............................................................................................................... 125
15.4.2 Store of display data ........................................................................................................................... 143
15.4.3 Example of LCD driver output............................................................................................................. 145
This is a technical document that describes the operating functions and electrical
specifications of the 8-bit microcontroller series TLCS-870/C (LSI).
v
vi
CMOS 8-Bit Microcontroller
TMP86CH22UG
TMP86CH22UG
Product No.
TMP86CH22UG
1.1Features
1. 8-bit single chip microcomputer TLCS-870/C series
• The information contained herein is subject to change without notice. 021023_D
• TOSHIBA is continually working to improve the quality and reliability of its products. Nevertheless, semiconductor devices in general can
malfunction or fail due to their inherent electrical sensitivity and vulnerability to physical stress. It is the responsibility of the buyer, when
utilizing TOSHIBA products, to comply with the standards of safety in making a safe design for the entire system, and to avoid situations
in which a malfunction or failure of such TOSHIBA products could cause loss of human life, bodily injury or damage to property.
In developing your designs, please ensure that TOSHIBA products are used within specified operating ranges as set forth in the most
recent TOSHIBA products specifications. Also, please keep in mind the precautions and conditions set forth in the “Handling Guide for
Semiconductor Devices,” or “TOSHIBA Semiconductor Reliability Handbook” etc. 021023_A
• The TOSHIBA products listed in this document are intended for usage in general electronics applications (computer, personal equipment, office equipment, measuring equipment, industrial robotics, domestic appliances, etc.). These TOSHIBA products are neither
intended nor warranted for usage in equipment that requires extraordinarily high quality and/or reliability or a malfunctionor failure of
which may cause loss of human life or bodily injury (“Unintended Usage”). Unintended Usage include atomic energy control instruments,
airplane or spaceship instruments, transportation instruments, traffic signal instruments, combustion control instruments, medical instruments, all types of safety devices, etc. Unintended Usage of TOSHIBA products listed in this document shall be made at the customer's
own risk. 021023_B
• The products described in this document shall not be used or embedded to any downstream products of which manufacture, use and/or
sale are prohibited under any applicable laws and regulations. 060106_Q
• The information contained herein is presented only as a guide for the applications of our products. No responsibility is assumed by
TOSHIBA for any infringements of patents or other rights of the third parties which may result from its use. No license is granted by implication or otherwise under any patent or patent rights of TOSHIBA or others. 021023_C
• The products described in this document are subject to the foreign exchange and foreign trade laws. 021023_E
• For a discussion of how the reliability of microcontrollers can be predicted, please refer to Section 1.3 of the chapter entitled Quality and
Reliability Assurance/Handling Precautions. 030619_S
Page 1
1.1 Features
TMP86CH22UG
Programmable pulse generation (PPG) modes
8. 8-bit UART : 1 ch
9. 8-bit SIO: 1 ch
10. 8-bit successive approximation type AD converter (with sample hold)
Analog inputs: 4ch
11. Key-on wakeup : 1 ch
12. LCD driver/controller
- LCD direct drive capability (MAX 23 seg × 4 com)
- 1/4,1/3,1/2duties or static drive are programmably selectable
Resonator connecting pins(32.768kHz) for inputting external
O
clock
P21
XTIN
P20
STOP
INT5
P37
DVO
P34
TC5
PDO5/PWM5
P33
TC6
PDO6/PWM6/PPG6
P57
SEG16
P56
SEG17
P55
SEG18
PORT21
6
9
44
43
42
29
28
27
IO
Resonator connecting pins(32.768kHz) for inputting external
I
clock
IO
PORT20
I
STOP mode release signal input
I
External interrupt 5 input
OOPORT37
Divider Output
IO
PORT34
I
TC5 input
O
PDO5/PWM5 output
IO
PORT33
I
TC6 input
O
PDO6/PWM6/PPG6 output
IOOPORT57
LCD segment output 16
IOOPORT56
LCD segment output 17
IOOPORT55
LCD segment output 18
Page 5
1.4 Pin Names and Functions
Table 1-1 Pin Names and Functions(2/3)
Pin NamePin NumberInput/OutputFunctions
TMP86CH22UG
P54
SEG19
P53
SEG20
P52
SEG21
P51
SEG22
P50
SEG23
P64
AIN4
STOP2
P63
AIN3
INT0
P62
AIN2
ECNT
P61
AIN1
ECIN
26
25
24
23
22
13
12
11
10
IOOPORT54
LCD segment output 19
IOOPORT53
LCD segment output 20
IOOPORT52
LCD segment output 21
IOOPORT51
LCD segment output 22
IOOPORT50
LCD segment output 23
IO
PORT64
I
AD converter analog input 4
I
STOP2 input
IO
PORT63
I
AD converter analog input 3
I
External interrupt 0 input
IO
PORT62
I
AD converter analog input 2
I
ECNT input
IO
PORT61
I
AD converter analog input 1
I
ECIN input
P76
SEG9
P75
SEG10
P74
SEG11
P73
SEG12
P72
SEG13
P71
SEG14
P70
SEG15
COM337OLCD common output 3
COM238OLCD common output 2
COM139OLCD common output 1
COM040OLCD common output 0
XIN2IResonator connecting pins for high-frequency clock
36
35
34
33
32
31
30
IOOPORT76
LCD segment output 9
IOOPORT75
LCD segment output 10
IOOPORT74
LCD segment output 11
IOOPORT73
LCD segment output 12
IOIPORT72
LCD segment output 13
IOOPORT71
LCD segment output 14
IOOPORT70
LCD segment output 15
Page 6
TMP86CH22UG
Table 1-1 Pin Names and Functions(3/3)
Pin NamePin NumberInput/OutputFunctions
XOUT3OResonator connecting pins for high-frequency clock
RESET8IReset signal
TEST4ITest pin for out-going test. Normally, be fixed to low.
VDD5I+5V
VSS1I0(GND)
Page 7
1.4 Pin Names and Functions
TMP86CH22UG
Page 8
2.Operational Description
2.1CPU Core Functions
The CPU core consists of a CPU, a system clock controller, and an interrupt controller.
This section provides a description of the CPU core, the program memory, the data memory, and the reset circuit.
2.1.1Memory Address Map
The TMP86CH22UG memory is composed MaskROM, RAM, DBR(Data buffer register) and SFR(Special
function register). They are all mapped in 64-Kbyte address space. Figure 2-1 shows the TMP86CH22UG
memory address map.
0000
SFR
RAM
003F
0040
023F
H
64 bytes
H
H
512
bytes
H
Special function register includes:
SFR:
I/O ports
Peripheral control registers
Peripheral status registers
System control registers
Program status word
Random access memory includes:
RAM:
Data memory
Stac k
TMP86CH22UG
0F80
H
DBR
MaskROM
0FFF
C000
FFB0
FFBF
FFC0
FFDF
FFE0
FFFF
H
H
H
H
H
H
H
H
128
bytes
16384
bytes
Figure 2-1 Memory Address Map
2.1.2Program Memory (MaskROM)
DBR: Data buffer register includes:
Peripheral control registers
Peripheral status registers
LCD display memory
MaskROM:
Vector table for interrupts
(16 bytes)
Vector table for vector call instructions
(32 bytes)
Vector table for interrupts
(32 bytes)
Program memory
The TMP86CH22UG has a 16384 bytes (Address C000H to FFFFH) of program memory (MaskROM ).
Page 9
2. Operational Description
2.2 System Clock Controller
2.1.3Data Memory (RAM)
The TMP86CH22UG has 512bytes (Address 0040H to 023FH) of internal RAM. The first 192 bytes (0040H
to 00FFH) of the internal RAM are located in the direct area; instructions with shorten operations are available
against such an area.
The data memory contents become unstable when the power supply is turned on; therefore, the data memory
should be initialized by an initialization routine.
Example :Clears RAM to “00H”. (TMP86CH22UG)
SRAMCLR:LD(HL), A
TMP86CH22UG
LDHL, 0040H; Start address setup
LDA, H; Initial value (00H) setup
LDBC, 01FFH
INCHL
DECBC
JRSF, SRAMCLR
2.2System Clock Controller
The system clock controller consists of a clock generator, a timing generator, and a standby controller.
Clock
generator
XIN
High-frequency
clock oscillator
XOUT
XTIN
Low-frequency
clock oscillator
XTOUT
Figure 2-2 System Colck Control
2.2.1Clock Generator
Timing generator control register
TBTCR
0036
H
fc
Timing
generator
fs
System clocks
Clock generator control
Standby controller
0038
H
0039
H
SYSCR2SYSCR1
System control registers
The clock generator generates the basic clock which provides the system clocks supplied to the CPU core
and peripheral hardware. It contains two oscillation circuits: One for the high-frequency clock and one for the
low-frequency clock. Power consumption can be reduced by switching of the standby controller to low-power
operation based on the low-frequency clock.
The high-frequency (fc) clock and low-frequency (fs) clock can easily be obtained by connecting a resonator
between the XIN/XOUT and XTIN/XTOUT pins respectively. Clock input from an external oscillator is also
possible. In this case, external clock is applied to XIN/XTIN pin with XOUT/XTOUT pin not connected.
Page 10
TMP86CH22UG
(a) Crystal/Ceramic
resonator
Note:The function to monitor the basic clock directly at external is not provided for hardware, however, with dis-
abling all interrupts and watchdog timers, the oscillation frequency can be adjusted by monitoring the pulse
which the fixed frequency is outputted to the port by the program.
The system to require the adjustment of the oscillation frequency should create the program for the adjustment in advance.
High-frequency clock
XOUTXIN
(b) External oscillator
Figure 2-3 Examples of Resonator Connection
XOUTXIN
(Open)
Low-frequency clock
XTIN
(c) Crystal(d) External oscillator
XTOUT
XTIN
XTOUT
(Open)
Page 11
2. Operational Description
2.2 System Clock Controller
2.2.2Timing Generator
The timing generator generates the various system clocks supplied to the CPU core and peripheral hardware
from the basic clock (fc or fs). The timing generator provides the following functions.
2.2.2.1Configuration of timing generator
1. Generation of main system clock
2. Generation of divider output (
DVO) pulses
3. Generation of source clocks for time base timer
4. Generation of source clocks for watchdog timer
5. Generation of internal source clocks for timer/counters
6. Generation of warm-up clocks for releasing STOP mode
7. LCD
TMP86CH22UG
SYSCK
DV7CK
High-frequency
clock fc
Low-frequency
clock fs
The timing generator consists of a 2-stage prescaler, a 21-stage divider, a main system clock generator,
and machine cycle counters.
An input clock to the 7th stage of the divider depends on the operating mode, SYSCR2<SYSCK> and
TBTCR<DV7CK>, that is shown in Figure 2-4. As reset and STOP mode started/canceled, the prescaler
and the divider are cleared to “0”.
fc or fs
S
fc/4
12143287109121114131615
5 617 18 19 20 21
A
Y
B
Multi-
plexer
Machine cycle countersMain system clock generator
Divider
B0
B1
A0
A1
S
Y0
Y1
Multiplexer
Warm-up
controller
Watchdog
timer
Timer counter, Serial interface, Time-base-timer, divider output, etc. (Peripheral functions)
Figure 2-4 Configuration of Timing Generator
Page 12
Timing Generator Control Register
TMP86CH22UG
TBTCR
(0036H)
Note 1: In single clock mode, do not set DV7CK to “1”.
Note 2: Do not set “1” on DV7CK while the low-frequency clock is not operated stably.
Note 3: fc: High-frequency clock [Hz], fs: Low-frequency clock [Hz], *: Don’t care
Note 4: In SLOW1/2 and SLEEP1/2 modes, the DV7CK setting is ineffective, and fs is input to the 7th stage of the divider.
Note 5: When STOP mode is entered from NORMAL1/2 mode, the DV7CK setting is ineffective during the warm-up period after
release of STOP mode, and the 6th stage of the divider is input to the 7th stage during this period.
Selection of input to the 7th stage
of the divider
0: fc/2
1: fs
8
[Hz]
2.2.2.2Machine cycle
Instruction execution and peripheral hardware operation are synchronized with the main system clock.
The minimum instruction execution unit is called an “machine cycle”. There are a total of 10 different
types of instructions for the TLCS-870/C Series: Ranging from 1-cycle instructions which require one
machine cycle for execution to 10-cycle instructions which require 10 machine cycles for execution. A
machine cycle consists of 4 states (S0 to S3), and each state consists of one main system clock.
1/fc or 1/fs [s]
R/W
Main system clock
State
Machine cycle
Figure 2-5 Machine Cycle
2.2.3Operation Mode Control Circuit
The operation mode control circuit starts and stops the oscillation circuits for the high-frequency and lowfrequency clocks, and switches the main system clock. There are three operating modes: Single clock mode,
dual clock mode and STOP mode. These modes are controlled by the system control registers (SYSCR1 and
SYSCR2). Figure 2-6 shows the operating mode transition diagram.
2.2.3.1Single-clock mode
Only the oscillation circuit for the high-frequency clock is used, and P21 (XTIN) and P22 (XTOUT)
pins are used as input/output ports. The main-system clock is obtained from the high-frequency clock. In
the single-clock mode, the machine cycle time is 4/fc [s].
S3S2S1S0S3S2S1S0
(1)NORMAL1 mode
In this mode, both the CPU core and on-chip peripherals operate using the high-frequency clock.
The TMP86CH22UG is placed in this mode after reset.
Page 13
2. Operational Description
2.2 System Clock Controller
TMP86CH22UG
(2)IDLE1 mode
In this mode, the internal oscillation circuit remains active. The CPU and the watchdog timer are
halted; however on-chip peripherals remain active (Operate using the high-frequency clock).
IDLE1 mode is started by SYSCR2<IDLE> = "1", and IDLE1 mode is released to NORMAL1
mode by an interrupt request from the on-chip peripherals or external interrupt inputs. When the IMF
(Interrupt master enable flag) is “1” (Interrupt enable), the execution will resume with the acceptance
of the interrupt, and the operation will return to normal after the interrupt service is completed. When
the IMF is “0” (Interrupt disable), the execution will resume with the instruction which follows the
IDLE1 mode start instruction.
(3)IDLE0 mode
In this mode, all the circuit, except oscillator and the timer-base-timer, stops operation.
This mode is enabled by SYSCR2<TGHALT> = "1".
When IDLE0 mode starts, the CPU stops and the timing generator stops feeding the clock to the
peripheral circuits other than TBT. Then, upon detecting the falling edge of the source clock selected
with TBTCR<TBTCK>, the timing generator starts feeding the clock to all peripheral circuits.
When returned from IDLE0 mode, the CPU restarts operating, entering NORMAL1 mode back
again. IDLE0 mode is entered and returned regardless of how TBTCR<TBTEN> is set. When IMF =
“1”, EF6 (TBT interrupt individual enable flag) = “1”, and TBTCR<TBTEN> = “1”, interrupt processing is performed. When IDLE0 mode is entered while TBTCR<TBTEN> = “1”, the INTTBT
interrupt latch is set after returning to NORMAL1 mode.
2.2.3.2Dual-clock mode
Both the high-frequency and low-frequency oscillation circuits are used in this mode. P21 (XTIN) and
P22 (XTOUT) pins cannot be used as input/output ports. The main system clock is obtained from the
high-frequency clock in NORMAL2 and IDLE2 modes, and is obtained from the low-frequency clock in
SLOW and SLEEP modes. The machine cycle time is 4/fc [s] in the NORMAL2 and IDLE2 modes, and
4/fs [s] (122 µs at fs = 32.768 kHz) in the SLOW and SLEEP modes.
The TLCS-870/C is placed in the signal-clock mode during reset. To use the dual-clock mode, the lowfrequency oscillator should be turned on at the start of a program.
(1)NORMAL2 mode
In this mode, the CPU core operates with the high-frequency clock. On-chip peripherals operate
using the high-frequency clock and/or low-frequency clock.
(2)SLOW2 mode
In this mode, the CPU core operates with the low-frequency clock, while both the high-frequency
clock and the low-frequency clock are operated. As the SYSCR2<SYSCK> becomes "1", the hardware changes into SLOW2 mode. As the SYSCR2<SYSCK> becomes “0”, the hardware changes
into NORMAL2 mode. As the SYSCR2<XEN> becomes “0”, the hardware changes into SLOW1
mode. Do not clear SYSCR2<XTEN> to “0” during SLOW2 mode.
(3)SLOW1 mode
This mode can be used to reduce power-consumption by turning off oscillation of the high-frequency clock. The CPU core and on-chip peripherals operate using the low-frequency clock.
Page 14
TMP86CH22UG
Switching back and forth between SLOW1 and SLOW2 modes are performed by
SYSCR2<XEN>. In SLOW1 and SLEEP modes, the input clock to the 1st stage of the divider is
stopped; output from the 1st to 6th stages is also stopped.
(4)IDLE2 mode
In this mode, the internal oscillation circuit remain active. The CPU and the watchdog timer are
halted; however, on-chip peripherals remain active (Operate using the high-frequency clock and/or
the low-frequency clock). Starting and releasing of IDLE2 mode are the same as for IDLE1 mode,
except that operation returns to NORMAL2 mode.
(5)SLEEP1 mode
In this mode, the internal oscillation circuit of the low-frequency clock remains active. The CPU,
the watchdog timer, and the internal oscillation circuit of the high-frequency clock are halted; however, on-chip peripherals remain active (Operate using the low-frequency clock). Starting and releasing of SLEEP mode are the same as for IDLE1 mode, except that operation returns to SLOW1 mode.
In SLOW1 and SLEEP1 modes, the input clock to the 1st stage of the divider is stopped; output from
the 1st to 6th stages is also stopped.
(6)SLEEP2 mode
The SLEEP2 mode is the idle mode corresponding to the SLOW2 mode. The status under the
SLEEP2 mode is same as that under the SLEEP1 mode, except for the oscillation circuit of the highfrequency clock.
(7)SLEEP0 mode
In this mode, all the circuit, except oscillator and the timer-base-timer, stops operation. This mode
is enabled by setting “1” on bit SYSCR2<TGHALT>.
When SLEEP0 mode starts, the CPU stops and the timing generator stops feeding the clock to the
peripheral circuits other than TBT. Then, upon detecting the falling edge of the source clock selected
with TBTCR<TBTCK>, the timing generator starts feeding the clock to all peripheral circuits.
When returned from SLEEP0 mode, the CPU restarts operating, entering SLOW1 mode back
again. SLEEP0 mode is entered and returned regardless of how TBTCR<TBTEN> is set. When IMF
= “1”, EF6 (TBT interrupt individual enable flag) = “1”, and TBTCR<TBTEN> = “1”, interrupt processing is performed. When SLEEP0 mode is entered while TBTCR<TBTEN> = “1”, the INTTBT
interrupt latch is set after returning to SLOW1 mode.
2.2.3.3STOP mode
In this mode, the internal oscillation circuit is turned off, causing all system operations to be halted. The
internal status immediately prior to the halt is held with a lowest power consumption during STOP mode.
STOP mode is started by the system control register 1 (SYSCR1), and STOP mode is released by a
inputting (Either level-sensitive or edge-sensitive can be programmably selected) to the
STOP pin. After
the warm-up period is completed, the execution resumes with the instruction which follows the STOP
mode start instruction.
Page 15
2. Operational Description
2.2 System Clock Controller
TMP86CH22UG
IDLE1
mode
(a) Single-clock mode
IDLE2
mode
SLEEP2
mode
SLEEP1
mode
(b) Dual-clock mode
SYSCR2<TGHALT> = "1"
SYSCR2<IDLE> = "1"
Interrupt
SYSCR2<XTEN> = "0"
SYSCR2<IDLE> = "1"
Interrupt
SYSCR2<SYSCK> = "0"
SYSCR2<IDLE> = "1"
Interrupt
SYSCR2<XEN> = "1"
SYSCR2<IDLE> = "1"
Interrupt
Note 2
IDLE0
mode
NORMAL1
mode
NORMAL2
mode
SLOW2
mode
SLOW1
mode
Reset release
Note 2
SYSCR1<STOP> = "1"
STOP pin input
SYSCR2<XTEN> = "1"
SYSCR1<STOP> = "1"
STOP pin input
SYSCR2<SYSCK> = "1"
SYSCR2<XEN> = "0"
SYSCR1<STOP> = "1"
STOP pin input
SYSCR2<TGHALT> = "1"
RESET
STOP
SLEEP0
mode
Note 1: NORMAL1 and NORMAL2 modes are generically called NORMAL; SLOW1 and SLOW2 are called SLOW; IDLE0, IDLE1
and IDLE2 are called IDLE; SLEEP0, SLEEP1 and SLEEP2 are called SLEEP.
Note 2: The mode is released by falling edge of TBTCR<TBTCK> setting.
0: Return to NORMAL1/2 mode
1: Return to SLOW1 mode
0: High impedance
1: Output kept
Return to NORMAL modeReturn to SLOW mode
00
01
10
11
3 x 2
2
3 x 2
2
16
/fc
16
/fc
14
/fc
14
/fc
3 x 2
2
3 x 2
R/W
R/W
R/W
R/W
13
/fs
13
/fs
6
/fs
6
/fs
2
R/W
Note 1: Always set RETM to “0” when transiting from NORMAL mode to STOP mode. Always set RETM to “1” when transiting
from SLOW mode to STOP mode.
Note 2: When STOP mode is released with
RESET pin input, a return is made to NORMAL1 regardless of the RETM contents.
Note 3: fc: High-frequency clock [Hz], fs: Low-frequency clock [Hz], *; Don’t care
Note 4: Bits 1 and 0 in SYSCR1 are read as undefined data when a read instruction is executed.
Note 5: As the hardware becomes STOP mode under OUTEN = “0”, input value is fixed to “0”; therefore it may cause external
interrupt request on account of falling edge.
Note 6: When the key-on wakeup is used, RELM should be set to "1".
Note 7: Port P20 is used as
STOP pin. Therefore, when stop mode is started, OUTEN does not affect to P20, and P20 becomes
High-Z mode.
Note 8: The warmig-up time should be set correctly for using oscillator.
System Control Register 2
SYSCR2
(0039H)
Note 1: A reset is applied if both XEN and XTEN are cleared to “0”, XEN is cleared to “0” when SYSCK = “0”, or XTEN is cleared
Note 2: *: Don’t care, TG: Timing generator, *; Don’t care
Note 3: Bits 3, 1 and 0 in SYSCR2 are always read as undefined value.
Note 4: Do not set IDLE and TGHALT to “1” simultaneously.
Note 5: Because returning from IDLE0/SLEEP0 to NORMAL1/SLOW1 is executed by the asynchronous internal clock, the period
Note 6: When IDLE1/2 or SLEEP1/2 mode is released, IDLE is automatically cleared to “0”.
Note 7: When IDLE0 or SLEEP0 mode is released, TGHALT is automatically cleared to “0”.
Note 8: Before setting TGHALT to “1”, be sure to stop peripherals. If peripherals are not stopped, the interrupt latch of peripherals
76543210
XENXTENSYSCKIDLE
XENHigh-frequency oscillator control
XTENLow-frequency oscillator control
Main system clock select
SYSCK
IDLE
TGHALT
(Write)/main system clock monitor (Read)
CPU and watchdog timer control
(IDLE1/2 and SLEEP1/2 modes)
0: CPU and watchdog timer remain active
1: CPU and watchdog timer are stopped (Start IDLE1/2 and SLEEP1/2 modes)
0: Feeding clock to all peripherals from TG
1: Stop feeding clock to peripherals except TBT from TG.
(Start IDLE0 and SLEEP0 modes)
(Initial value: 1000 *0**)
to “0” when SYSCK = “1”.
of IDLE0/SLEEP0 mode might be shorter than the period setting by TBTCR<TBTCK>.
may be set after IDLE0 or SLEEP0 mode is released.
R/W
R/W
Page 17
2. Operational Description
2.2 System Clock Controller
2.2.4Operating Mode Control
2.2.4.1STOP mode
TMP86CH22UG
STOP mode is controlled by the system control register 1, the STOP pin input and key-on wakeup input
(STOP2) which is controlled by the STOP mode release control register (STOPCR).
The
STOP pin is also used both as a port P20 and an INT5 (external interrupt input 5) pin. STOP mode is
started by setting SYSCR1<STOP> to “1”. During STOP mode, the following status is maintained.
1. Oscillations are turned off, and all internal operations are halted.
2. The data memory, registers, the program status word and port output latches are all held in the
status in effect before STOP mode was entered.
3. The prescaler and the divider of the timing generator are cleared to “0”.
4. The program counter holds the address 2 ahead of the instruction (e.g., [SET (SYSCR1).7])
which started STOP mode.
STOP mode includes a level-sensitive mode and an edge-sensitive mode, either of which can be
selected with the SYSCR1<RELM>. Do not use any key-on wakeup input (STOP2) for releasing STOP
mode in edge-sensitive mode.
Note 1: The STOP mode can be released by either the STOP or key-on wakeup pin (STOP2). However,
because the STOP pin is different from the key-on wakeup and can not inhibit the release input, the
STOP pin must be used for releasing STOP mode.
Note 2: During STOP period (from start of STOP mode to end of warm up), due to changes in the external
interrupt pin signal, interrupt latches may be set to “1” and interrupts may be accepted immediately
after STOP mode is released. Before starting STOP mode, therefore, disable interrupts. Also, before
enabling interrupts after STOP mode is released, clear unnecessary interrupt latches.
(1)Level-sensitive release mode (RELM = “1”)
In this mode, STOP mode is released by setting the
STOP pin high or setting the STOP2 pin input
which is enabled by STOPCR. This mode is used for capacitor backup when the main power supply
is cut off and long term battery backup.
Even if an instruction for starting STOP mode is executed while
input is low, STOP mode does not start but instead the warm-up sequence starts immediately. Thus,
to start STOP mode in the level-sensitive release mode, it is necessary for the program to first confirm that the
STOP pin input is low or STOP2 input is high. The following two methods can be used
for confirmation.
1. Testing a port.
2. Using an external interrupt input
INT5 (INT5 is a falling edge-sensitive input).
Example 1 :Starting STOP mode from NORMAL mode by testing a port P20.
STOP pin input is high or STOP2
LD(SYSCR1), 01010000B; Sets up the level-sensitive release mode
SSTOPH:TEST(P2PRD). 0; Wait until the
JRSF, SSTOPH
DI; IMF ← 0
SET(SYSCR1). 7; Starts STOP mode
Page 18
STOP pin input goes low level
Example 2 :Starting STOP mode from NORMAL mode with an INT5 interrupt.
PINT5:TEST(P2PRD). 0; To reject noise, STOP mode does not start if
JRSF, SINT5 port P20 is at high
LD(SYSCR1), 01010000B; Sets up the level-sensitive release mode.
DI; IMF ← 0
SET(SYSCR1). 7; Starts STOP mode
SINT5:RETI
V
STOP pin
XOUT pin
IH
TMP86CH22UG
NORMAL
operation
Confirm by program that the
STOP pin input is low and start
STOP mode.
STOP
operation
Figure 2-7 Level-sensitive Release Mode
Note 1: Even if the STOP pin input is low after warm-up start, the STOP mode is not restarted.
Note 2: In this case of changing to the level-sensitive mode from the edge-sensitive mode, the release
mode is not switched until a rising edge of the
(2)Edge-sensitive release mode (RELM = “0”)
In this mode, STOP mode is released by a rising edge of the
cations where a relatively short program is executed repeatedly at periodic intervals. This periodic
signal (for example, a clock from a low-power consumption oscillator) is input to the
the edge-sensitive release mode, STOP mode is started even when the
Do not use any STOP2 pin input for releasing STOP mode in edge-sensitive release mode.
Example :Starting STOP mode from NORMAL mode
Warm up
STOP mode is released by the hardware.
Always released if the STOP
pin input is high.
STOP pin input is detected.
NORMAL
operation
STOP pin input. This is used in appli-
STOP pin input is high level.
STOP pin. In
STOP pin
XOUT pin
STOP mode started
by the program.
DI; IMF ← 0
LD(SYSCR1), 10010000B; Starts after specified to the edge-sensitive release mode
V
IH
NORMAL
operation
STOP
operation
Warm up
STOP mode is released by the hardware at the rising
edge of STOP pin input.
NORMAL
operation
Figure 2-8 Edge-sensitive Release Mode
Page 19
STOP
operation
Loading...
+ 147 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.