D79F9211 Nec
D79F9211 Nec
μPD79F9211
16-bit Single-Chip Microcontrollers
2008
Printed in Japan
[MEMO]
Caution: This product uses SuperFlash® technology licensed from Silicon Storage Technology, Inc.
• The information contained in this document is being issued in advance of the production cycle for the
product. The parameters for the product may change before final production or NEC Electronics
Corporation, at its own discretion, may withdraw the product prior to its production.
• Not all products and/or types are available in every country. Please check with an NEC Electronics sales
representative for availability and additional information.
• No part of this document may be copied or reproduced in any form or by any means without the prior written consent
of NEC Electronics. NEC Electronics assumes no responsibility for any errors that may appear in this document.
• NEC Electronics does not assume any liability for infringement of patents, copyrights or other intellectual property
rights of third parties by or arising from the use of NEC Electronics products listed in this document or any other
liability arising from the use of such products. No license, express, implied or otherwise, is granted under any
patents, copyrights or other intellectual property rights of NEC Electronics or others.
• Descriptions of circuits, software and other related information in this document are provided for illustrative purposes
in semiconductor product operation and application examples. The incorporation of these circuits, software and
information in the design of a customer's equipment shall be done under the full responsibility of the customer. NEC
Electronics assumes no responsibility for any losses incurred by customers or third parties arising from the use of
these circuits, software and information.
• While NEC Electronics endeavors to enhance the quality, reliability and safety of NEC Electronics products,
customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. To minimize
risks of damage to property or injury (including death) to persons arising from defects in NEC Electronics products,
customers must incorporate sufficient safety measures in their design, such as redundancy, fire-containment and
anti-failure features.
• NEC Electronics products are classified into the following three quality grades: "Standard", "Special" and "Specific".
The "Specific" quality grade applies only to NEC Electronics products developed based on a customer-designated
"quality assurance program" for a specific application. The recommended applications of an NEC Electronics
products depend on its quality grade, as indicated below. Customers must check the quality grade of each NEC
Electronics product before using it in a particular application.
"Standard": Computers, office equipment, communications equipment, test and measurement equipment, audio and
visual equipment, home electronic appliances, machine tools, personal electronic equipment and
industrial robots.
"Special": Transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster
systems, anti-crime systems, safety equipment and medical equipment (not specifically designed for life
support).
"Specific": Aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support
systems and medical equipment for life support, etc.
The quality grade of NEC Electronics products is "Standard" unless otherwise expressly specified in NEC
Electronics data sheets or data books, etc. If customers wish to use NEC Electronics products in applications
not intended by NEC Electronics, they must contact an NEC Electronics sales representative in advance to
determine NEC Electronics' willingness to support a given application.
(Note)
(1) "NEC Electronics" as used in this statement means NEC Electronics Corporation and also includes its
majority-owned subsidiaries.
(2) "NEC Electronics products" means any product developed or manufactured by or for NEC Electronics (as
defined above).
Readers This manual is intended for user engineers who wish to understand the functions of the
μPD79F9211 and design and develop application systems and programs for these
devices.
The target products are as follows.
μPD79F9210, μPD79F9211
Purpose This manual is intended to give users an understanding of the functions described in the
Organization below.
Organization The μPD79F9211 manual is separated into two parts: this manual and the instructions
edition (common to the 78K0R Microcontroller Series).
How to Read This Manual It is assumed that the readers of this manual have general knowledge of electrical
engineering, logic circuits, and microcontrollers.
• To gain a general understanding of functions:
→ Read this manual in the order of the CONTENTS.
• How to interpret the register format:
→ For a bit number enclosed in angle brackets, the bit name is defined as a
reserved word in the RA78K0R, and is defined as an sfr variable using the
#pragma sfr directive in the CC78K0R.
• To know details of the 78K0R Series instructions:
→ Refer to the separate document 78K0R Microcontroller Instructions User’s
Manual (U17792E).
Related Documents The related documents indicated in this publication may include preliminary versions.
However, preliminary versions are not marked as such.
Caution The related documents listed above are subject to change without notice. Be sure to use the latest
version of each document when designing.
Caution The related documents listed above are subject to change without notice. Be sure to use the latest
version of each document when designing.
1.1 Features......................................................................................................................................... 19
1.2 Applications .................................................................................................................................. 20
1.3 Ordering Information.................................................................................................................... 20
1.4 Pin Configuration (Top View) ...................................................................................................... 21
1.5 Block Diagram .............................................................................................................................. 23
1.6 Outline of Functions..................................................................................................................... 24
The μPD79F9211 is a 16-bit single-chip microcontroller that uses a 78K0R CPU core and incorporates peripheral
functions, such as ROM/RAM, a multi-function timer, a multi-function serial interface, an A/D converter, a
programmable gain amplifier (PGA), a comparator, a real-time counter, and a watchdog timer.
This product has been developed for inverter control applications that are controlled by using two chips. The multi-
function timer (timer array unit TAUS) that can perform various PWM operations operates at a maximum resolution of
40 MHz and is provided with several functions, such as a PWM (complementary PWM × 2 channels) output function
with dead time, a 6-phase PWM output function with dead time, and a DC inverter real-time output function, and can
perform inverter control. Furthermore, the multi-function timer is equipped with two channels of comparators for fail-
safe applications and can set PWM to high impedance when an overcurrent occurs.
In consideration of motor applications, the internal high-speed oscillator (CPU clock 20 MHz, timer 40 MHz) is
mounted. This can solve problems such as the resonator coming off.
The μPD79F9211 provides high cost performance in various situations.
1.1 Features
{ Minimum instruction execution time can be changed from high speed (0.05 μs: @ 20 MHz operation with high-
speed system clock) to ultra low-speed (61 μs: @ 32.768 kHz operation with subsystem clock)
{ General-purpose register: 8 bits × 32 registers (8 bits × 8 registers × 4 banks)
{ ROM, RAM capacities
μPD79F9211Note 16 KB 1 KB
{ On-chip single-power-supply flash memory (with prohibition of chip erase/block erase/writing function)
{ Self-programming (with boot swap function/flash shield window function)
{ On-chip debug function
{ On-chip power-on-clear (POC) circuit and low-voltage detector (LVI)
{ On-chip watchdog timer (operable with the internal low-speed oscillation clock)
{ On-chip multiplier/divider (16 bits × 16 bits, 32 bits ÷ 32 bits)
{ On-chip BCD adjustment
{ I/O ports: 37
{ Timer: 14 channels
• 16-bit timer: 12 channels
• Watchdog timer: 1 channel
• Real-time counter: 1 channel
• On-chip motor control option unit
{ On-chip comparator/operational amplifier function
{ Serial interface
• CSI: 2 channels/UART (LIN-bus supported): 1 channel
• CSI: 1 channel/UART: 1 channel/simplified I2C: 1 channel
{ 10-bit resolution A/D converter (AVREF = 2.7 to 5.5 V)
10 channels
{ Power supply voltage: VDD = 2.7 to 5.5 V
{ Operating ambient temperature: TA = −40 to +85°C
1.2 Applications
{ Electric bicycles
Caution The μPD79F9211 has an on-chip debug function, which is provided for development and
evaluation. Do not use the on-chip debug function in products designated for mass production,
because the guaranteed number of rewritable times of the flash memory may be exceeded when
this function is used, and product reliability therefore cannot be guaranteed. NEC Electronics is
not liable for problems occurring when the on-chip debug function is used.
P120/INTP0/EXLVI
P150/ANI8
P151/ANI9
P20/ANI0
P21/ANI1
P22/ANI2
P23/ANI3
P24/ANI4
P25/ANI5
P26/ANI6
P27/ANI7
44 43 42 41 40 39 38 37 36 35 34
P41/TOOL1 1 33 AVSS
P40/TOOL0 2 32 AVREF
RESET 3 31 P80/CMP0P/TMOFF0/INTP3/OAI
P124/XT2 4 30 P81/CMP0M
P123/XT1 5 29 P82/CMP1P/TMOFF1/INTP7
FLMD0 6 28 P83/CMP1M
P122/X2/EXCLK 7 27 P10/TI02/TO02
P121/X1 8 26 P11/TI03/TO03
REGC 9 25 P12/TI04/TO04
VSS 10 24 P13/TI05/TO05
VDD 11 23 P50/TI06/TO06
12 13 14 15 16 17 18 19 20 21 22
P30/SO10/TxD1/TO11
P31/SI10/RxD1/SDA10/INTP1/TI09
P32/SCK10/SCL10/INTP2
P75/SCK00/TI11
P74/SI00/RxD0/TI10
P73/SO00/TxD0/TO10
P72/SCK01/INTP6
P71/SI01/INTP5
P70/SO01/INTP4
P52/SLTI/SLTO
P51/TI07/TO07
Pin Identification
SLTI/SLTO/P52 ch0
PORT 2 8 P20 to P27
ch1
PORT 3 3 P30 to P32
TI02/TO02/P10 ch2
TI05/TO05/P13 ch5
PORT 7 6 P70 to P75
TI06/TO06/P50 ch6
PORT 8 4 P80 to P83
TI07/TO07/P51
ch7
RxD0/P74 (LINSEL) P120
PORT 12
4 P121 to P124
ch8
TI10/P74 ANI0/P20 to
ch10 8
TO10/P73 ANI7/P27
ANI8/P150,
A/D CONVERTER 2
TI11/P75 ANI9/P151
TO11/P30 ch11
AVREF
AVSS
OPERATIONAL
OAI/P80
TMOFF0/P80 TIMER ARRAY AMPLIFIER
TMOFF1/P82 UNIT OPTION
LOW-SPEED
78K0R FLASH
INTERNAL
CPU OSCILLATOR
CMP0M/P81, MEMORY
2 CORE
CMP1M/P83
COMPARATOR WINDOW
CMP0P/P80,
2 WATCHDOG
CMP1P/P82
TIMER
SERIAL ARRAY
UNIT(4ch) REALTIME COUNTER
RxD0/P74 UART0
TxD0/P73 LINSEL DIRECT MEMORY
RAM ACCESS CONTROL
RxD1/P31
UART1
TxD1/P30
POWER ON CLEAR/
SCK00/P75 POC/LVI
LOW VOLTAGE EXLVI/P120
SI00/P74 CSI00 CONTROL
INDICATOR
SO00/P73
SCK01/P72
SI01/P71 CSI01
SO01/P70 RESET CONTROL
SCK10/P32
SI10/P31 CSI10 TOOL0/P40
ON-CHIP DEBUG
SO10/P30 TOOL1/P41
SCL10/P32
IIC10 RESET
SDA10/P31 SYSTEM
CONTROL X1/P121
RxD0/P74 (LINSEL) VDD VSS X2/EXCLK/P122
FLMD0
INTP0/P120 HIGH-SPEED XT1/P123
INTERNAL XT2/P124
INTP1/P31, OSCILLATOR
2
INTP2/P32
INTP4/P70, INTERRUPT
INTP5/P71, 3 CONTROL VOLTAGE
REGC
INTP6/P72 REGULATOR
INTP3/P80,
2
INTP7/P82 BCD
ADJUSTMENT
MULTIPLIER&
DIVIDER
CMOS Input 4
Timer • 16-bit timer: 12 channels
• Watchdog timer: 1 channel
• Real-time counter: 1 channel
Timer outputs 9 (PWM output: 9)
A/D converter 10-bit resolution × 10 channels (AVREF = 2.7 to 5.5 V)
(2/2)
Item μPD79F9211Note
Serial interface • CSI: 2 channels/UART (LIN-bus supported): 1 channel
• CSI: 1 channel/UART: 1 channel/simplified I C: 1 channel
2
There are two types of pin I/O buffer power supplies: AVREF and VDD. The relationship between these power
supplies and the pins is shown below.
Note
P40 I/O Port 4. Input port TOOL0
2-bit I/O port.
Input/output can be specified in 1-bit units.
P41 TOOL1
Use of an on-chip pull-up resistor can be specified by a software
setting.
P50 I/O Port 5. Input port TI06/TO06
3-bit I/O port.
P51 Input port TI07/TO07
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a software
P52 Input port SLTI/SLTO
setting.
P70 I/O Port 7. Input port SO01/INTP4
6-bit I/O port.
P71 SI01/INTP5
Input of P71, P72, P74, and P75 can be set to TTL buffer.
P72 Output of P70, P72, P73, and P75 can be set to N-ch open- SCK01/INTP6
Note If on-chip debugging is enabled by using an option byte, be sure to pull up the P40/TOOL0 pin externally
(see Caution in 2.2.4 P40, P41 (port 4)).
P124 XT2
ANI0 to ANI7 Input A/D converter analog input Digital input P20 to P27
ANI8, ANI9 port P150, P151
CMP0M Input Input voltage on the side of comparator 0 (−) Analog P81
CMP0P Input Input voltage on the side of comparator 0 (+) input P80/TMOFF0/
INTP3/OAI
EXLVI Input Potential input for external low-voltage detection Input port P120/INTP0
INTP0 Input External interrupt request input for which the valid edge (rising Input port P120/EXLVI
INTP1 edge, falling edge, or both rising and falling edges) can be P31/SI10/RxD1/
specified SDA10/TI09
INTP2 P32/SCK10/SCL10
INTP3 P80/CMP0P/
TMOFF0/OAI
INTP4 P70/SO01
INTP5 P71/SI01
INTP6 P72/SCK01
INTP7 P82/CMP1P/
TMOFF1
OAI Input Operational amplifier input Input port P80/CMP0P/
TMOFF0/INTP3
REGC − Connecting regulator output (2.4 V) stabilization capacitance for − −
internal operation.
Connect to VSS via a capacitor (0.47 to 1 μF: target).
RESET Input System reset input − −
RxD0 Input Serial data input to UART0 Input port P74/SI00/TI10
RxD1 Serial data input to UART1 P31/SI10/SDA10/
INTP1/TI09
SCK00 I/O Clock input/output for CSI00, CSI01, and CSI10 Input port P75/TI11
SCK01 P72/INTP6
SCK10 P32/SCL10/INTP2
2
SCL10 I/O Clock input/output for simplified I C Input port P32/SCK10/INTP2
2
SDA10 I/O Serial data I/O for simplified I C Input port P31/SI10/RxD1/
INTP1/TI09
SI00 Input Serial data input to CSI00, CSI01, and CSI10 Input port P74/RxD0/TI10
SI01 P71/INTP5
SI10 P31/RxD1/SDA10/
INTP1/TI09
SLTI Input 16-bit timer 00, 01, 08, 09, 10, 11 input Input port P52/SLTO
SLTO Output 16-bit timer 00, 01, 08, 09, 10, 11 output Input port P52/SLTI
Caution ANI0/P20 to ANI7/P27 are set in the digital input (general-purpose port) mode after release of
reset.
(a) SI10
This is a serial data input pin of serial interface CSI10.
(b) SO10
This is a serial data output pin of serial interface CSI10.
(c) SCK10
This is a serial clock I/O pin of serial interface CSI10.
(d) TxD1
This is a serial data output pin of serial interface UART1.
(e) RxD1
This is a serial data input pin of serial interface UART1.
(f) SDA10
2
This is a serial data I/O pin of serial interface for simplified I C.
(g) SCL10
2
This is a serial clock I/O pin of serial interface for simplified I C.
(i) TI09
This is a pin for inputting an external count clock/capture trigger to 16-bit timer 09.
(j) TO11
This is a timer output pin of 16-bit timer 11.
(a) TOOL0
This is a data I/O pin for a flash memory programmer/debugger.
Be sure to pull up this pin externally when on-chip debugging is enabled (pulling it down is prohibited).
(b) TOOL1
This is a clock output pin for a debugger.
When the on-chip debug function is used, P41/TOOL1 pin can be used as follows by the mode setting on the
debugger.
1-line mode: can be used as a port (P41).
2-line mode: used as a TOOL1 pin and cannot be used as a port (P41).
Caution The function of the P40/TOOL0 pin varies as described in (a) to (c) below.
In the case of (b) or (c), make the specified connection.
(a) In normal operation mode and when on-chip debugging is disabled (OCDENSET = 0) by
an option byte (000C3H)
=> Use this pin as a port pin (P40).
(b) In normal operation mode and when on-chip debugging is enabled (OCDENSET = 1) by
an option byte (000C3H)
=> Connect this pin to VDD via an external resistor, and always input a high level to the
pin before reset release.
(c) When on-chip debug function is used, or in write mode of flash memory programmer
=> Use this pin as TOOL0.
Directly connect this pin to the on-chip debug emulator or a flash memory
programmer, or pull it up by connecting it to VDD via an external resistor.
(c) SLTI
This is used as a pin for inputting an external count clock or a capture trigger to 16-bit timers 00, 01, 08, 09,
10, and 11, by setting the input switching control register (ISC).
(d) SLTO
This is used as a timer output pin of 16-bit timers 00, 01, 08, 09, 10, and 11, by setting the input switching
control register (ISC).
(b) TO10
This is a timer output pin of 16-bit timer 10.
(f) TxD0
This is a serial data output pin of serial interface UART0.
(g) RxD0
This is a serial data input pin of serial interface UART0.
These are the external interrupt request input pin for which the valid edge (rising edge, falling edge, or both
rising and falling edges) can be specified.
(e) OAI
This is an operational amplifier input pin.
(a) INTP0
This is an external interrupt request input pin for which the valid edge (rising edge, falling edge, or both rising
and falling edges) can be specified.
(b) EXLVI
This is a potential input pin for external low-voltage detection.
(c) X1, X2
These are the pins for connecting a resonator for main system clock.
(e) EXCLK
This is an external clock input pin for main system clock.
Caution ANI8/P150 and ANI9/P151 are set in the digital input (general-purpose port) mode after release
of reset.
2.2.10 AVREF
This is the A/D converter and comparator reference voltage input pin and the positive power supply pin of P20 to
P27, P150 to P151, P80 to P83, A/D converter, operational amplifier, and comparator.
When all pins of port 2, port 15Note, and port 8 are used as the analog port pins, make the potential of AVREF be
such that 2.7 V ≤ AVREF ≤ VDD. When one or more of the pins of port 2, port 15Note, and port 8 are used as the digital
port pins or when the A/D converter, operational amplifier, and comparator are not used, make AVREF the same
potential as VDD.
2.2.11 AVSS
This is the ground potential pin of A/D converter, operational amplifier, comparator, P20 to P27, P150 to P151, and
P80 to P83. Even when the A/D converter, operational amplifier, and comparator are not used, always use this pin
with the same potential as VSS.
2.2.12 RESET
This is the active-low system reset input pin.
When the external reset pin is not used, connect this pin directly to VDD or via a resistor.
2.2.13 REGC
This is the pin for connecting regulator output (2.4 V) stabilization capacitance for internal operation. Connect this
pin to VSS via a capacitor (0.47 to 1 μF: target). However, when using the STOP mode that has been entered since
operation of the internal high-speed oscillation clock and external main system clock, 0.47 μF is recommended.
Also, use a capacitor with good characteristics, since it is used to stabilize internal voltage.
REGC
VSS
Caution Keep the wiring length as short as possible for the broken-line part in the above figure.
2.2.14 VDD
VDD is the positive power supply pin for port pins other than P20 to P27, P150 to P151, and P80 to P83, and other
than ports.
2.2.15 VSS
VSS is the ground potential pin for port pins other than P20 to P27, P150 to P151, and P80 to P83, and other than
ports.
2.2.16 FLMD0
This is a pin for setting flash memory programming mode.
Perform either of the following processing.
Table 2-2 shows the types of pin I/O circuits and the recommended connections of unused pins.
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
P10/TI02/TO02 8-R I/O Input: Independently connect to VDD or VSS via a resistor.
P11/TI03/TO03 Output: Leave open.
P12/TI04/TO04
P13/TI05/TO05
Note
P20/ANI0 to P27/ANI7 11-G Input: Independently connect to AVREF or AVSS via a resistor.
Output: Leave open.
P30/SO10/TxD1/TO11 5-AG Input: Independently connect to VDD or VSS via a resistor.
Output: Leave open.
P31/SI10/RxD1/SDA10/ 5-AN <When N-ch open-drain>
INTP1/TI09 Output
P32/SCK10/SCL10/INTP2 • Set the port output latch to 0: Leave open.
• Set the port output latch to 1: Independently connect to VDD or
VSS via a resistor.
P40/TOOL0 8-R <When on-chip debugging is enabled>
Pull this pin up (pulling it down is prohibited).
<When on-chip debugging is disabled>
Input: Independently connect to VDD or VSS via a resistor.
Output: Leave open.
P41/TOOL1 Input: Independently connect to VDD or VSS via a resistor.
P50/TI06/TO06 Output: Leave open.
P51/TI07/TO07
P52/SLTI/SLTO
Note P20/ANI0 to P27/ANI7 are set in the digital input port mode after release of reset.
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
P70/SO01/INTP4 8-R I/O Input: Independently connect to VDD or VSS via a resistor.
Output: Leave open.
<When N-ch open-drain>
Output
• Set the port output latch to 0: Leave open.
• Set the port output latch to 1: Independently connect to VDD or
VSS via a resistor.
P71/SI01/INTP5 5-AN Input: Independently connect to VDD or VSS via a resistor.
Output: Leave open.
P72/SCK01/INTP6 Input: Independently connect to VDD or VSS via a resistor.
P73/SO00/TxD0/TO10 8-R Output: Leave open.
<When N-ch open-drain>
Output
• Set the port output latch to 0: Leave open.
• Set the port output latch to 1: Independently connect to VDD or
VSS via a resistor.
P74/SI00/RxD0/TI10 5-AN Input: Independently connect to VDD or VSS via a resistor.
Output: Leave open.
P75/SCK00/TI11 Input: Independently connect to VDD or VSS via a resistor.
Output: Leave open.
<When N-ch open-drain>
Output
• Set the port output latch to 0: Leave open.
• Set the port output latch to 1: Independently connect to VDD or
VSS via a resistor.
P80/CMP0P/TMOFF0/ 11-J Input: Independently connect to AVREF or AVSS via a resistor.
INTP3/OAI Output: Leave open.
P81/CMP0M 11-H
P82/CMP1P/TOMOFF1/ 11-I
INTP7
P83/CMP1M 11-H
P120/INTP0/EXLVI 8-R Input: Independently connect to VDD or VSS via a resistor.
Output: Leave open.
Note 1
P121/X1 37-C Input Independently connect to VDD or VSS via a resistor.
Note 1
P122/X2/EXCLK
Note 1
P123/XT1 37-B
Note 1
P124/XT2
Note 2
P150/ANI8, P151/ANI9 11-G I/O Input: Independently connect to AVREF or AVSS via a resistor.
Output: Leave open.
Notes 1. Use recommended connection above in input port mode (see Figure 5-2 Format of Clock Operation
Mode Control Register (CMC)) when these pins are not used.
2. P150/ANI8 and P151/ANI9 are set in the digital input port mode after release of reset.
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
AVREF − − <When one or more of P20 to P27, P150, P151, or P80 to P83
are set as a digital port>
Make this pin the same potential as VDD.
<When all of P20 to P27, P150, P151, and P80 to P83 are set as
analog ports>
Make this pin to have a potential where 2.7 V ≤ AVREF ≤ VDD.
AVSS − − Make this pin the same potential as the VSS.
FLMD0 2-W − Leave open or connect to VSS via a resistor of 100 kΩ or more.
RESET 2 Input Connect directly to VDD or via a resistor.
REGC − − Connect to VSS via capacitor (0.47 to 1 μF: target).
VDD
pull-up
P-ch
enable
IN
pull-down
N-ch
enable
VSS
Schmitt-triggered input with hysteresis characteristics
IN
VDD
VDD
Pull-up
enable P-ch
P-ch
VDD
IN/OUT
N-ch
Output N-ch
disable
VSS
VSS
Input
enable
Pull-up
enable P-ch Pull-up
VDD enable P-ch
VSS
TTL
Input
characteristic
data
P-ch
IN/OUT
AVREF
output N-ch
disable
Data
P-ch
AVSS
Voltage generated by internal amplifier or
IN/OUT
CMP0P (pin level)
Output
N-ch
disable
Comparator
+
P-ch
AVSS _
P-ch
Comparator N-ch
+
_
N-ch
Internally
Series resistor string voltage P-ch generated
AVSS
reference
N-ch
voltage
Input enable
input enable
data
P-ch
AVREF
data
P-ch output N-ch
disable
IN/OUT
AVSS
output N-ch
disable
P-ch P-ch
+ OP
AVSS N-ch
AMP
_ N-ch
P-ch AVSS
Voltage generated
by internal amplifier
N-ch VREF
(threshold voltage)
P-ch
+
_
N-ch
Comparator
P-ch
+
input enable
IN/OUT
XT2
data
N-ch input
output disable enable
amp
enable
VSS
P-ch
N-ch
XT1
input
enable
Type 37-C
X2
input
enable amp
enable
P-ch
N-ch
X1
input
enable
Products in the μPD79F9211 can access a 1 MB memory space. Figures 3-1 shows the memory maps.
FFFFFH 03FFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
FFEE0H 32 bytes
FFEDFH RAMNote 1
FFB00H 1 KB Program area
FFAFFH
Reserved
01FFFH
F4000H
F3FFFH 010CEH
Mirror
010CDH On-chip debug security
F1000H 12 KB
ID setting areaNote 2
F0FFFH
Reserved 010C4H 10 bytes
F0800H 010C3H Option byte areaNote 2
F07FFH 010C0H 4 bytes
Special function register (2nd SFR) 010BFH Boot cluster 1
2 KB CALLT table area
Data memory 64 bytes
space F0000H 01080H
EFFFFH 0107FH
01000H
00FFFH
000CEH
000CDH On-chip debug security
ID setting areaNote 2
000C4H 10 bytes
000C3H Option byte areaNote 2 Boot cluster 0Note 3
000C0H 4 bytes
000BFH
CALLT table area
64 bytes
00080H
04000H 0007FH
03FFFH
Program Vector table area
memory Flash memory 128 bytes
space 16 KB
00000H 00000H
Notes 1. Use of the area FFE20H to FFEDFH is prohibited when using the self-programming function. Since this
area is used for self-programming library.
2. When boot swap is not used: Set the option bytes to 000C0H to 000C3H, and the on-chip debug
security IDs to 000C4H to 000CDH.
When boot swap is used: Set the option bytes to 000C0H to 000C3H and 010C0H to 010C3H, and
the on-chip debug security IDs to 000C4H to 000CDH and 010C4H to
010CDH.
3. Writing boot cluster 0 can be prohibited depending on the setting of security (see 22.7 Security
Setting).
Remark The flash memory is divided into blocks (one block = 1 KB). For the address values and block numbers,
see Table 3-1 Correspondence Between Address Values and Block Numbers in Flash Memory.
0FFFFH
Block 3FH
0FC00H
0FBFFH
007FFH
Block 01H
00400H
003FFH
Block 00H 1 KB
00000H
Correspondence between the address values and block numbers in the flash memory are shown below.
Table 3-1. Correspondence Between Address Values and Block Numbers in Flash Memory
Address Value Block Address Value Block Address Value Block Address Value Block
Number Number Number Number
00000H to 003FFH 00H 04000H to 043FFH 10H 08000H to 083FFH 20H 0C000H to 0C3FFH 30H
00400H to 007FFH 01H 04400H to 047FFH 11H 08400H to 087FFH 21H 0C400H to 0C7FFH 31H
00800H to 00BFFH 02H 04800H to 04BFFH 12H 08800H to 08BFFH 22H 0C800H to 0CBFFH 32H
00C00H to 00FFFH 03H 04C00H to 04FFFH 13H 08C00H to 08FFFH 23H 0CC00H to 0CFFFH 33H
01000H to 013FFH 04H 05000H to 053FFH 14H 09000H to 093FFH 24H 0D000H to 0D3FFH 34H
01400H to 017FFH 05H 05400H to 057FFH 15H 09400H to 097FFH 25H 0D400H to 0D7FFH 35H
01800H to 01BFFH 06H 05800H to 05BFFH 16H 09800H to 09BFFH 26H 0D800H to 0DBFFH 36H
01C00H to 01FFFH 07H 05C00H to 05FFFH 17H 09C00H to 09FFFH 27H 0DC00H to 0DFFFH 37H
02000H to 023FFH 08H 06000H to 063FFH 18H 0A000H to 0A3FFH 28H 0E000H to 0E3FFH 38H
02400H to 027FFH 09H 06400H to 067FFH 19H 0A400H to 0A7FFH 29H 0E400H to 0E7FFH 39H
02800H to 02BFFH 0AH 06800H to 06BFFH 1AH 0A800H to 0ABFFH 2AH 0E800H to 0EBFFH 3AH
02C00H to 02FFFH 0BH 06C00H to 06FFFH 1BH 0AC00H to 0AFFFH 2BH 0EC00H to 0EFFFH 3BH
03000H to 033FFH 0CH 07000H to 073FFH 1CH 0B000H to 0B3FFH 2CH 0F000H to 0F3FFH 3CH
03400H to 037FFH 0DH 07400H to 077FFH 1DH 0B400H to 0B7FFH 2DH 0F400H to 0F7FFH 3DH
03800H to 03BFFH 0EH 07800H to 07BFFH 1EH 0B800H to 0BBFFH 2EH 0F800H to 0FBFFH 3EH
03C00H to 03FFFH 0FH 07C00H to 07FFFH 1FH 0BC00H to 0BFFFH 2FH 0FC00H to 0FFFFH 3FH
The internal program memory space is divided into the following areas.
Vector Table Address Interrupt Source Vector Table Address Interrupt Source
00000H RESET input, POC, LVI, 0002CH INTTM00
WDT, TRAP 0002EH INTTM01
00004H INTWDTI 00030H INTTM02
00006H INTLVI 00032H INTTM03
00008H INTP0 00034H INTAD
0000AH INTP1 00036H INTRTC
0000CH INTP2 00038H INTRTCI
0000EH INTP3/INTTMOFF0 0003CH INTTMM0
00010H INTP4 0003EH INTTMV0
00012H INTP5 00040H INTMD
00014H INTTMAD 00042H INTTM04
00016H INTCMP0 00044H INTTM05
00018H INTCMP1 00046H INTTM06
0001AH INTDMA0 00048H INTTM07
0001CH INTDMA1 0004AH INTP6
0001EH INTST0/INTCSI00 0004CH INTP7/INTTMOFF1
00020H INTSR0/INTCSI01 0004EH INTTMM1
00022H INTSRE0 00050H INTTMV1
00024H INTST1/INTCSI10/INTIIC10 00052H INTTM08
00026H INTSR1 00054H INTTM09
00028H INTSRE1 00056H INTTM10
00058H INTTM11
To use the boot swap function, set a CALLT instruction table also at 01080H to 010BFH.
FFFFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
FFEE0H 32 bytes
FFED FH
RAM
FFB0 0 H 1 KB
FFA FFH
Reserved
F4 0 0 0 H
F3 FFFH
Flash memory
(same data as 01000H to 04000H)
F1 0 0 0 H
F0 FFFH
Reserved
F0 8 0 0 H
F07FFH
Special function register (2nd SFR)
2 KB
F0 0 0 0 H
EFFFFH
Mirror
Reserved
04000H
0 3 FFFH
Flash memory
01000H
00FFFH
Flash memory
00000H
PMC 0 0 0 0 0 0 0 MAA
MAA Selection of flash memory space for mirroring to area from F0000H to FFFFFH
0 00000H to 0FFFFH is mirrored to F0000H to FFFFFH
1 Setting prohibited
The 32-byte area FFEE0H to FFEFFH is assigned to four general-purpose register banks consisting of eight 8-bit
registers per bank.
This area can be used as a program area where instructions are written and executed. However, executing
instructions is disabled in the general-purpose register.
The internal high-speed RAM can also be used as a stack memory.
Caution While using the self-programming function, the areas FFE20H to FFEDFH cannot be used as stack
memory.
3.1.5 Extended special function register (2nd SFR: 2nd Special Function Register) area
On-chip peripheral hardware special function registers (2nd SFRs) are allocated in the area F0000H to F07FFH
(see Table 3-6 in 3.2.5 Extended Special function registers (2nd SFRs: 2nd Special Function Registers)).
SFRs other than those in the SFR area (FFF00H to FFFFFH) are allocated to this area. An instruction that
accesses the extended SFR area, however, is 1 byte longer than an instruction that accesses the SFR area.
Caution Do not access addresses to which extended SFRs are not assigned.
FFFFFH
FFF20H Special function register (SFR) SFR addressing
FFF1FH 256 bytes
FFF00H
FFEFFH General-purpose register Short direct
32 bytes Register addressing addressing
FFEE0H
FFEDFH
FFE20H RAMNote
FFE1FH 1 KB
FFB00H
FFAFFH
Reserved
F4000H
F3FFFH Mirror
F1000H 12 KB
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH Based addressing
Reserved
04000H
03FFFH
Flash memory
16 KB
00000H
Note Use of the area FFE20H to FFEDFH is prohibited when using the self-programming function. Since this
area is used for self-programming library.
19 0
PC
7 0
Remark n = 0, 1
15 0
SP SP15 SP14 SP13 SP12 SP11 SP10 SP9 SP8 SP7 SP6 SP5 SP4 SP3 SP2 SP1 SP0
The SP is decremented ahead of write (save) to the stack memory and is incremented after read (restored) from
the stack memory.
Each stack operation saves data as shown in Figure 3-7.
Caution Since reset signal generation makes the SP contents undefined, be sure to initialize the SP
before using the stack.
SP←SP−2 SP←SP−2
↑ ↑
SP−2 Register pair lower SP−2 00H
↑ ↑
SP−1 Register pair higher SP−1 PSW
↑ ↑
SP → SP →
SP←SP−4 SP←SP−4
↑ ↑
SP−4 PC7 to PC0 SP−4 PC7 to PC0
↑ ↑
SP−3 PC15 to PC8 SP−3 PC15 to PC8
↑ ↑
SP−2 PC19 to PC16 SP−2 PC19 to PC16
↑ ↑
SP−1 00H SP−1 PSW
↑ ↑
SP → SP →
Caution It is prohibited to use the general-purpose register (FFEE0H to FFEFFH) space for fetching
instructions or as a stack area.
D
Register bank 1 DE
E
FFEF0H
B
Register bank 2 BC
C
FFEE8H
A
Register bank 3 AX
X
FFEE0H
15 0 7 0
R5
Register bank 1 RP2
R4
FFEF0H
R3
Register bank 2 RP1
R2
FFEE8H
R1
Register bank 3 RP0
R0
FFEE0H
15 0 7 0
7 6 5 4 3 2 1 0
CS 0 0 0 0 CS3 CP2 CP1 CP0
• 1-bit manipulation
Describe the symbol reserved by the assembler for the 1-bit manipulation instruction operand (sfr.bit). This
manipulation can also be specified with an address.
• 8-bit manipulation
Describe the symbol reserved by the assembler for the 8-bit manipulation instruction operand (sfr). This
manipulation can also be specified with an address.
• 16-bit manipulation
Describe the symbol reserved by the assembler for the 16-bit manipulation instruction operand (sfrp). When
specifying an address, describe an even address.
Table 3-5 gives a list of the SFRs. The meanings of items in the table are as follows.
• Symbol
Symbol indicating the address of a special function register. It is a reserved word in the RA78K0R, and is
defined as an sfr variable using the #pragma sfr directive in the CC78K0R. When using the RA78K0R,
ID78K0R-QB, and SM+ for 78K0R, symbols can be written as an instruction operand.
• R/W
Indicates whether the corresponding SFR can be read or written.
R/W: Read/write enable
R: Read only
W: Write only
• Manipulable bit units
“√” indicates the manipulable bit unit (1, 8, or 16). “−” indicates a bit unit for which manipulation is not possible.
• After reset
Indicates each register status upon reset signal generation.
Caution Do not access addresses to which extended SFRs are not assigned.
Remark For extended SFRs (2nd SFRs), see 3.2.5 Extended special function registers (2nd SFRs: 2nd
Special Function Registers).
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFF01H Port register 1 P1 R/W √ √ − 00H
FFF02H Port register 2 P2 R/W √ √ − 00H
FFF03H Port register 3 P3 R/W √ √ − 00H
FFF04H Port register 4 P4 R/W √ √ − 00H
FFF05H Port register 5 P5 R/W √ √ − 00H
FFF07H Port register 7 P7 R/W √ √ − 00H
FFF08H Port register 8 P8 R/W √ √ − 00H
FFF0CH Port register 12 P12 R/W √ √ − Undefined
FFF0FH Port register 15 P15 R/W √ √ − 00H
FFF10H Serial data register 00 TXD0/ SDR00 R/W − √ √ 0000H
SIO00
FFF11H − − −
FFF12H Serial data register 01 RXD0/ SDR01 R/W − √ √ 0000H
SIO01
FFF13H − − −
FFF18H Timer data register 00 TDR00 R/W − − √ 0000H
FFF19H
FFF1AH Timer data register 01 TDR01 R/W − − √ 0000H
FFF1BH
FFF1EH 10-bit A/D conversion result register ADCR R − − √ 0000H
FFF1FH 8-bit A/D conversion result register ADCRH R − √ − 00H
FFF21H Port mode register 1 PM1 R/W √ √ − FFH
FFF22H Port mode register 2 PM2 R/W √ √ − FFH
FFF23H Port mode register 3 PM3 R/W √ √ − FFH
FFF24H Port mode register 4 PM4 R/W √ √ − FFH
FFF25H Port mode register 5 PM5 R/W √ √ − FFH
FFF27H Port mode register 7 PM7 R/W √ √ − FFH
FFF28H Port mode register 8 PM8 R/W √ √ − FFH
FFF2CH Port mode register 12 PM12 R/W √ √ − FFH
FFF2FH Port mode register 15 PM15 R/W √ √ − FFH
FFF30H A/D converter mode register ADM R/W √ √ − 00H
FFF31H Analog input channel specification register ADS R/W √ √ − 00H
FFF38H External interrupt rising edge enable register 0 EGP0 R/W √ √ − 00H
FFF39H External interrupt falling edge enable register 0 EGN0 R/W √ √ − 00H
FFF3CH Input switch control register ISC R/W √ √ − 00H
FFF3EH Timer input select register 0 TIS0 R/W √ √ − 00H
FFF42H A/D converter mode register 1 ADM1 R/W √ √ − 00H
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFF44H Serial data register 02 TXD1/ SDR02 R/W − √ √ 0000H
SIO10
FFF45H − − −
FFF46H Serial data register 03 RXD1 SDR03 R/W − √ √ 0000H
FFF47H − − −
FFF64H Timer data register 02 TDR02 R/W − − √ 0000H
FFF65H
FFF66H Timer data register 03 TDR03 R/W − − √ 0000H
FFF67H
FFF68H Timer data register 04 TDR04 R/W − − √ 0000H
FFF69H
FFF6AH Timer data register 05 TDR05 R/W − − √ 0000H
FFF6BH
FFF6CH Timer data register 06 TDR06 R/W − − √ 0000H
FFF6DH
FFF6EH Timer data register 07 TDR07 R/W − − √ 0000H
FFF6FH
FFF70H Timer data register 08 TDR08 R/W − − √ 0000H
FFF71H
FFF72H Timer data register 09 TDR09 R/W − − √ 0000H
FFF73H
FFF74H Timer data register 10 TDR10 R/W − − √ 0000H
FFF75H
FFF76H Timer data register 11 TDR11 R/W − − √ 0000H
FFF77H
FFF90H Sub-count register RSUBC R − − √ 0000H
FFF91H
FFF92H Second count register SEC R/W − √ − 00H
FFF93H Minute count register MIN R/W − √ − 00H
− √ −
Note
FFF94H Hour count register HOUR R/W 12H
FFF95H Week count register WEEK R/W − √ − 00H
FFF96H Day count register DAY R/W − √ − 01H
FFF97H Month count register MONTH R/W − √ − 01H
FFF98H Year count register YEAR R/W − √ − 00H
FFF99H Watch error correction register SUBCUD R/W − √ − 00H
FFF9AH Alarm minute register ALARMWM R/W − √ − 00H
FFF9BH Alarm hour register ALARMWH R/W − √ − 12H
FFF9CH Alarm week register ALARMWW R/W − √ − 00H
Note. The value of this register is 00H if the AMPM bit (bit 3 of the RTCC0 register) is set to 1 after reset.
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFF9DH Real-time counter control register 0 RTCC0 R/W √ √ − 00H
FFF9EH Real-time counter control register 1 RTCC1 R/W √ √ − 00H
FFF9FH Real-time counter control register 2 RTCC2 R/W √ √ − 00H
FFFA0H Clock operation mode control register CMC R/W − √ − 00H
FFFA1H Clock operation status control register CSC R/W √ √ − C0H
FFFA2H Oscillation stabilization time counter status register OSTC R √ √ − 00H
FFFA3H Oscillation stabilization time select register OSTS R/W − √ − 07H
FFFA4H Clock control register CKC R/W √ √ − 09H
FFFA5H Clock output select register 0 CKS0 R/W √ √ − 00H
− √ −
Note 1
FFFA8H Reset control flag register RESF R 00H
√ √ −
Note 2
FFFA9H Low-voltage detection register LVIM R/W 00H
√ √ −
Note 3
FFFAAH Low-voltage detection level select register LVIS R/W 0EH
− √ −
Note 4
FFFABH Watchdog timer enable register WDTE R/W 1A/9A
FFFB0H DMA SFR address register 0 DSA0 R/W − √ − 00H
FFFB1H DMA SFR address register 1 DSA1 R/W − √ − 00H
FFFB2H DMA RAM address register 0L DRA0L DRA0 R/W − √ √ 00H
FFFB3H DMA RAM address register 0H DRA0H R/W − √ 00H
FFFB4H DMA RAM address register 1L DRA1L DRA1 R/W − √ √ 00H
FFFB5H DMA RAM address register 1H DRA1H R/W − √ 00H
FFFB6H DMA byte count register 0L DBC0L DBC0 R/W − √ √ 00H
FFFB7H DMA byte count register 0H DBC0H R/W − √ 00H
FFFB8H DMA byte count register 1L DBC1L DBC1 R/W − √ √ 00H
FFFB9H DMA byte count register 1H DBC1H R/W − √ 00H
FFFBAH DMA mode control register 0 DMC0 R/W √ √ − 00H
FFFBBH DMA mode control register 1 DMC1 R/W √ √ − 00H
FFFBCH DMA operation control register 0 DRC0 R/W √ √ − 00H
FFFBDH DMA operation control register 1 DRC1 R/W √ √ − 00H
FFFBEH Back ground event control register BECTL R/W √ √ − 00H
− − − − −
Note 5
FFFC0H PFCMD Undefined
− − − − −
Note 5
FFFC2H PFS Undefined
− − − − −
Note 5
FFFC4H FLPMC Undefined
FFFD0H Interrupt request flag register 2L IF2L IF2 R/W √ √ √ 00H
FFFD1H Interrupt request flag register 2H IF2H R/W √ √ 00H
FFFD4H Interrupt mask flag register 2L MK2L MK2 R/W √ √ √ FFH
FFFD5H Interrupt mask flag register 2H MK2H R/W √ √ FFH
FFFD8H Priority specification flag register 02L PR02L PR02 R/W √ √ √ FFH
FFFD9H Priority specification flag register 02H PR02H R/W √ √ FFH
FFFDCH Priority specification flag register 12L PR12L PR12 R/W √ √ √ FFH
FFFDDH Priority specification flag register 12H PR12H R/W √ √ FFH
Notes 1. The reset value of RESF varies depending on the reset source.
2. The reset value of LVIM varies depending on the reset source and the setting of the option byte.
3. The reset value of LVIS varies depending on the reset source.
4. The reset value of WDTE is determined by the setting of the option byte.
5. Do not directly operate this SFR, because it is to be used in the self programming library.
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFFE0H Interrupt request flag register 0L IF0L IF0 R/W √ √ √ 00H
FFFE1H Interrupt request flag register 0H IF0H R/W √ √ 00H
FFFE2H Interrupt request flag register 1L IF1L IF1 R/W √ √ √ 00H
FFFE3H Interrupt request flag register 1H IF1H R/W √ √ 00H
FFFE4H Interrupt mask flag register 0L MK0L MK0 R/W √ √ √ FFH
FFFE5H Interrupt mask flag register 0H MK0H R/W √ √ FFH
FFFE6H Interrupt mask flag register 1L MK1L MK1 R/W √ √ √ FFH
FFFE7H Interrupt mask flag register 1H MK1H R/W √ √ FFH
FFFE8H Priority specification flag register 00L PR00L PR00 R/W √ √ √ FFH
FFFE9H Priority specification flag register 00H PR00H R/W √ √ FFH
FFFEAH Priority specification flag register 01L PR01L PR01 R/W √ √ √ FFH
FFFEBH Priority specification flag register 01H PR01H R/W √ √ FFH
FFFECH Priority specification flag register 10L PR10L PR10 R/W √ √ √ FFH
FFFEDH Priority specification flag register 10H PR10H R/W √ √ FFH
FFFEEH Priority specification flag register 11L PR11L PR11 R/W √ √ √ FFH
FFFEFH Priority specification flag register 11H PR11H R/W √ √ FFH
FFFF0H Multiplication/division data register A (L) MDAL/MULA R/W − − √ 0000H
FFFF1H
FFFF2H Multiplication/division data register A (H) MDAH/MULB R/W − − √ 0000H
FFFF3H
FFFF4H Multiplication/division data register B (H) MDBH/MULOH R/W − − √ 0000H
FFFF5H
FFFF6H Multiplication/division data register B (L) MDBL/MULOL R/W − − √ 0000H
FFFF7H
FFFFEH Processor mode control register PMC R/W √ √ − 00H
Remark For extended SFRs (2nd SFRs), see Table 3-6 Extended SFR (2nd SFR) List.
3.2.5 Extended special function registers (2nd SFRs: 2nd Special Function Registers)
Unlike a general-purpose register, each extended SFR (2nd SFR) has a special function.
Extended SFRs are allocated to the F0000H to F07FFH area. SFRs other than those in the SFR area (FFF00H to
FFFFFH) are allocated to this area. An instruction that accesses the extended SFR area, however, is 1 byte longer
than an instruction that accesses the SFR area.
Extended SFRs can be manipulated like general-purpose registers, using operation, transfer, and bit manipulation
instructions. The manipulable bit units, 1, 8, and 16, depend on the SFR type.
Each manipulation bit unit can be specified as follows.
• 1-bit manipulation
Describe the symbol reserved by the assembler for the 1-bit manipulation instruction operand (!addr16.bit). This
manipulation can also be specified with an address.
• 8-bit manipulation
Describe the symbol reserved by the assembler for the 8-bit manipulation instruction operand (!addr16). This
manipulation can also be specified with an address.
• 16-bit manipulation
Describe the symbol reserved by the assembler for the 16-bit manipulation instruction operand (!addr16). When
specifying an address, describe an even address.
Table 3-6 gives a list of the extended SFRs. The meanings of items in the table are as follows.
• Symbol
Symbol indicating the address of an extended SFR. It is a reserved word in the RA78K0R, and is defined as an
sfr variable using the #pragma sfr directive in the CC78K0R. When using the RA78K0R, ID78K0R-QB, and
SM+ for 78K0R, symbols can be written as an instruction operand.
• R/W
Indicates whether the corresponding extended SFR can be read or written.
R/W: Read/write enable
R: Read only
W: Write only
• Manipulable bit units
“√” indicates the manipulable bit unit (1, 8, or 16). “−” indicates a bit unit for which manipulation is not possible.
• After reset
Indicates each register status upon reset signal generation.
Caution Do not access addresses to which extended SFRs are not assigned.
Remark For SFRs in the SFR area, see 3.2.4 Special function registers (SFRs).
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F0017H A/D port configuration register ADPC R/W − √ − 10H
F0031H Pull-up resistor option register 1 PU1 R/W √ √ − 00H
F0033H Pull-up resistor option register 3 PU3 R/W √ √ − 00H
F0034H Pull-up resistor option register 4 PU4 R/W √ √ − 00H
F0035H Pull-up resistor option register 5 PU5 R/W √ √ − 00H
F0037H Pull-up resistor option register 7 PU7 R/W √ √ − 00H
F003CH Pull-up resistor option register 12 PU12 R/W √ √ − 00H
F0043H Port input mode register 3 PIM3 R/W √ √ − 00H
F0047H Port input mode register 7 PIM7 R/W √ √ − 00H
F0048H Port input mode register 8 PIM8 R/W √ √ − 00H
F0053H Port output mode register 3 POM3 R/W √ √ − 00H
F0057H Port output mode register 7 POM7 R/W √ √ − 00H
F0060H Noise filter enable register 0 NFEN0 R/W √ √ − 00H
F0061H Noise filter enable register 1 NFEN1 R/W √ √ − 00H
F0062H Noise filter enable register 2 NFEN2 R/W √ √ − 00H
F00E0H Multiplication/division data register C (L) MDCL R − − √ 0000H
F00E2H Multiplication/division data register C (H) MDCH R − − √ 0000H
F00E8H Multiplication/division control register MDUC R/W √ √ − 00H
F00F0H Peripheral enable register 0 PER0 R/W √ √ − 00H
F00F1H Peripheral enable register 1 PER1 R/W √ √ − 00H
F00F2H Peripheral enable register 2 PER2 R/W √ √ − 00H
F00F3H Operation speed mode control register OSMC R/W − √ − 00H
F00F4H Regulator mode control register RMC R/W − √ − 00H
F00F6H Double speed clock control register DSCCTL R/W √ √ − 00H
F00FEH BCD adjust result register BCDADJ R − √ − 00H
F0100H Serial status register 00 SSR00L SSR00 R − √ √ 0000H
F0101H − − −
F0102H Serial status register 01 SSR01L SSR01 R − √ √ 0000H
F0103H − − −
F0104H Serial status register 02 SSR02L SSR02 R − √ √ 0000H
F0105H − − −
F0106H Serial status register 03 SSR03L SSR03 R − √ √ 0000H
F0107H − − −
F0108H Serial flag clear trigger register 00 SIR00L SIR00 R/W − √ √ 0000H
F0109H − − −
F010AH Serial flag clear trigger register 01 SIR01L SIR01 R/W − √ √ 0000H
F010BH − − −
F010CH Serial flag clear trigger register 02 SIR02L SIR02 R/W − √ √ 0000H
F010DH − − −
F010EH Serial flag clear trigger register 03 SIR03L SIR03 R/W − √ √ 0000H
F010FH − − −
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F0110H Serial mode register 00 SMR00 R/W − − √ 0020H
F0111H
F0112H Serial mode register 01 SMR01 R/W − − √ 0020H
F0113H
F0114H Serial mode register 02 SMR02 R/W − − √ 0020H
F0115H
F0116H Serial mode register 03 SMR03 R/W − − √ 0020H
F0117H
F0118H Serial communication operation setting register 00 SCR00 R/W − − √ 0087H
F0119H
F011AH Serial communication operation setting register 01 SCR01 R/W − − √ 0087H
F011BH
F011CH Serial communication operation setting register 02 SCR02 R/W − − √ 0087H
F011DH
F011EH Serial communication operation setting register 03 SCR03 R/W − − √ 0087H
F011FH
F0120H Serial channel enable status register 0 SE0L SE0 R √ √ √ 0000H
F0121H − − −
F0122H Serial channel start trigger register 0 SS0L SS0 R/W √ √ √ 0000H
F0123H − − −
F0124H Serial channel stop trigger register 0 ST0L ST0 R/W √ √ √ 0000H
F0125H − − −
F0126H Serial clock select register 0 SPS0L SPS0 R/W − √ √ 0000H
F0127H − − −
F0128H Serial output register 0 SO0 R/W − − √ 0F0FH
F0129H
F012AH Serial output enable register 0 SOE0L SOE0 R/W √ √ √ 0000H
F012BH − − −
F0134H Serial output level register 0 SOL0L SOL0 R/W − √ √ 0000H
F0135H − − −
F0180H Timer counter register 00 TCR00 R − − √ FFFFH
F0181H
F0182H Timer counter register 01 TCR01 R − − √ FFFFH
F0183H
F0184H Timer counter register 02 TCR02 R − − √ FFFFH
F0185H
F0186H Timer counter register 03 TCR03 R − − √ FFFFH
F0187H
F0188H Timer counter register 04 TCR04 R − − √ FFFFH
F0189H
F018AH Timer counter register 05 TCR05 R − − √ FFFFH
F018BH
F018CH Timer counter register 06 TCR06 R − − √ FFFFH
F018DH
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F018EH Timer counter register 07 TCR07 R − − √ FFFFH
F018FH
F0190H Timer mode register 00 TMR00 R/W − − √ 0000H
F0191H
F0192H Timer mode register 01 TMR01 R/W − − √ 0000H
F0193H
F0194H Timer mode register 02 TMR02 R/W − − √ 0000H
F0195H
F0196H Timer mode register 03 TMR03 R/W − − √ 0000H
F0197H
F0198H Timer mode register 04 TMR04 R/W − − √ 0000H
F0199H
F019AH Timer mode register 05 TMR05 R/W − − √ 0000H
F019BH
F019CH Timer mode register 06 TMR06 R/W − − √ 0000H
F019DH
F019EH Timer mode register 07 TMR07 R/W − − √ 0000H
F019FH
F01A0H Timer status register 00 TSR00 R − − √ 0000H
F01A1H
F01A2H Timer status register 01 TSR01 R − − √ 0000H
F01A3H
F01A4H Timer status register 02 TSR02 R − − √ 0000H
F01A5H
F01A6H Timer status register 03 TSR03 R − − √ 0000H
F01A7H
F01A8H Timer status register 04 TSR04 R − − √ 0000H
F01A9H
F01AAH Timer status register 05 TSR05 R − − √ 0000H
F01ABH
F01ACH Timer status register 06 TSR06 R − − √ 0000H
F01ADH
F01AEH Timer status register 07 TSR07 R − − √ 0000H
F01AFH
F01B0H Timer channel enable status register 0 TE0 R − − √ 0000H
F01B1H
F01B2H Timer channel start trigger register 0 TS0 R/W − − √ 0000H
F01B3H
F01B4H Timer channel stop trigger register 0 TT0 R/W − − √ 0000H
F01B5H
F01B6H Timer clock select register 0 TPS0 R/W − − √ 0000H
F01B7H
F01B8H Timer channel output register 0 TO0 R/W − − √ 0000H
F01B9H
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F01BAH Timer channel output enable register 0 TOE0 R/W − − √ 0000H
F01BBH
F01BCH Timer channel output level register 0 TOL0 R/W − − √ 0000H
F01BDH
F01BEH Timer channel output mode register 0 TOM0 R/W − − √ 0000H
F01BFH
F01C0H Timer counter register 08 TCR08 R − − √ FFFFH
F01C1H
F01C2H Timer counter register 09 TCR09 R − − √ FFFFH
F01C3H
F01C4H Timer counter register 10 TCR10 R − − √ FFFFH
F01C5H
F01C6H Timer counter register 11 TCR11 R − − √ FFFFH
F01C7H
F01C8H Timer mode register 08 TMR08 R/W − − √ 0000H
F01C9H
F01CAH Timer mode register 09 TMR09 R/W − − √ 0000H
F01CBH
F01CCH Timer mode register 10 TMR10 R/W − − √ 0000H
F01CDH
F01CEH Timer mode register 11 TMR11 R/W − − √ 0000H
F01CFH
F01D0H Timer status register 08 TSR08 R − − √ 0000H
F01D1H
F01D2H Timer status register 09 TSR09 R − − √ 0000H
F01D3H
F01D4H Timer status register 10 TSR10 R − − √ 0000H
F01D5H
F01D6H Timer status register 11 TSR11 R − − √ 0000H
F01D7H
F01E8H Timer triangle wave output mode register 0 TOT0 R/W − − √ 0000H
F01EAH Timer real-time output enable register 0 TRE0 R/W − − √ 0000H
F01ECH Timer real-time output register 0 TRO0 R/W − − √ 0000H
F01EEH Timer real-time control register 0 TRC0 R/W − − √ 0000H
F01F0H Timer modulation output enable register 0 TME0 R/W − − √ 0000H
F01F2H Timer dead-time output enable register 0 TDE0 R/W − − √ 0000H
F0220H TAU option mode register OPMR R/W − − √ 0000H
F0222H TAU option status register OPSR R − − √ 0000H
F0224H TAU option Hi-Z start trigger register OPHS R/W − − √ 0000H
F0226H TAU option Hi-Z stop trigger register OPHT R/W − − √ 0000H
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F0234H Slave address register SVA R/W − √ − 00H
F0240H Operational amplifier control register OAM R/W √ √ − 00H
F0241H Comparator 0 control register C0CTL R/W √ √ − 00H
F0242H Comparator 0 internal reference voltage setting C0RVM R/W √ √ − 00H
register
F0243H Comparator 1 control register C1CTL R/W √ √ − 00H
F0244H Comparator 1 internal reference voltage setting C1RVM R/W √ √ − 00H
register
Remark For SFRs in the SFR area, see Table 3-5 SFR List.
[Function]
Relative addressing stores in the program counter (PC) the result of adding a displacement value included in the
instruction word (signed complement data: −128 to +127 or −32768 to +32767) to the program counter (PC)’s
value (the start address of the next instruction), and specifies the program address to be used as the branch
destination. Relative addressing is applied only to branch instructions.
PC
OP code
[Function]
Immediate addressing stores immediate data of the instruction word in the program counter, and specifies the
program address to be used as the branch destination.
For immediate addressing, CALL !!addr20 or BR !!addr20 is used to specify 20-bit addresses and CALL !addr16
or BR !addr16 is used to specify 16-bit addresses. 0000 is set to the higher 4 bits when specifying 16-bit
addresses.
PC
OP code
Low Addr.
High Addr.
Seg Addr.
Low Addr.
0000
High Addr.
[Function]
Table indirect addressing specifies a table address in the CALLT table area (0080H to 00BFH) with the 5-bit
immediate data in the instruction word, stores the contents at that table address and the next address in the
program counter (PC) as 16-bit data, and specifies the program address. Table indirect addressing is applied
only for CALLT instructions.
In the 78K0R microcontrollers, branching is enabled only to the 64 KB space from 00000H to 0FFFFH.
OP code
Low Addr.
00000000 10 0
High Addr.
Table address
Memory
0000
[Function]
Register direct addressing stores in the program counter (PC) the contents of a general-purpose register pair
(AX/BC/DE/HL) and CS register of the current register bank specified with the instruction word as 20-bit data,
and specifies the program address. Register direct addressing can be applied only to the CALL AX, BC, DE, HL,
and BR AX instructions.
OP code
CS rp
[Function]
Instructions for accessing registers (such as accumulators) that have special functions are directly specified with
the instruction word, without using any register specification field in the instruction word.
[Operand format]
Because implied addressing can be automatically employed with an instruction, no particular operand format
is necessary.
Implied addressing can be applied only to MULU X.
OP code A register
Memory
[Function]
Register addressing accesses a general-purpose register as an operand. The instruction word of 3-bit long is
used to select an 8-bit register and the instruction word of 2-bit long is used to select a 16-bit register.
[Operand format]
Identifier Description
r X, A, C, B, E, D, L, H
OP code Register
Memory
[Function]
Direct addressing uses immediate data in the instruction word as an operand address to directly specify the
target address.
[Operand format]
Identifier Description
ADDR16 Label or 16-bit immediate data (only the space from F0000H to FFFFFH is specifiable)
ES: ADDR16 Label or 16-bit immediate data (higher 4-bit addresses are specified by the ES register)
FFFFFH
OP code
Low Addr.
Target memory
High Addr.
F0000H
Memory
FFFFFH
ES
OP code
Low Addr.
Target memory
High Addr.
00000H
Memory
[Function]
Short direct addressing directly specifies the target addresses using 8-bit data in the instruction word. This type
of addressing is applied only to the space from FFE20H to FFF1FH.
[Operand format]
Identifier Description
SADDR Label, FFE20H to FFF1FH immediate data, or 0FE20H to 0FF1FH immediate data
SADDRP Label, FFE20H to FFF1FH immediate data, or 0FE20H to 0FF1FH immediate data (even address only)
(only the space from FFE20H to FFF1FH is specifiable)
OP code
FFF1FH
saddr saddr
FFE20H
Memory
Remark SADDR and SADDRP are used to describe the values of addresses FE20H to FF1FH with 16-bit
immediate data (higher 4 bits of actual address are omitted), and the values of addresses FFE20H to
FFF1FH with 20-bit immediate data.
Regardless of whether SADDR or SADDRP is used, addresses within the space from FFE20H to
FFF1FH are specified for the memory.
[Function]
SFR addressing directly specifies the target SFR addresses using 8-bit data in the instruction word. This type of
addressing is applied only to the space from FFF00H to FFFFFH.
[Operand format]
Identifier Description
FFFFFH
OP code SFR
FFF00H
SFR
Memory
[Function]
Register indirect addressing directly specifies the target addresses using the contents of the register pair
specified with the instruction word as an operand address.
[Operand format]
Identifier Description
FFFFFH
F0000H
Memory
FFFFFH
ES
00000H
Memory
[Function]
Based addressing uses the contents of a register pair specified with the instruction word as a base address, and
8-bit immediate data or 16-bit immediate data as offset data. The sum of these values is used to specify the
target address.
[Operand format]
Identifier Description
− [HL + byte], [DE + byte], [SP + byte] (only the space from F0000H to FFFFFH is specifiable)
− ES:[HL + byte], ES:[DE + byte] (higher 4-bit addresses are specified by the ES register)
FFFFFH
SP Target memory
F0000H
OP code
byte
Memory
FFFFFH
F0000H
OP code
byte
Memory
FFFFFH
F0000H
OP code
Low Addr.
High Addr.
Memory
FFFFFH
F0000H
OP code
Low Addr.
High Addr.
Memory
FFFFFH
ES
OP code
00000H
byte
Memory
FFFFFH
ES
OP code
00000H
Low Addr.
Memory
High Addr.
FFFFFH
ES
OP code
00000H
Low Addr.
Memory
High Addr.
[Function]
Based indexed addressing uses the contents of a register pair specified with the instruction word as the base
address, and the content of the B register or C register similarly specified with the instruction word as offset
address. The sum of these values is used to specify the target address.
[Operand format]
Identifier Description
FFFFFH
OP code
F0000H
r (B/C)
Memory
FFFFFH
OP code
ES
00000H
r (B/C) Memory
[Function]
The stack area is indirectly addressed with the stack pointer (SP) contents. This addressing is automatically
employed when the PUSH, POP, subroutine call, and return instructions are executed or the register is
saved/restored upon generation of an interrupt request.
Stack addressing is applied only to the internal RAM area.
[Operand format]
Identifier Description
− PUSH AX/BC/DE/HL
POP AX/BC/DE/HL
CALL/CALLT
RET
BRK
RETB
(Interrupt request generated)
RETI
There are two types of pin I/O buffer power supplies: AVREF and VDD. The relationship between these power
supplies and the pins is shown below.
μPD79F9211 products are provided with the ports shown in Figures 4-1, which enable variety of control operations.
The functions of each port are shown in Table 4-2.
In addition to the function as digital I/O ports, these ports have several alternate functions. For details of the
alternate functions, see CHAPTER 2 PIN FUNCTIONS.
P70 P10
Port 1
Port 7 P13
P20
P75
P80
Port 2
Port 8
P83
P27
P120
P30
Port 12 Port 3
P32
P124
P40
Port 4
P41
Note
P40 I/O Port 4. Input port TOOL0
2-bit I/O port.
Input/output can be specified in 1-bit units.
P41 TOOL1
Use of an on-chip pull-up resistor can be specified by a software
setting.
P50 I/O Port 5. Input port TI06/TO06
3-bit I/O port.
P51 Input port TI07/TO07
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a software
P52 Input port SLTI/SLTO
setting.
P70 I/O Port 7. Input port SO01/INTP4
6-bit I/O port.
P71 SI01/INTP5
Input of P71, P72, P74, and P75 can be set to TTL buffer.
P72 Output of P70, P72, P73, and P75 can be set to N-ch open- SCK01/INTP6
Note If on-chip debugging is enabled by using an option byte, be sure to pull up the P40/TOOL0 pin externally
(see Caution in 2.2.4 P40, P41 (port 4)).
P124 XT2
Item Configuration
Control registers Port mode registers (PM1 to PM5, PM7, PM8, PM12, PM15)
Port registers (P1 to P5, P7, P8, P12, P15)
Pull-up resistor option registers (PU1, PU3 to PU5, PU7, PU12)
Port input mode registers (PIM3, PIM7, PIM8)
Port output mode registers (POM3, POM7)
A/D port configuration register (ADPC)
Port Total: 37 (CMOS I/O: 33, CMOS input: 4)
Pull-up resistor Total: 19
4.2.1 Port 1
Port 1 is a 4-bit I/O port with an output latch. Port 1 can be set to the input mode or output mode in 1-bit units
using port mode register 1 (PM1). When the P10 to P13 pins are used as an input port, use of an on-chip pull-up
resistor can be specified in 1-bit units by pull-up resistor option register 1 (PU1).
This port can also be used for timer I/O.
Reset signal generation sets port 1 to input mode.
Figure 4-2 shows a block diagram of port 1.
VDD
WRPU
PU1
PU10 to PU13
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P1
Output latch
(P10 to P13) P10/TI02/TO02,
P11/TI03/TO03,
WRPM P12/TI04/TO04,
PM1 P13/TI05/TO05
PM10 to PM13
Alternate
function
4.2.2 Port 2
Port 2 is a 8-bit I/O port with an output latch. Port 2 can be set to the input mode or output mode in 1-bit units
using port mode register 2 (PM2).
This port can also be used for A/D converter analog input.
To use P20/ANI0 to P27/ANI7 as digital input pins, set them in the digital I/O mode by using the A/D port
configuration register (ADPC) and in the input mode by using PM2. Use these pins starting from the lower bit.
To use P20/ANI0 to P27/ANI7 as digital output pins, set them in the digital I/O mode by using ADPC and in the
output mode by using PM2.
To use P20/ANI0 to P27/ANI7 as analog input pins, set them in the analog input mode by using the A/D port
configuration register (ADPC) and in the input mode by using PM2. Use these pins starting from the upper bit.
All P20/ANI0 to P27/ANI7 are set in the digital input mode when the reset signal is generated.
Figure 4-3 shows a block diagram of port 2.
Caution Make the AVREF pin the same potential as the VDD pin when port 2 is used as a digital port.
RD
Selector
Internal bus
WRPORT
P2
Output latch
(P20 to P27) P20/ANI0 to
P27/ANI7
WRPM
PM2
PM20 to PM27
A/D converter
4.2.3 Port 3
Port 3 is a 3-bit I/O port with an output latch. Port 3 can be set to the input mode or output mode in 1-bit units
using port mode register 3 (PM3). When the P30 to P32 pins are used as an input port, use of an on-chip pull-up
resistor can be specified in 1-bit units by pull-up resistor option register 3 (PU3).
Input to the P31 and P32 pins can be specified through a normal input buffer or a TTL input buffer in 1-bit units
using port input mode register 3 (PIM3).
Output from the P30 to P32 pins can be specified as N-ch open-drain output (VDD tolerance) in 1-bit units using
port output mode register 3 (POM3).
This port can also be used for serial interface data I/O, clock I/O, external interrupt request input, and timer I/O.
Reset signal generation sets port 3 to input mode.
Figures 4-6 and 4-7 show block diagrams of port 3.
VDD
WRPU
PU3
PU30
P-ch
RD
Selector
WRPORT
Internal bus
P3
Output latch
(P30) P30/SO10/TxD1/TO11
WRPOM
POM3
POM30
WRPM
PM3
PM30
Alternate
function
Alternate
function
WRPIM
PIM3
PU31, PU32
P-ch
Alternate
function
CMOS
RD
Selector
Internal bus
TTL
WRPORT
P3
Output latch
(P31, P32) P31/SI10/RxD1/SDA10/INTP1/TI09,
P32/SCK10/SCL10/INTP2
WRPOM
POM3
POM31, POM32
WRPM
PM3
PM31, PM32
Alternate
function
4.2.4 Port 4
Port 4 is a 2-bit I/O port with an output latch. Port 4 can be set to the input mode or output mode in 1-bit units
using port mode register 4 (PM4). When the P40 and P41 pins are used as an input port, use of an on-chip pull-up
Note
resistor can be specified in 1-bit units by pull-up resistor option register 4 (PU4) .
This port can also be used for flash memory programmer/debugger data I/O and clock output.
Reset signal generation sets port 4 to input mode.
Figure 4-6 shows a block diagram of port 4.
Note When a tool is connected, the P40 and P41 pins cannot be connected to a pull-up resistor.
Caution When a tool is connected, the P40 pin cannot be used as a port pin.
When the on-chip debug function is used, P41 pin can be used as follows by the mode setting on
the debugger.
VDD
WRPU
PU4
PU40, PU41
P-ch
Alternate
function
RD
Internal bus
Selector
WRPORT
P4
Output latch
Selector
(P40, P41)
P40/TOOL0,
WRPM P41/TOOL1
PM4
PM40, PM41
Alternate
function
4.2.5 Port 5
Port 5 is a 3-bit I/O port with an output latch. Port 5 can be set to the input mode or output mode in 1-bit units
using port mode register 5 (PM5). When the P50 to P52 pins are used as an input port, use of an on-chip pull-up
resistor can be specified in 1-bit units by pull-up resistor option register 5 (PU5).
This port can also be used for timer I/O.
Reset signal generation sets port 5 to input mode.
Figures 4-9 and 4-10 show a block diagrams of port 5.
Cautions 1. To use P50/TI06/TO06 or P51/TI07/TO07 as a general-purpose port, set bits 6 and 7 (TO06,
TO07) of timer output register 0 (TO0) and bits 6 and 7 (TOE06, TOE07) of timer output
enable register 0 (TOE0) to “0”, which is the same as their default status setting.
2. To use P52/SLTI/SLTO as a general-purpose port, check which timer I/O pin of which channel
n is selected in the input switching control register (ISC) setting. Also, set bit n (TO0n) of
timer output register 0 (TO0) and bit n (TOE0n) of timer output enable register 0 (TOE0) to
“0”, which is the same setting as in the initial state of each.
VDD
WRPU
PU5
PU50, PU51
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P5
Output latch
(P50, P51) P50/TI06/TO06,
P51/TI07/TO07
WRPM
PM5
PM50, PM51
Alternate
function
VDD
WRPU
PU5
PU52
P-ch
Channel 0 of TAUS
Channel 1 of TAUS
ISC4, ISC3, ISC2
Channel 8 of TAUS
Channel 9 of TAUS
Channel 10 of TAUS
Selector
Channel 11 of TAUS
RD
Internal bus
Selector
ISC
WRPORT ISC4, ISC3, ISC2
P5
Output latch
P52/SLTI/SLTO
(P52)
Selector
WRPM
PM5
PM52
Channel 0 of TAUS
Channel 1 of TAUS
Channel 8 of TAUS
Channel 9 of TAUS
Channel 10 of TAUS
Channel 11 of TAUS
4.2.6 Port 7
Port 7 is a 6-bit I/O port with an output latch. Port 7 can be set to the input mode or output mode in 1-bit units
using port mode register 7 (PM7). When the P70 and P75 pins are used as an input port, use of an on-chip pull-up
resistor can be specified in 1-bit units by pull-up resistor option register 7 (PU7).
Input to the P71, P72, P74, and P75 pins can be specified through a normal input buffer or a TTL input buffer in 1-
bit units using port input mode register 7 (PIM7).
Output from the P70, P72, P73, and P75 pins can be specified as N-ch open-drain output (VDD tolerance) in 1-bit
units using port output mode register 7 (POM7).
This port can also be used for serial interface data I/O, clock I/O, external interrupt request input, and timer I/O.
Reset signal generation sets port 7 to input mode.
Figures 4-14 to 4-17 show block diagrams of port 7.
VDD
WRPU
PU7
PU70
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P7
Output latch
(P70) P70/SO01/INTP4
WRPOM
POM7
POM70
WRPM
PM7
PM70
Alternate
function
WRPIM
PIM7
PU71, PU74
P-ch
Alternate
Internal bus
function
CMOS
RD
Selector
TTL
WRPORT
P7
Output latch
(P71, P74) P71/SI01/INTP5,
P74/SI00/RxD0/TI10
WRPM
PM7
PM71, PM74
WRPIM
PIM7
PU72, PU75
P-ch
Alternate
function
CMOS
RD
Internal bus
Selector
TTL
WRPORT
P7
Output latch
(P72, P75) P72/SCK01/INTP6,
P75/SCK00/TI11
WRPOM
POM7
POM72, POM75
WRPM
PM7
PM72, PM75
Alternate
function
VDD
WRPU
PU7
PU73
P-ch
RD
WRPORT Selector
P7
Internal bus
Output latch
(P73) P73/SO00/TxD0/TO10
WRPOM
POM7
POM73
WRPM
PM7
PM73
Alternate
function
Alternate
function
4.2.7 Port 8
Port 8 is a 4-bit I/O port with an output latch. Port 8 can be set to the input mode or output mode in 1-bit units
using port mode register 8 (PM8).
Inputs to the P80 to P83 pins must be enabled or disabled in 1-bit units using port input mode register 8 (PIM8).
This port can also be used for an input voltage on the side of comparators 0 and 1 (+), an input voltage on the
sides of comparators 0 and 1 (−), a timer pin Hi-Z control input, an external interrupt request input, and an operational
amplifier input.
Reset signal generation sets port 8 to input mode.
Figures 4-18 to 4-20 show block diagrams of port 8.
Alternate
function
RD Selector
Internal bus
WRPORT
P8
Output latch
(P80) P80/CMP0P/TMOFF0/INTP3/OAI
WRPM
PM8
PM80
Comparator,
Operational amplifier
RD
Selector
Internal bus
WRPORT
P8
Output latch
(P81, P83) P81/CMP0M,
P83/CMP1M
WRPM
PM8
PM81, PM83
Comparator
Alternate
function
RD
Selector
Internal bus
WRPORT
P8
Output latch
(P82) P82/CMP1P/TMOFF1/INTP7
WRPM
PM8
PM82
Comparator
4.2.8 Port 12
P120 is a 1-bit I/O port with an output latch. Port 12 can be set to the input mode or output mode in 1-bit units
using port mode register 12 (PM12). When used as an input port, use of an on-chip pull-up resistor can be specified
by pull-up resistor option register 12 (PU12).
P121 to P124 are 4-bit input ports.
This port can also be used for external interrupt request input, potential input for external low-voltage detection,
connecting resonator for main system clock, connecting resonator for subsystem clock, and external clock input for
main system clock.
Reset signal generation sets port 12 to input mode.
Figures 4-21 and 4-24 show block diagrams of port 12.
Caution The function setting on P121 to P124 is available only once after the reset release. The port once
set for connection to an oscillator cannot be used as an input port unless the reset is performed.
VDD
WRPU
PU12
PU120
P-ch
Alternate
function
RD
Internal bus
Selector
WRPORT
P12
Output latch
(P120) P120/INTP0/EXLVI
WRPM
PM12
PM120
CMC
OSCSEL
RD
P122/X2/EXCLK
Internal bus
CMC
EXCLK, OSCSEL
RD
P121/X1
CMC
OSCSELS
RD
P124/XT2
Internal bus
CMC
OSCSELS
RD
P123/XT1
4.2.9 Port 15
Port 15 is an 2-bit I/O port with an output latch. Port 15 can be set to the input mode or output mode in 1-bit units
using port mode register 15 (PM15).
This port can also be used for A/D converter analog input.
To use P150/ANI8 and P151/ANI9 as digital input pins, set them in the digital I/O mode by using the A/D port
configuration register (ADPC) and in the input mode by using PM15. Use these pins starting from the lower bit.
To use P150/ANI8 and P151/ANI9 as digital output pins, set them in the digital I/O mode by using ADPC and in the
output mode by using PM15.
All P150/ANI8 and P151/ANI9 are set in the digital input mode when the reset signal is generated.
Figure 4-19 shows block diagram of port 15.
Caution Make the AVREF0 pin the same potential as the VDD pin when port 15 is used as a digital port.
RD
Selector
Internal bus
WRPORT
P15
Output latch
(P150, P151) P150/ANI8, P151/ANI9
WRPM
PM15
PM150, PM151
A/D converter
PM2 PM27 PM26 PM25 PM24 PM23 PM22 PM21 PM20 FFF22H FFH R/W
PM7 1 1 PM75 PM74 PM73 PM72 PM71 PM70 FFF27H FFH R/W
Note It is always 0 and never a pin level that is read out if a port is read during the input mode when P2 and P15 are
set to function as an analog input for a A/D converter.
P2 P27 P26 P25 P24 P23 P22 P21 P20 FFF02H 00H (output latch) R/W
P7 0 0 P75 P74 P73 P72 P71 P70 FFF07H 00H (output latch) R/W
Note
P12 0 0 0 P124 P123 P122 P121 P120 FFF0CH Undefined R/W
Output data control (in output mode) Input data read (in input mode)
(3) Pull-up resistor option registers (PU1, PU3 to PU5, PU7, PU12)
These registers specify whether the on-chip pull-up resistors of P10 to P13, P30 to P32, P40, P41, P50 to P52,
P70 to P75, or P120 are to be used or not. On-chip pull-up resistors can be used in 1-bit units only for the bits set
to input mode of the pins to which the use of an on-chip pull-up resistor has been specified in PU1, PU3 to PU5,
PU7, and PU12. On-chip pull-up resistors cannot be connected to bits set to output mode and bits used as
alternate-function output pins, regardless of the settings of PU1, PU3 to PU5, PU7, and PU12.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
PU7 0 0 PU75 PU74 PU73 PU72 PU71 PU70 F0037H 00H R/W
0 Disables input
1 Enables input
ADP ADP ADP ADP ADP Analog input (A)/digital I/O (D) switching
C4 C3 C2 C1 C0 Port 5 Port 2
ANI9 ANI8 ANI7 ANI6 ANI5 ANI4 ANI3 ANI2 ANI1 ANI0
/P151 /P150 /P27 /P26 /P25 /P24 /P23 /P22 /P21 /P20
0 0 0 0 0 A A A A A A A A A A
0 0 0 0 1 A A A A A A A A A D
0 0 0 1 0 A A A A A A A A D D
0 0 0 1 1 A A A A A A A D D D
0 0 1 0 0 A A A A A A D D D D
0 0 1 0 1 A A A A A D D D D D
0 0 1 1 0 A A A A D D D D D D
0 0 1 1 1 A A A D D D D D D D
0 1 0 0 0 A A D D D D D D D D
0 1 0 0 1 A D D D D D D D D D
1 0 0 0 0 D D D D D D D D D D
Other than the above Setting prohibited
Cautions 1. Set a channel to be used for A/D conversion in the input mode by using port mode register 2
and 15 (PM2, PM15).
2. Do not set the pin that is set by ADPC as digital I/O by analog input channel specification
register (ADS).
Port operations differ depending on whether the input or output mode is set, as shown below.
(1) Setting procedure when using I/O pins of UART0, UART1 CSI00, CSI01, and CSI10 functions
<3> Set the corresponding bit of the PIMn register to 1 to switch to the TTL input buffer.
<4> VIH/VIL operates on a 2.5V or 3 V operating voltage.
Remark n = 3 and 7
Remark n = 3 and 7
(2) Setting procedure when using I/O pins of simplified IIC10 functions
<1> After reset release, the port mode is the input mode (Hi-Z).
<2> Externally pull up the pin to be used (on-chip pull-up resistor cannot be used).
4.5 Settings of Port Mode Register and Output Latch When Using Alternate Function
To use the alternate function of a port pin, set the port mode register and output latch as shown in Table 4-6.
Table 4-6. Settings of Port Mode Register and Output Latch When Using Alternate Function (1/2)
Table 4-6. Settings of Port Mode Register and Output Latch When Using Alternate Function (2/2)
Note. The function of the ANI0/P20 to ANI7/P27, ANI8/P150 to ANI9/P151, and OAI/P80 pins can be selected
by using the A/D port configuration register (ADPC), the analog input channel specification register
(ADS), PM2, PM15, and PM8.
Table 4-7. Setting Functions of ANI0/P20 to ANI7/P27, ANI8/P150 to ANI9/P151, and OAI/P80 Pins
When a 1-bit manipulation instruction is executed on a port that provides both input and output functions, the
output latch value of an input port that is not subject to manipulation may be written in addition to the targeted bit.
Therefore, it is recommended to rewrite the output latch when switching a port from input mode to output mode.
<Example> When P10 is an output port, P11 to P13 are input ports (all pin statuses are high level), and the port
latch value of port 1 is 00H, if the output of output port P10 is changed from low level to high level
via a 1-bit manipulation instruction, the output latch value of port 1 is 0FH.
Explanation: The targets of writing to and reading from the Pn register of a port whose PMnm bit is 1 are the
output latch and pin status, respectively.
A 1-bit manipulation instruction is executed in the following order in the μPD79F9211.
In step <1>, the output latch value (0) of P10, which is an output port, is read, while the pin statuses
of P11 to P13, which are input ports, are read. If the pin statuses of P11 to P13 are high level at
this time, the read value is 0EH.
The value is changed to 0FH by the manipulation in <2>.
0FH is written to the output latch by the manipulation in <3>.
1-bit manipulation
P10 instruction P10
Low-level output (set1 P1.0) High-level output
is executed for P10
bit.
P11 to P13 P11 to P13
Pin status: High-level Pin status: High-level
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
The clock generator generates the clock to be supplied to the CPU and peripheral hardware.
The following three kinds of system clocks and clock oscillators are selectable.
An external main system clock (fEX = 2 to 20 MHz) can also be supplied from the EXCLK/X2/P122 pin. An
external main system clock input can be disabled by executing the STOP instruction or setting of MSTOP.
As the main system clock, a high-speed system clock (X1 clock or external main system clock) or internal high-
speed oscillation clock can be selected by setting of MCM0 (bit 4 of the system clock control register (CKC)).
Furthermore, the double-speed mode internal high-speed oscillation clock can be selected by setting SELDSC
(bit 2 of the double-speed operation control register (DSCCTL)).
Item Configuration
Control registers Clock operation mode control register (CMC)
Clock operation status control register (CSC)
Oscillation stabilization time counter status register (OSTC)
Oscillation stabilization time select register (OSTS)
System clock control register (CKC)
Double-speed operation control register (DSCCTL)
Peripheral enable registers 0, 1, 2 (PER0, PER1, PER2)
Operation speed mode control register (OSMC)
Oscillators X1 oscillator
XT1 oscillator
Internal high-speed oscillator
Internal low-speed oscillator
126
Internal bus
MD MD MD TAU0 TAUOP
AMPH EXCLK OSCSEL MSTOP OSTS2 OSTS1 OSTS0 CLS CSS MCS MCM0 1
IV2 IV1 IV0 EN EN
3
X1 oscillation 4
STOP stabilization time counter
Selector
high-speed source
oscillator fMAIN/2
(40 MHz (TYP.))
fMAIN
Prescaler
fSUB/2 fCLK CPU
Internal
low-speed fIL
Selector
Prescaler
fSUB
Real-time counter, comparator
Crystal
Real-time counter
CHAPTER 5 CLOCK GENERATOR
CLS
Internal bus
CHAPTER 5 CLOCK GENERATOR
The following eight registers are used to control the clock generator.
OSCSELS Subsystem clock pin operation mode XT1/P123 pin XT2/P124 pin
0 Input port mode Input port
1 XT1 oscillation mode Crystal resonator connection
Cautions 1. CMC can be written only once after reset release, by an 8-bit memory
manipulation instruction.
2. After reset release, set CMC before X1 or XT1 oscillation is started as set by the
clock operation status control register (CSC).
3. Be sure to set AMPH to 1 if the X1 clock oscillation frequency exceeds 10 MHz.
4. It is recommended to set the default value (00H) to CMC after reset release, even
when the register is used at the default value, in order to prevent malfunctioning
during a program loop.
Cautions 1. After reset release, set the clock operation mode control register (CMC) before
starting X1 oscillation as set by MSTOP or XT1 oscillation as set by XTSTOP.
2. To start X1 oscillation as set by MSTOP, check the oscillation stabilization time
of the X1 clock by using the oscillation stabilization time counter status register
(OSTC).
3. Do not stop the clock selected for the CPU peripheral hardware clock (fCLK) with
the OSC register.
Caution 4. The setting of the flags of the register to stop clock oscillation (invalidate the
external clock input) and the condition before clock oscillation is to be stopped
are as follows.
Table 5-2. Condition Before Stopping Clock Oscillation and Flag Setting
• If the X1 clock starts oscillation while the internal high-speed oscillation clock or subsystem clock is being
used as the CPU clock.
• If the STOP mode is entered and then released while the internal high-speed oscillation clock is being used
as the CPU clock with the X1 clock oscillating.
Remark The oscillation stabilization time counter starts counting in the following cases.
• When oscillation of the X1 clock starts (EXCLK, OSCSEL = 0, 1 → MSTOP = 0)
• When the STOP mode is released
Figure 5-4. Format of Oscillation Stabilization Time Counter Status Register (OSTC)
Symbol 7 6 5 4 3 2 1 0
OSTC MOST MOST MOST MOST MOST MOST MOST MOST
8 9 10 11 13 15 17 18
MOST MOST MOST MOST MOST MOST MOST MOST Oscillation stabilization time status
8 9 10 11 13 15 17 18 fX = 10 MHz fX = 20 MHz
2 /fX max. 25.6 μs max. 12.8 μs max.
8
0 0 0 0 0 0 0 0
25.6 μs min. 12.8 μs min.
8
1 0 0 0 0 0 0 0 2 /fX min.
51.2 μs min. 25.6 μs min.
9
1 1 0 0 0 0 0 0 2 /fX min.
2 /fX min. 102.4 μs min. 51.2 μs min.
10
1 1 1 0 0 0 0 0
2 /fX min. 204.8 μs min. 102.4 μs min.
11
1 1 1 1 0 0 0 0
2 /fX min. 819.2 μs min. 409.6 μs min.
13
1 1 1 1 1 0 0 0
15
1 1 1 1 1 1 0 0 2 /fX min. 3.27 ms min. 1.64 ms min.
17
1 1 1 1 1 1 1 0 2 /fX min. 13.11 ms min. 6.55 ms min.
18
1 1 1 1 1 1 1 1 2 /fX min. 26.21 ms min. 13.11 ms min.
Cautions 1. After the above time has elapsed, the bits are set to 1 in order from MOST8 and
remain 1.
2. The oscillation stabilization time counter counts up to the oscillation
stabilization time set by OSTS.
In the following cases, set the oscillation stabilization time of OSTS to the value
greater than the count value which is to be checked by the OSTC register after
the oscillation starts.
• If the X1 clock starts oscillation while the internal high-speed oscillation clock
or subsystem clock is being used as the CPU clock.
• If the STOP mode is entered and then released while the internal high-speed
oscillation clock is being used as the CPU clock with the X1 clock oscillating.
(Note, therefore, that only the status up to the oscillation stabilization time set
by OSTS is set to OSTC after the STOP mode is released.)
3. The X1 clock oscillation stabilization wait time does not include the time until
clock oscillation starts (“a” below).
X1 pin voltage
waveform
Cautions 1. To set the STOP mode when the X1 clock is used as the CPU clock, set the
OSTS register before executing the STOP instruction.
2. Setting the oscillation stabilization time to 20 μs or less is prohibited.
3. To change the setting of the OSTS register, be sure to confirm that the counting
operation of the OSTC register has been completed.
4. Do not change the value of the OSTS register during the X1 clock oscillation
stabilization time.
5. The oscillation stabilization time counter counts up to the oscillation
stabilization time set by OSTS.
In the following cases, set the oscillation stabilization time of OSTS to the value
greater than the count value which is to be checked by the OSTC register after
the oscillation starts.
• If the X1 clock starts oscillation while the internal high-speed oscillation clock
or subsystem clock is being used as the CPU clock.
• If the STOP mode is entered and then released while the internal high-speed
oscillation clock is being used as the CPU clock with the X1 clock oscillating.
(Note, therefore, that only the status up to the oscillation stabilization time set
by OSTS is set to OSTC after the STOP mode is released.)
6. The X1 clock oscillation stabilization wait time does not include the time until
clock oscillation starts (“a” below).
X1 pin voltage
waveform
Note 1
Address: FFFA4H After reset: 09H R/W
Symbol <7> <6> <5> <4> 3 2 1 0
0 0 0 0 0 fIH
0 0 1 fIH/2 (default)
2
0 1 0 fIH/2
3
0 1 1 fIH/2
4
1 0 0 fIH/2
5
1 0 1 fIH/2
0 1 0 0 0 fMX
0 0 1 fMX/2
2
0 1 0 fMX/2
3
0 1 1 fMX/2
4
1 0 0 fMX/2
5 Note 2
1 0 1 fMX/2
× × × ×
Note 3 Note 3
1 fSUB/2
Other than above Setting prohibited
The fastest instruction can be executed in 1 clock of the CPU clock in the μPD79F9211. Therefore, the
relationship between the CPU clock (fCLK) and the minimum instruction execution time is as shown in Table 5-3.
Table 5-3. Relationship Between CPU Clock and Minimum Instruction Execution Time
Note
Address: F00F6H After reset: 00H R/W
Symbol 7 6 5 4 3 2 1 0
SELDSC Selection of whether to use DSC output for the CPU/peripheral hardware clock (fCLK)
0 Supplies the clock selected by the CKC register (clock through mode).
1 Supplies the double-speed mode internal high-speed oscillation clock (fDSC) (DSC mode).
The bits related to the selection of the CPU/peripheral hardware clock (fCLK) are shown below.
Table 5-4. Relationship Between CPU/Peripheral Hardware Clock (fCLK) and Bit Settings
High-Speed System Internal High-Speed Double-Speed Mode Internal Clock (fSUB) Clock (fCLK)
Notes 1. Changing the MCM0 bit value while CSS is set to 1 is prohibited.
2. The supply of a clock of 20 MHz or more is disabled, because a clock supplied to a CPU or peripheral
hardware that does not support the double-speed mode is halved (fCLK/2) by setting DSPO (bit 1 of the
DSCCTL register) to 1.
PER1 0 0 0 0 OACMPEN 0 0 0
Note. The input clock that can be controlled by RTCEN is used when the register that is used by
the real-time counter (RTC) is accessed from the CPU. RTCEN cannot control supply of
the operating clock (fSUB) to RTC.
PER1 0 0 0 0 OACMPEN 0 0 0
PER1 0 0 0 0 OACMPEN 0 0 0
OSMC 0 0 0 0 0 0 0 FSEL
Cautions 1. OSMC can be written only once after reset release, by an 8-bit memory
manipulation instruction.
2. Write “1” to FSEL before the following two operations.
• Changing the clock prior to dividing fCLK to a clock other than fIH.
• Operating the DMA controller.
5.4.1 X1 oscillator
The X1 oscillator oscillates with a crystal resonator or ceramic resonator (2 to 20 MHz) connected to the X1 and X2
pins.
An external clock can also be input. In this case, input the clock signal to the EXCLK pin.
To use the X1 oscillator, set bits 7 and 6 (EXCLK, OSCSEL) of the clock operation mode control register (CMC) as
follows.
• Crystal or ceramic oscillation: EXCLK, OSCSEL = 0, 1
• External clock input: EXCLK, OSCSEL = 1, 1
When the X1 oscillator is not used, set the input port mode (EXCLK, OSCSEL = 0, 0).
When the pins are not used as input port pins, either, see Table 2-2 Connection of Unused Pins.
Figure 5-10 shows an example of the external circuit of the X1 oscillator.
VSS
X1
X2 EXCLK
External clock
Crystal resonator
or
ceramic resonator
VSS
XT1
32.768
kHz
XT2
Caution 1. When using the X1 oscillator and XT1 oscillator, wire as follows in the area enclosed by the
broken lines in the Figures 5-10 and 5-11 to avoid an adverse effect from wiring capacitance.
• Keep the wiring length as short as possible.
• Do not cross the wiring with the other signal lines. Do not route the wiring near a signal
line through which a high fluctuating current flows.
• Always make the ground point of the oscillator capacitor the same potential as VSS. Do not
ground the capacitor to a ground pattern through which a high current flows.
• Do not fetch signals from the oscillator.
Note that the XT1 oscillator is designed as a low-amplitude circuit for reducing power
consumption.
PORT
VSS X1 X2 VSS X1 X2
Remark When using the subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Also, insert
resistors in series on the XT2 side.
(c) Wiring near high alternating current (d) Current flowing through ground line of oscillator
(potential at points A, B, and C fluctuates)
VDD
Pmn
VSS X1 X2
VSS X1 X2
High current
A B C
High current
VSS X1 X2
Remark When using the subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Also, insert
resistors in series on the XT2 side.
Caution 2. When X2 and XT1 are wired in parallel, the crosstalk noise of X2 may increase with XT1,
resulting in malfunctioning.
5.4.6 Prescaler
The prescaler generates a CPU/peripheral hardware clock by dividing the main system clock and subsystem clock.
The clock generator generates the following clocks and controls the operation modes of the CPU, such as standby
mode (see Figure 5-1).
The CPU starts operation when the internal high-speed oscillator starts outputting after a reset release in the
μPD79F9211, thus enabling the following.
Figure 5-13. Clock Generator Operation When Power Supply Voltage Is Turned On
(When LVI Default Start Function Stopped Is Set (Option Byte: LVIOFF = 1))
CPU clock Internal high-speed oscillation clock High-speed system clock Subsystem clock
<2>
Internal high-speed
oscillation clock (fRH)
Note 1
High-speed
system clock (fXH) <4>
(when X1 oscillation
selected)
X1 clock
oscillation stabilization time:
Subsystem clock (fSUB) 28/fX to 218/fXNote 2
Starting X1 oscillation <4>
(when XT1 oscillation
is set by software.
selected)
<1> When the power is turned on, an internal reset signal is generated by the power-on-clear (POC) circuit.
<2> When the power supply voltage exceeds 1.61 V (TYP.), the reset is released and the internal high-speed
oscillator automatically starts oscillation.
<3> When the power supply voltage rises with a slope of 0.5 V/ms (MIN.), the CPU starts operation on the
internal high-speed oscillation clock after the reset is released and after the stabilization times for the voltage
of the power supply and regulator have elapsed, and then reset processing is performed.
<4> Set the start of oscillation of the X1 or XT1 clock via software (see (1) in 5.6.1 Example of controlling high-
speed system clock and (1) in 5.6.3 Example of controlling subsystem clock).
<5> When switching the CPU clock to the X1 or XT1 clock, wait for the clock oscillation to stabilize, and then set
switching via software (see (3) in 5.6.1 Example of controlling high-speed system clock and (2) in 5.6.3
Example of controlling subsystem clock).
Notes 1. The internal voltage stabilization time includes the oscillation accuracy stabilization time of the internal
high-speed oscillation clock.
2. When releasing a reset (above figure) or releasing STOP mode while the CPU is operating on the
internal high-speed oscillation clock, confirm the oscillation stabilization time for the X1 clock using the
oscillation stabilization time counter status register (OSTC). If the CPU operates on the high-speed
system clock (X1 oscillation), set the oscillation stabilization time when releasing STOP mode using the
oscillation stabilization time select register (OSTS).
Cautions 1. If the voltage rises with a slope of less than 0.5 V/ms (MIN.) from power application until the
voltage reaches 2.7 V, input a low level to the RESET pin from power application until the
voltage reaches 2.7 V, or set the LVI default start function stopped by using the option byte
(LVIOFF = 0) (see Figure 5-14). By doing so, the CPU operates with the same timing as <2>
and thereafter in Figure 5-13 after reset release by the RESET pin.
2. It is not necessary to wait for the oscillation stabilization time when an external clock input
from the EXCLK pin is used.
Remark While the microcontroller is operating, a clock that is not used as the CPU clock can be stopped via
software settings. The internal high-speed oscillation clock and high-speed system clock can be stopped
by executing the STOP instruction (see (4) in 5.6.1 Example of controlling high-speed system clock,
(3) in 5.6.2 Example of controlling internal high-speed oscillation clock, and (3) in 5.6.3 Example
of controlling subsystem clock).
Figure 5-14. Clock Generator Operation When Power Supply Voltage Is Turned On
(When LVI Default Start Function Enabled Is Set (Option Byte: LVIOFF = 0))
2.07 V (TYP.)
Power supply
voltage (VDD)
0V
<2>
Internal high-speed
oscillation clock (fRH)
High-speed
system clock (fXH) Note 1
<4>
(when X1 oscillation
selected)
X1 clock
oscillation stabilization time:
2 /fX to 218/fXNote 2
8
Subsystem clock (fSUB) Starting X1 oscillation <4>
(when XT1 oscillation is set by software.
selected)
<1> When the power is turned on, an internal reset signal is generated by the power-on-clear (POC) circuit.
<2> When the power supply voltage exceeds 2.07 V (TYP.), the reset is released and the internal high-speed
oscillator automatically starts oscillation.
<3> After the reset is released and reset processing is performed, the CPU starts operation on the internal high-
speed oscillation clock.
<4> Set the start of oscillation of the X1 or XT1 clock via software (see (1) in 5.6.1 Example of controlling high-
speed system clock and (1) in 5.6.3 Example of controlling subsystem clock).
<5> When switching the CPU clock to the X1 or XT1 clock, wait for the clock oscillation to stabilize, and then set
switching via software (see (3) in 5.6.1 Example of controlling high-speed system clock and (2) in 5.6.3
Example of controlling subsystem clock).
Preliminary User’s Manual 149
CHAPTER 5 CLOCK GENERATOR
Notes 1. The internal reset processing time includes the oscillation accuracy stabilization time of the internal
high-speed oscillation clock.
2. When releasing a reset (above figure) or releasing STOP mode while the CPU is operating on the
internal high-speed oscillation clock, confirm the oscillation stabilization time for the X1 clock using the
oscillation stabilization time counter status register (OSTC). If the CPU operates on the high-speed
system clock (X1 oscillation), set the oscillation stabilization time when releasing STOP mode using the
oscillation stabilization time select register (OSTS).
Cautions 1. A voltage oscillation stabilization time is required after the supply voltage reaches 1.61 V
(TYP.). If the supply voltage rises from 1.61 V (TYP.) to 2.07 V (TYP.) within the power supply
oscillation stabilization time, the power supply oscillation stabilization time is automatically
generated before reset processing.
2. It is not necessary to wait for the oscillation stabilization time when an external clock input
from the EXCLK pin is used.
Remark While the microcontroller is operating, a clock that is not used as the CPU clock can be stopped via
software settings. The internal high-speed oscillation clock and high-speed system clock can be stopped
by executing the STOP instruction (see (4) in 5.6.1 Example of controlling high-speed system clock,
(3) in 5.6.2 Example of controlling internal high-speed oscillation clock, and (3) in 5.6.3 Example
of controlling subsystem clock).
Figure 5-15. Clock Generator Operation When Power Supply Voltage Is Turned On
(When LVI Default Start Function Stopped Is Set (Option Byte: LVIOFF = 1) and Changing to Double-Speed
Mode Internal High-Speed Oscillation Clock)
<2>
Internal high-speed
oscillation clock (fIH)
Note
Double-speed mode
internal high-speed <4>
oscillation clock (fDSC)
Double-speed mode
internal high-speed
oscillation clock
DSCON = 1 is
oscillation
set by software.
stabilization time: 100 μ s
<1> When the power is turned on, an internal reset signal is generated by the power-on-clear (POC) circuit.
<2> When the power supply voltage exceeds 1.61 V (TYP.), the reset is released and the internal high-speed
oscillator automatically starts oscillation.
<3> When the power supply voltage rises with a slope of 0.5 V/ms (MIN.), the CPU starts operation on the
internal high-speed oscillation clock after the reset is released and after the stabilization times for the voltage
of the power supply and regulator have elapsed, and then reset processing is performed.
<4> Set DSCON = 1 by software.
<5> Switch the clock by setting DSPO = 1 and SELDSC = 1 by software after waiting for 100 μs.
Note The internal voltage stabilization time includes the oscillation accuracy stabilization time of the internal high-
speed oscillation clock.
Caution If the voltage rises with a slope of less than 0.5 V/ms (MIN.) from power application until the
voltage reaches 2.7 V, input a low level to the RESET pin from power application until the voltage
reaches 2.7 V, or set the LVI default start function stopped by using the option byte (LVIOFF = 0)
(see Figure 5-16). By doing so, the CPU operates with the same timing as <2> and thereafter in
Figure 5-15 after reset release by the RESET pin.
Figure 5-16. Clock Generator Operation When Power Supply Voltage Is Turned On
(When LVI Default Start Function Enabled Is Set (Option Byte: LVIOFF = 0) and Changing to Double-Speed
Mode Internal High-Speed Oscillation Clock)
2.7 V
Power supply 2.07 V
voltage (VDD) (TYP.)
0.5 V/ms
0V (MIN.)
Switched by software
Reset processing (DSPO = 1, SELDSC = 1)
<4>
Internal high-speed
CPU clock oscillation clock Double-speed mode internal high-speed oscillation clock
<2>
Internal high-speed
oscillation clock (fIH)
Note
Double-speed mode <3>
internal high-speed
oscillation clock (fDSC)
Double-speed mode
internal high-speed
DSCON = 1 is oscillation clock
set by software. oscillation
stabilization time: 100 μ s
<1> When the power is turned on, an internal reset signal is generated by the power-on-clear (POC) circuit.
<2> When the power supply voltage exceeds 2.07 V (TYP.), the reset is released and the internal high-speed
oscillator automatically starts oscillation.
<3> After the reset is released and reset processing is performed, the CPU starts operation on the internal high-
speed oscillation clock.
<4> Set DSCON = 1 by software.
<5> Switch the clock by setting DSPO = 1 and SELDSC = 1 by software after waiting for 100 μs.
Note The internal reset processing time includes the oscillation accuracy stabilization time of the internal high-
speed oscillation clock.
Caution A voltage oscillation stabilization time is required after the supply voltage reaches 1.61 V (TYP.).
If the supply voltage rises from 1.61 V (TYP.) to 2.07 V (TYP.) within the power supply oscillation
stabilization time, the power supply oscillation stabilization time is automatically generated
before reset processing.
When the high-speed system clock is not used, the X1/P121 and X2/EXCLK/P122 pins can be used as input port
pins.
Caution The X1/P121 and X2/EXCLK/P122 pins are in the input port mode after a reset release.
The following describes examples of setting procedures for the following cases.
(1) When oscillating X1 clock
(2) When using external main system clock
(3) When using high-speed system clock as CPU/peripheral hardware clock
(4) When stopping high-speed system clock
Cautions 1. The CMC register can be written only once after reset release, by an 8-bit memory
manipulation instruction.
Therefore, it is necessary to also set the value of the OSCSELS bit at the same time. For
OSCSELS bit, see 5.6.3 Example of controlling subsystem clock.
2. Set the X1 clock after the supply voltage has reached the operable voltage of the clock to
be used (see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
(2) Example of setting procedure when using the external main system clock
<1> Setting P121/X1 and P122/X2/EXCLK pins (CMC register)
Remark For setting of the P123/XT1 and P124/XT2 pins, see 5.6.3 (1) Example of setting procedure
when oscillating the subsystem clock.
Cautions 1. The CMC register can be written only once after reset release, by an 8-bit memory
manipulation instruction.
Therefore, it is necessary to also set the value of the OSCSELS bits at the same time. For
OSCSELS bits, see 5.6.3 Example of controlling subsystem clock.
2. Set the external main system clock after the supply voltage has reached the operable
voltage of the clock to be used (see CHAPTER 26 ELECTRICAL SPECIFICATIONS
(TARGET)).
(3) Example of setting procedure when using high-speed system clock as CPU/peripheral hardware clock
<1> Setting high-speed system clock oscillationNote
(See 5.6.1 (1) Example of setting procedure when oscillating the X1 clock and (2) Example of
setting procedure when using the external main system clock.)
Note The setting of <1> is not necessary when high-speed system clock is already operating.
<2> Setting the high-speed system clock as the source clock of the CPU/peripheral hardware clock and
setting the division ratio of the set clock (CKC register)
1 0 0 0 fMX
0 0 1 fMX/2
2
0 1 0 fMX/2
3
0 1 1 fMX/2
4
1 0 0 fMX/2
5 Note
1 0 1 fMX/2
<3> If some peripheral hardware macros are not used, supply of the input clock to each hardware macro can
be stopped.
(PER0 register)
RTCEN 0 ADCEN 0 0 SAU0EN 0 0
(PER1 register)
0 0 0 0 OACMPEN 0 0 0
(PER2 register)
0 0 0 0 0 0 TAUOPEN TAU0EN
(4) Example of setting procedure when stopping the high-speed system clock
The high-speed system clock can be stopped (disabling clock input if the external clock is used) in the following
two ways.
• Executing the STOP instruction
• Setting MSTOP to 1
<2> Setting the X1 clock oscillation stabilization time after STOP mode is released
If the X1 clock oscillates before the STOP mode is entered, set the value of the OSTS register before
executing the STOP instruction.
<2> Setting of X1 clock oscillation stabilization time after restart of X1 clock oscillationNote
Prior to setting "1" to MSTOP, set the OSTS register to a value greater than the count value to be
confirmed with the OSTS register after X1 clock oscillation is restarted.
Note This setting is required to resume the X1 clock oscillation when the high-speed system clock is in
the X1 oscillation mode.
This setting is not required in the external clock input mode.
Caution Be sure to confirm that MCS = 0 or CLS = 1 when setting MSTOP to 1. In addition, stop
peripheral hardware that is operating on the high-speed system clock.
The following describes examples of clock setting procedures for the following cases.
(1) When restarting oscillation of the internal high-speed oscillation clock
(2) When using internal high-speed oscillation clock as CPU/peripheral hardware clock
(3) When stopping the internal high-speed oscillation clock
(1) Example of setting procedure when restarting oscillation of the internal high-speed oscillation clockNote
<1> Setting restart of oscillation of the internal high-speed oscillation clock (CSC register)
When HIOSTOP is cleared to 0, the internal high-speed oscillation clock restarts oscillation.
Note After a reset release, the internal high-speed oscillator automatically starts oscillating and the internal
high-speed oscillation clock is selected as the CPU/peripheral hardware clock.
(2) Example of setting procedure when using internal high-speed oscillation clock as CPU/peripheral
hardware clock
<1> Restarting oscillation of the internal high-speed oscillation clockNote
(See 5.6.2 (1) Example of setting procedure when restarting internal high-speed oscillation clock).
Note The setting of <1> is not necessary when the internal high-speed oscillation clock is operating.
<2> Setting the internal high-speed oscillation clock as the source clock of the CPU/peripheral hardware clock
and setting the division ratio of the set clock (CKC register)
Caution If switching the CPU/peripheral hardware clock from the high-speed system clock to the
internal high-speed oscillation clock after restarting the internal high-speed oscillation
clock, do so after 10 μ s or more have elapsed.
If the switching is made immediately after the internal high-speed oscillation clock is
restarted, the accuracy of the internal high-speed oscillation cannot be guaranteed for
10 μ s.
(3) Example of setting procedure when stopping the internal high-speed oscillation clock
The internal high-speed oscillation clock can be stopped in the following two ways.
• Executing the STOP instruction
• Setting HIOSTOP to 1
<2> Setting the X1 clock oscillation stabilization time after STOP mode is released
If the X1 clock oscillates before the STOP mode is entered, set the value of the OSTS register before
executing the STOP instruction.
1 × Subsystem clock
Caution Be sure to confirm that MCS = 1 or CLS = 1 when setting HIOSTOP to 1. In addition, stop
peripheral hardware that is operating on the internal high-speed oscillation clock.
Caution The XT1/P123 and XT2/P124 pins are in the input port mode after a reset release.
The following describes examples of setting procedures for the following cases.
(1) When oscillating subsystem clock
(2) When using subsystem clock as CPU clock
(3) When stopping subsystem clock
Caution When the subsystem clock is used as the CPU clock, the subsystem clock is also supplied to the
peripheral hardware (except the real-time counter, and watchdog timer). At this time, the
operations of the A/D converter is not guaranteed. For the operating characteristics of the
peripheral hardware, refer to the chapters describing the various peripheral hardware as well as
CHAPTER 28 ELECTRICAL SPECIFICATIONS (TARGET).
Remark For setting of the P121/X1 and P122/X2 pins, see 5.6.1 Example of controlling high-speed
system clock.
Caution The CMC register can be written only once after reset release, by an 8-bit memory
manipulation instruction.
Therefore, it is necessary to also set the value of the EXCLK and OSCSEL bits at the same
time. For EXCLK and OSCSEL bits, see 5.6.1 (1) Example of setting procedure when
oscillating the X1 clock or 5.6.1 (2) Example of setting procedure when using the external
main system clock.
(2) Example of setting procedure when using the subsystem clock as the CPU clock
<1> Setting subsystem clock oscillationNote
(See 5.6.3 (1) Example of setting procedure when oscillating the subsystem clock.)
Note The setting of <1> is not necessary when while the subsystem clock is operating.
<2> Setting the subsystem clock as the source clock of the CPU clock (CKC register)
Caution When the subsystem clock is used as the CPU clock, the subsystem clock is also supplied to
the peripheral hardware (except the real-time counter, and watchdog timer). At this time, the
operations of the A/D converter is not guaranteed. For the operating characteristics of the
peripheral hardware, refer to the chapters describing the various peripheral hardware as well
as CHAPTER 28 ELECTRICAL SPECIFICATIONS (TARGET).
Cautions 1. Be sure to confirm that CLS = 0 when setting XTSTOP to 1. In addition, stop the
peripheral hardware if it is operating on the subsystem clock.
2. The subsystem clock oscillation cannot be stopped using the STOP instruction.
(1) Example of setting procedure when stopping the internal low-speed oscillation clock
The internal low-speed oscillation clock can be stopped in the following two ways.
• Stop the watchdog timer in the HALT/STOP mode by the option byte (bit 0 (WDSTBYON) of 000C0H = 0),
and execute the HALT or STOP instruction.
• Stop the watchdog timer by the option byte (bit 4 (WDTON) of 000C0H = 0).
(2) Example of setting procedure when restarting oscillation of the internal low-speed oscillation clock
The internal low-speed oscillation clock can be restarted as follows.
• Release the HALT or STOP mode
(only when the watchdog timer is stopped in the HALT/STOP mode by the option byte (bit 0 (WDSTBYON)
of 000C0H) = 0) and when the watchdog timer is stopped as a result of execution of the HALT or STOP
instruction).
Remarks 1. If the low-power-supply detector (LVI) is set to ON by default by the option bytes, the reset will not be
released until the power supply voltage (VDD) exceeds 2.07 V±0.2 VNote.
After the reset operation, the status will shift to (B) in the above figure.
2. DSC: Double-speed mode internal high-speed oscillation clock
Table 5-5 shows transition of the CPU clock and examples of setting the SFR registers.
Table 5-5. CPU Clock Transition and SFR Register Setting Examples (1/6)
(1) CPU operating with internal high-speed oscillation clock (B) after reset release (A)
(A) → (B) SFR registers do not have to be set (default status after reset release).
(2) CPU operating with high-speed system clock (C) after reset release (A)
(The CPU operates with the internal high-speed oscillation clock immediately after a reset release (B).)
Notes 1. The CMC and OSMC registers can be written only once by an 8-bit memory manipulation instruction
after reset release.
2. FSEL = 1 when fCLK > 10 MHz
If a divided clock is selected and fCLK ≤ 10 MHz, use with FSEL = 0 is possible even if fX > 10 MHz.
Caution Set the clock after the supply voltage has reached the operable voltage of the clock to be set
(see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
(3) CPU operating with subsystem clock (D) after reset release (A)
(The CPU operates with the internal high-speed oscillation clock immediately after a reset release (B).)
Note The CMC register can be written only once by an 8-bit memory manipulation instruction after reset release.
Remark (A) to (K) in Table 5-5 correspond to (A) to (K) in Figure 5-17.
Table 5-5. CPU Clock Transition and SFR Register Setting Examples (2/6)
(4) CPU operating with double-speed mode internal high-speed oscillation clock (J) after reset release (A)
(The CPU operates with the internal high-speed oscillation clock immediately after a reset release (B).)
(5) CPU clock changing from internal high-speed oscillation clock (B) to high-speed system clock (C)
(B) → (C)
Note 3
0 1 1 Note 2 0 1 Must be 1
(X1 clock: 10 MHz < fX ≤ 20 MHz) checked
Notes 1. The CMC and OSMC registers can be changed only once after reset release. This setting is not
necessary if it has already been set.
2. Set the oscillation stabilization time as follows.
• Desired OSTC oscillation stabilization time ≤ Oscillation stabilization time set by OSTS
3. FSEL = 1 when fCLK > 10 MHz
If a divided clock is selected and fCLK ≤ 10 MHz, use with FSEL = 0 is possible even if fX > 10 MHz.
Caution Set the clock after the supply voltage has reached the operable voltage of the clock to be set
(see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
Remark (A) to (K) in Table 5-5 correspond to (A) to (K) in Figure 5-17.
Table 5-5. CPU Clock Transition and SFR Register Setting Examples (3/6)
(6) CPU clock changing from internal high-speed oscillation clock (B) to subsystem clock (D)
Note The CMC register can be written only once by an 8-bit memory manipulation instruction after reset release.
(7) CPU clock changing from internal high-speed oscillation clock (B) to double-speed mode internal high-
speed oscillation clock (J)
(8) CPU clock changing from high-speed system clock (C) to internal high-speed oscillation clock (B)
Setting Flag of SFR Register CSC Register Oscillation accuracy CKC Register
Status Transition HIOSTOP stabilization time MCM0
(C) → (B) 0 10 μ s 0
Unnecessary if the
CPU is operating with
the internal high-
speed oscillation
clock
Remark (A) to (K) in Table 5-5 correspond to (A) to (K) in Figure 5-17.
Table 5-5. CPU Clock Transition and SFR Register Setting Examples (4/6)
(9) CPU clock changing from high-speed system clock (C) to subsystem clock (D)
Setting Flag of SFR Register CMC CSC Register Waiting for CKC Register
Note
Register Oscillation
Status Transition OSCSELS XTSTOP Stabilization CSS
Note The CMC register can be written only once by an 8-bit memory manipulation instruction after reset release.
(10) CPU clock changing from subsystem clock (D) to internal high-speed oscillation clock (B)
(D) → (B) 0 0 0
Remark (A) to (K) in Table 5-5 correspond to (A) to (K) in Figure 5-17.
Table 5-5. CPU Clock Transition and SFR Register Setting Examples (5/6)
(11) CPU clock changing from subsystem clock (D) to high-speed system clock (C)
Notes 1. The CMC and OSMC registers can be changed only once after reset release. This setting is not
necessary if it has already been set.
2. Set the oscillation stabilization time as follows.
• Desired OSTC oscillation stabilization time ≤ Oscillation stabilization time set by OSTS
3. FSEL = 1 when fCLK > 10 MHz
If a divided clock is selected and fCLK ≤ 10 MHz, use with FSEL = 0 is possible even if fX > 10 MHz.
Caution Set the clock after the supply voltage has reached the operable voltage of the clock to be set
(see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
(12) CPU clock changing from double-speed mode internal high-speed oscillation clock (J) to internal high-
speed oscillation clock (B)
Setting Flag of SFR Register CSC Register CKC Register DSCCTL Register
Status Transition HIOSTOP MCM0 SELDSC DSPO DSCON
(J) → (B) 0 0 0 0 0
Unnecessary if Unnecessary if
the CPU is this register is
operating with already set
the internal high-
speed oscillation
clock
Remark (A) to (K) in Table 5-5 correspond to (A) to (K) in Figure 5-17.
Table 5-5. CPU Clock Transition and SFR Register Setting Examples (6/6)
(13) • HALT mode (E) set while CPU is operating with internal high-speed oscillation clock (B)
• HALT mode (F) set while CPU is operating with high-speed system clock (C)
• HALT mode (G) set while CPU is operating with subsystem clock (D)
• HALT mode (K) set while CPU is operating with double-speed mode internal high-speed oscillation
clock (J)
(14) • STOP mode (H) set while CPU is operating with internal high-speed oscillation clock (B)
• STOP mode (I) set while CPU is operating with high-speed system clock (C)
(Setting sequence)
Remark (A) to (K) in Table 5-5 correspond to (A) to (K) in Figure 5-17.
5.6.6 Condition before changing CPU clock and processing after changing CPU clock
Condition before changing the CPU clock and processing after changing the CPU clock are shown below.
X1 clock Internal high- Oscillation of internal high-speed oscillator X1 oscillation can be stopped (MSTOP = 1).
speed oscillation • RSTOP = 0
clock
External main Transition not possible −
system clock (To change the clock, set it again after
executing reset once.)
Subsystem Stabilization of XT1 oscillation X1 oscillation can be stopped (MSTOP = 1).
clock • OSCSELS = 1, XTSTOP = 0
• After elapse of oscillation stabilization time
Double-speed Transition cannot be performed unless the −
mode internal clock is changed to the internal high-
high-speed speed oscillation clock once.
oscillation clock
External main Internal high- Oscillation of internal high-speed oscillator External main system clock input can be
system clock speed oscillation • RSTOP = 0 disabled (MSTOP = 1).
clock
X1 clock Transition not possible −
(To change the clock, set it again after
executing reset once.)
Subsystem Stabilization of XT1 oscillation External main system clock input can be
clock • OSCSELS = 1, XTSTOP = 0 disabled (MSTOP = 1).
• After elapse of oscillation stabilization time
Double-speed Transition cannot be performed unless the −
mode internal clock is changed to the internal high-speed
high-speed oscillation clock once.
oscillation clock
Double-speed Internal high- Oscillation of internal high-speed oscillator Double-speed mode internal high-speed
mode internal speed oscillation and selection of internal high-speed oscillation clock can be stopped
high-speed clock oscillation clock as main system clock (DSCON = 0)
oscillation • HIOSTOP = 0, MCS = 0
clock • SELDSC = 0, DSPO = 0
X1 clock Transition cannot be performed unless the −
clock is changed to the internal high-
speed oscillation clock once.
External main Transition cannot be performed unless the −
system clock clock is changed to the internal high-
speed oscillation clock once.
Subsystem Transition cannot be performed unless the −
clock clock is changed to the internal high-
speed oscillation clock once.
5.6.7 Time required for switchover of CPU clock and main system clock
By setting bits 0 to 2, 4, and 6 (MDIV0 to MDIV2, MCM0, CSS) of the system clock control register (CKC), the CPU
clock can be switched (between the main system clock and the subsystem clock), main system clock can be switched
(between the internal high-speed oscillation clock and the high-speed system clock), and the division ratio of the main
system clock can be changed.
The actual switchover operation is not performed immediately after rewriting to CKC; operation continues on the
pre-switchover clock for several clocks (see Table 5-7 to Table 5-10).
Whether the CPU is operating on the main system clock or the subsystem clock can be ascertained using bit 7
(CLS) of CKC. Whether the main system clock is operating on the high-speed system clock or internal high-speed
oscillation clock can be ascertained using bit 5 (MCS) of CKC.
When the CPU clock is switched, the peripheral hardware clock is also switched.
Table 5-7. Maximum Time Required for Main System Clock Switchover
Remarks 1. The number of clocks listed in Table 5-8 to Table 5-10 is the number of CPU clocks before switchover.
2. Calculate the number of clocks in Table 5-8 to Table 5-10 by removing the decimal portion.
Example When switching the main system clock from the internal high-speed oscillation clock to the
high-speed system clock (@ oscillation with fIH = 8 MHz, fMX = 10 MHz)
1 + fIH/fMX = 1 + 8/10 = 1 + 0.8 = 1.8 → 2 clocks
Table 5-11. Conditions Before the Clock Oscillation Is Stopped and Flag Settings
Timer array unit TAUS has twelve 16-bit timers per unit. Each 16-bit timer is called a channel and can be used as
an independent timer. In addition, two or more “channels” can be used to create a high-accuracy timer.
Channel 7 can be used to realize LIN-bus reception processing in combination with UART0 of the serial array unit.
Remarks 1. n = 00 to 11
In the case of timer input pin (TIn): n = 02-07, 09-11
In the case of timer output pin (TOn): n = 02-07, 10, 11
2. m = 10, 11
Item Configuration
Timer/counter Timer counter register n (TCRn)
Register Timer data register n (TDRn)
Timer input TI02 to TI07, TI09, TI10, TI11, SLTI pins, RxD0 pin (for LIN-bus)
Timer output TO02 to TO07, TO10, TO11, SLTO pins, output controller
Control registers <Registers of unit setting block>
• Peripheral enable register 2 (PER2)
• Timer clock select register 0 (TPS0)
• Timer channel enable status register 0 (TE0)
• Timer channel start register 0 (TS0)
• Timer channel stop register 0 (TT0)
• Timer input select register 0 (TIS0)
• Timer output enable register 0 (TOE0)
• Timer output register 0 (TO0)
• Timer output level register 0 (TOL0)
• Timer output mode register 0 (TOM0)
• Timer triangle wave output mode register 0 (TOT0)
Note
Note. These registers are used with the inverter control function. For details, refer to CHAPTER 7
INVERTER CONTROL FUNCTIONS.
The P52/SLTI/SLTO pin can be assigned to the timer I/Os of channels 0, 1, and 8 to 11 by setting the input
switching control register (ISC). (For details of the input switching control register (ISC), see 6.3 (23) Input switching
control register (ISC).)
The following I/O pins can be selected for channels 0, 1, and 8 to 11.
Table 6-2. I/O Pins That Can Be Selected for Channels 0, 1, and 8 to 11
Caution Hereinafter, timer I/O pins are described as TIn and TOn (n = xx), which also includes the selection of the
SLTI and SLTO pins.
Remarks 1. When timer input and timer output are shared by the same pin, either only timer input or only timer
output can be used.
2. Only one of the above-mentioned channels can be assigned as the timer I/O pin for the P52/SLTI/SLTO
pin.
3. The SLTI and SLTO pins cannot be selected as timer I/Os for channels other than those mentioned
above (channels 2 to 7).
TO00
INTTM00
TO02
Interrupt INTTMM0
INTTM02 signal INTTMV0
TI02
Channel 2 output INTTMM1
circuit INTTMV1
TO03
INTTM03
TI03
Channel 3 TO02
TO04 TO03
INTTM04 Real-time
output TO04
Channel 4 period TO05
controller
TI04 detection signal
Selector
Channel 4 TO06
TI05 INTTM05
ISC4 to ISC2 bits
Channel 5 of the ISC register
TO06
TI06 INTTM06
Channel 6
Selector
ISC1 SLTO
TO07
Selector
TI07
INTTM07 Hi-Z
RxD0
(serial input pin) controller
Channel 7 (LIN-bus supported)
TO10
TO08 TO11
INTTM08
Channel 8
TO09
TI09 INTTM09
Channel 9
TO10
TI10 INTTM10
Channel 10
A/D
TO11 conversion A/D
trigger converter
TI11 INTTM11 output
Channel 11 selector
Remark The configuration diagram in Figure 6-1 also includes the registers and pins used with the inverter
control function. For details of the inverter control function, refer to CHAPTER 7 INVERTER
CONTROL FUNCTIONS.
TRE TRE TRE TRE TRE TRE TRE TRE TRE TRE TRE TRE Timer real-time output TOM TOM TOM TOM TOM TOM TOM TOM TOM TOM TOM TOM Timer output mode
11 10 09 08 07 06 05 04 03 02 01 00 enable register 0 (TRE0) 11 10 09 08 07 06 05 04 03 02 01 00 register 0 (TOM0)
TRO TRO TRO TRO TRO TRO TRO TRO TRO TRO TRO TRO Timer real-time output TOL TOL TOL TOL TOL TOL TOL TOL TOL TOL TOL TOL Timer output level
11 10 09 08 07 06 05 04 03 02 01 00 register 0 (TRO0) 11 10 09 08 07 06 05 04 03 02 01 00 register 0 (TOL0)
Real-time TO03
Slave/master Interrupt
TI03 controller controller output selector
INTTM03
Channel 3
Shifting up or down to slave channel Interrupt signal to
Trigger signal to slave channel a lower channel Trigger signal to
Clock signal to slave channel a lower channel
Interrupt signal to slave channel
CK00
clock selection
Timer
Count clock
Operation
TCLK Output
selection
MCK controller
CK01 controller TO04
(timer output pin)
Mode Output latch
fXT/4 selection (P12) PM12
Interrupt INTTM04
controller (timer interrupt)
Selector
Edge
detection Channel 4 period
selection
Trigger
detection signal
Timer status
TIS04
register 04 (TSR04)
MAS
CKS04 CKS14 CCS04 STS042 STS041 STS040 CIS041 CIS040 MD043 MD042 MD041 MD040
TER04
TO05
TI05 INTTM05
Channel 5
Remark The block diagram in Figure 6-2 also includes the registers and pins used with the inverter control function.
For details of the inverter control function, refer to CHAPTER 7 INVERTER CONTROL FUNCTIONS.
Address: F0180H, F0181H (TCR00) to F018EH, F018FH (TCR07) After reset: FFFFH R
F01C0H, F01C1H (TCR08) to F01C6H, F01C7H (TCR11)
F0181H (TCR00) F0180H (TCR00)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TCRn
(n = 00 to 11)
Caution The count value is not captured to TDRn even when TCRn is read.
The TCRn register read value differs as follows according to operation mode changes and the operating status.
Notes 1. The read values of the TCRn register when TSn has been set to "1" while TEn = 0 are shown. The read
value is held in the TCRn register until the count operation starts.
2. These operation modes are used with the inverter control function. For details, refer to CHAPTER 7
INVERTER CONTROL FUNCTIONS.
Remark n = 00 to 11
Address: FFF18H, FFF19H (TDR00), FFF1AH, FFF1BH (TDR01), After reset: 0000H R/W
FFF64H, FFF65H (TDR02) to FFF76H, FFF77H (TDR11)
FFF19H (TDR00) FFF18H (TDR00)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TDRn
(n = 00 to 11)
Caution TDRn does not perform a capture operation even if a capture trigger is input, when it is
set to the compare function.
Remark n = 00 to 11
Note These registers are used with the inverter control function. For details, refer to CHAPTER 7 INVERTER
CONTROL FUNCTIONS.
Remark n = 00 to 11
Cautions 1. When setting timer array unit TAUS, be sure to set TAU0EN to 1 first. If TAU0EN = 0,
writing to a control register of timer array unit TAUS is ignored, and all read values are
default values. Similarly, when using the inverter control function, set TAUOPEN to 1 first.
2. Be sure to clear bits 2 to 7 of the PER2 register to 0.
Rewriting of TPS0 during timer operation is possible only in the following cases.
PRS000 to PRS003 bits: When all the channels set to CKSn = 0 are in the operation stopped state (TEn =
0) (n = 00 to 07)
PRS010 to PRS013 bits: When all the channels set to CKSn = 1 are in the operation stopped state (TEn =
0) (n = 00 to 07)
PRS020 to PRS023 bits: When all the channels set to CKSn = 0 are in the operation stopped state (TEn =
0) (n = 08 to 11)
PRS030 to PRS033 bits: When all the channels set to CKSn = 1 are in the operation stopped state (TEn =
0) (n = 08 to 11)
TPS0 PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS
033 032 031 030 023 022 021 020 013 012 011 010 003 002 001 000
Note
PRS PRS PRS PRS Selection of operation clock (CK0m)
0m3 0m2 0m1 0m0 fCLK = 5 MHz fCLK = 10 MHz fCLK = 20 MHz fCLK = 40 MHz
Note When changing the clock selected for fCLK (by changing the system clock control register (CKC) value),
stop timer array unit TAUS (TT0 = 00FFH).
Note These modes are used with the inverter control function. For details, refer to CHAPTER 7 INVERTER
CONTROL FUNCTIONS.
Address: F0190H, F0191H (TMR00) to F019EH, F019FH (TMR07) After reset: 0000H R/W
F01C8H, F01C9H (TMR08) to F01CEH, F01CFH (TMR11)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRn CKS 0 CCS CCS MAST STS STS STS CIS CIS 0 MD MD MD MD MD
n 1n 0n ERn n2 n1 n0 n1 n0 n4 n3 n2 n1 n0
Operation clock MCK is used by the edge detector. A count clock (TCLK) is generated depending on the setting of
the CCS1n and CCS0n bits.
Count clock (TCLK) is used for the timer/counter, output controller, and interrupt controller.
Note These settings are used with the inverter control function. For details, refer to CHAPTER 7 INVERTER
CONTROL FUNCTIONS.
Remark n = 00 to 11
Address: F0190H, F0191H (TMR00) to F019EH, F019FH (TMR07) After reset: 0000H R/W
F01C8H, F01C9H (TMR08) to F01CEH, F01CFH (TMR11)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRn CKS 0 CCS CCS MAST STS STS STS CIS CIS 0 MD MD MD MD MD
n 1n 0n ERn n2 n1 n0 n1 n0 n4 n3 n2 n1 n0
Only the even channel can be set as a master channel (MASTERn = 1).
Be sure to use the odd channel as a slave channel (MASTERn = 0).
Clear MASTERn to 0 for a channel that is used with the single-operation function.
0 0 0 Only software trigger start is valid (other trigger sources are unselected).
0 0 1 Valid edge of TIn pin input is used as both the start trigger and capture trigger.
0 1 0 Both the edges of TIn pin input are used as a start trigger and a capture trigger.
1 0 0 Interrupt signal of the master channel is used (when the channel is used as a slave channel
with the combination-operation function).
1 0 1 The interrupt signal of the higher channel, regardless of the master channel setting is
Note
used .
Note
1 1 0 The trigger of the dead time control trigger generation channel is used .
Note
1 1 1 The up and down control trigger of the master channel is used .
Other than above Setting prohibited
0 0 Falling edge
0 1 Rising edge
1 0 Both edges (when low-level width is measured)
Start trigger: Falling edge, Capture trigger: Rising edge
1 1 Both edges (when high-level width is measured)
Start trigger: Rising edge, Capture trigger: Falling edge
If both the edges are specified when the value of the STSn2 to STSn0 bits is other than 010B, set the CISn1 to
CISn0 bits to 10B.
Note These settings are used with the inverter control function. For details, refer to CHAPTER 7 INVERTER
CONTROL FUNCTIONS.
Remark n = 00 to 11
Address: F0190H, F0191H (TMR00) to F019EH, F019FH (TMR07) After reset: 0000H R/W
F01C8H, F01C9H (TMR08) to F01CEH, F01CFH (TMR11)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRn CKS 0 CCS CCS MAST STS STS STS CIS CIS 0 MD MD MD MD MD
n 1n 0n ERn n2 n1 n0 n1 n0 n4 n3 n2 n1 n0
The operation of the MDn0 bit varies depending on each operation mode (see table below).
(1, 0, 0, 1)
• One-count mode 0 Start trigger is invalid during counting operation.
(0, 1, 0, 0) At that time, interrupt is not generated, either.
Note 2
1 Start trigger is valid during counting operation .
At that time, interrupt is also generated.
• Interval one-count mode
Note 1
0 Start trigger is invalid during counting operation.
(1, 0, 0, 0) At that time, interrupt is not generated, either.
• Capture & one-count mode 0 Timer interrupt is not generated when counting is started
(0, 1, 1, 0) (timer output does not change, either).
Start trigger is invalid during counting operation.
At that time, interrupt is not generated, either.
Other than above Setting prohibited
Notes 1. These settings are used with the inverter control function. For details, refer to CHAPTER 7
INVERTER CONTROL FUNCTIONS.
2. If the start trigger (TSn = 1) is issued during operation, the counter is cleared, an interrupt is
generated, and recounting is started.
Remark n = 00 to 11
Address: F01A0H, F01A1H (TSR00) to F01AEH, F01AFH (TSR07) After reset: 0000H R
F01D0H, F01D1H (TSR08) to F01D6H, F01D7H (TSR11)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
When OVF = 1, this flag is cleared (OVF = 0) when the next value is captured without overflow.
Note This operation mode or bit is used with the inverter control function. For details, refer to CHAPTER 7
INVERTER CONTROL FUNCTIONS.
Table 6-4. OVF Bit Operation and Set/Clear Conditions in Each Operation Mode
Note These operation modes are used with the inverter control function. For details, refer to CHAPTER 7
INVERTER CONTROL FUNCTIONS.
Remark The OVF bit does not change immediately after the counter has overflowed, but changes upon the
subsequent capture.
TE0 0 0 0 0 TE11 TE10 TE09 TE08 TE07 TE06 TE05 TE04 TE03 TE02 TE01 TE00
Remark n = 00 to 11
TS0 0 0 0 0 TS11 TS10 TS09 TS08 TS07 TS06 TS05 TS04 TS03 TS02 TS01 TS00
0 No trigger operation
1 TEn is set to 1 and the count operation becomes enabled.
The TCRn count operation start in the count operation enabled state varies depending on each operation
mode (see Table 6-5).
2. n = 00 to 11
Table 6-5. Operations from Count Operation Enabled State to TCRn Count Start (1/2)
• Interval timer mode No operation is carried out from start trigger detection (TSn = 1) until count clock
generation.
The first count clock loads the value of TDRn to TCRn and the subsequent count
clock performs count down operation (see 6.3 (6) (a) Start timing in interval
timer mode and up and down count mode).
• Event counter mode Writing 1 to TSn bit loads the value of TDRn to TCRn.
The subsequent count clock performs count down operation.
The external trigger detection selected by STSn2 to STSn0 bits in the TMRn
register does not start count operation (see 6.3 (6) (b) Start timing in event
counter mode).
• Capture mode No operation is carried out from start trigger detection until count clock
generation.
The first count clock loads 0000H to TCRn and the subsequent count clock
performs count up operation (see 6.3 (6) (c) Start timing in capture mode).
Table 6-5. Operations from Count Operation Enabled State to TCRn Count Start (2/2)
• One-count mode When TEn = 0, writing 1 to TSn bit sets the start trigger wait state.
No operation is carried out from start trigger detection until count clock
generation.
The first count clock loads the value of TDRn to TCRn and the subsequent count
clock performs count down operation (see 6.3 (6) (d) Start timing in one-count
mode).
• Capture & one-count mode When TEn = 0, writing 1 to TSn bit sets the start trigger wait state.
No operation is carried out from start trigger detection until count clock
generation.
The first count clock loads 0000H to TCRn and the subsequent count clock
performs count up operation (see 6.3 (6) (e) Start timing in capture & one-
count mode and interval one-count mode).
• Interval one-count mode
Note
When TEn = 0, writing 1 to TSn bit sets the start trigger wait state.
No operation is carried out from start trigger detection until count clock
generation.
The first count clock loads 0000H to TCRn and the subsequent count clock
performs count up operation (see 6.3 (6) (e) Start timing in capture & one-
count mode and interval one-count mode).
• Up and down count mode
Note
No operation is carried out from start trigger detection (TSn = 1) until count clock
generation.
The first count clock loads the value of TDRn to TCRn and the subsequent count
clock performs count down operation (see 6.3 (6) (a) Start timing in interval
timer mode and up and down count mode).
Note These operation modes are used with the inverter control function. For details, refer to CHAPTER 7
INVERTER CONTROL FUNCTIONS.
(a) Start timing in interval timer mode and up and down count modeNote
Figure 6-11. Start Timing (In Interval Timer Mode and Up and Down Count ModeNote)
fCLK
TSn (write)
TEn <1>
Count clock
<3> <4>
TCRn Initial value TDRn value
INTTMn
Note These operation modes are used with the inverter control function. For details, refer to CHAPTER 7
INVERTER CONTROL FUNCTIONS.
Caution In the first cycle operation of count clock after writing TSn, an error at a maximum of one
clock is generated since count start delays until count clock has been generated. When the
information on count start timing is necessary, an interrupt can be generated at count start
by setting MDn0 = 1.
fCLK
TSn (write)
TEn <1>
<2>
Count clock
<1> <3>
TCRn Initial value TDRn value TDRn value-1
fCLK
TSn (write)
<1>
TEn
Count clock
<3> <4>
TCRn Initial value 0000H
INTTMn
Caution In the first cycle operation of count clock after writing TSn, an error at a maximum of one
clock is generated since count start delays until count clock has been generated. When the
information on count start timing is necessary, an interrupt can be generated at count start
by setting MDn0 = 1.
fCLK
<1>
TSn (write)
TEn
Count clockNote
<2> <3>
TCRn Initial value TDRn value
Note When the one-count mode is set, the operation clock (MCK) is selected as count clock (CCS1n, CCS0n
= 0).
Caution An input signal sampling error is generated since operation starts upon start trigger
detection (The error is one count clock when TIn is used).
(e) Start timing in capture & one-count mode and interval one-count modeNote 1
Figure 6-15. Start Timing (In Capture & One-count Mode and Interval One-count ModeNote 1)
fCLK
TEn
Count clockNote 2
<2> <3>
TCRn Initial value 0000H
Notes 1. This operation mode is used with the inverter control function. For details, refer to CHAPTER 7
INVERTER CONTROL FUNCTIONS.
2. When the capture & one-count mode or interval one-count mode is set, the operation clock (MCK) is
selected as count clock (CCS1n, CCS0n = 0).
Caution An input signal sampling error is generated since operation starts upon start trigger
detection (The error is one count clock when TIn is used).
TT0 0 0 0 0 TT11 TT10 TT09 TT08 TT07 TT06 TT05 TT04 TT03 TT02 TT01 TT00
0 No trigger operation
1 Operation is stopped (stop trigger is generated).
Remark n = 00 to 07
TOE0 0 0 0 0 TOE TOE TOE TOE TOE TOE TOE TOE TOE TOE TOE TOE
11 10 09 08 07 06 05 04 03 02 01 00
0 The TOn operation stopped by count operation (timer channel output bit).
Writing to the TOn bit is enabled.
The TOn pin functions as data output, and it outputs the level set to the TOn bit.
The output level of the TOn pin can be manipulated by software.
1 The TOn operation enabled by count operation (timer channel output bit).
Writing to the TOn bit is disabled (writing is ignored).
The TOn pin functions as timer output, and the TOEn is set or reset depending on the timer operation.
The TOn pin outputs the square-wave or PWM depending on the timer operation.
Remark n = 00 to 11
TO0 0 0 0 0 TO TO TO TO TO TO TO TO TO TO TO TO
11 10 09 08 07 06 05 04 03 02 01 00
Remark n = 00 to 11
TOL0 0 0 0 0 TOL TOL TOL TOL TOL TOL TOL TOL TOL TOL TOL TOL
11 10 09 08 07 06 05 04 03 02 01 00
Note These settings are used with the inverter control function. For details, refer to CHAPTER 7
INVERTER CONTROL FUNCTIONS.
Remarks 1. If the value of this register is rewritten during timer operation, the timer output is inverted when
the timer output signal changes next, instead of immediately after the register value is rewritten.
2. n = 00 to 11
Note The setting of each channel n when the inverter control function is used is reflected when TREn = 0
when timer output is enabled (TOEn = 1), or at the timing the timer output signal is set or reset when
TREn or TMEn = 1.
TOM0 0 0 0 0 TOM TOM TOM TOM TOM TOM TOM TOM TOM TOM TOM TOM
11 10 09 08 07 06 05 04 03 02 01 00
0 Toggle operation mode (to produce toggle output by timer interrupt request signal (INTTMn))
Note
1 Selects the combination-operation mode by the timer triangle wave output mode register (TOT0) setting .
Note When the inverter control function is used, the combination-operation mode is selected by the timer
triangle wave output mode register (TOT) setting. For details, refer to CHAPTER 7 INVERTER
CONTROL FUNCTIONS.
The above-mentioned registers are used with the inverter control function. For the setting and inverter control of
each register, refer to CHAPTER 7 INVERTER CONTROL FUNCTIONS.
0 Uses the input signal of the INTP0 pin as an external interrupt (normal operation).
1 Uses the input signal of the RXD0 pin as an external interrupt
(to measure the pulse widths of the sync break field and sync field).
Remark When the LIN-bus communication function is used, select the input signal of the RxD0 pin by
setting ISC1 to 1.
Figure 6-23. Format of Noise Filter Enable Registers 1, 2 (NFEN1, NFEN2) (1/2)
Note
TNFEN07 Enable/disable using noise filter of TI07/TO07/P51 pin or RxD0/SI00/P74 pin input signal
Note. The applicable pin can be switched by setting ISC1 of the ISC register.
ISC1 = 0: Whether or not to use the noise filter of TI07 pin can be selected.
ISC1 = 1: Whether or not to use the noise filter of RxD0 pin can be selected.
Figure 6-23. Format of Noise Filter Enable Registers 1, 2 (NFEN1, NFEN2) (2/2)
Figure 6-24. Format of Port Mode Registers 1, 3, 5, and 7 (PM1, PM3, PM5, PM7)
<5>
TOn register
Interrupt signal of the master channel
(INTTMn)
Controller
Set
TOLn
TOMn Internal bus
<1> When TOMn = 0 (toggle mode), the set value of the TOLn register is ignored and only INTTMp (slave
channel timer interrupt) is transmitted to the TOn register.
<2> When TOMn = 1 (combination-operation mode), both INTTMn (master channel timer interrupt) and
INTTMp (slave channel timer interrupt) are transmitted to the TOn register.
At this time, the TOLn register becomes valid and the signals are controlled as follows:
When INTTMn and INTTMp are simultaneously generated, (0% output of PWM), INTTMp (reset signal)
takes priority, and INTTMn (set signal) is masked.
<3> When TOEn = 1, INTTMn (master channel timer interrupt) and INTTMp (slave channel timer interrupt) are
transmitted to the TOn register. Writing to the TOn register (TOn write signal) becomes invalid.
When TOEn = 1, the TOn pin output never changes with signals other than interrupt signals.
To initialize the TOn pin output level, it is necessary to set TOEn = 0 and to write a value to TOn.
<4> When TOEn = 0, writing to TOn bit to the target channel (TOn write signal) becomes valid. When TOEn =
0, neither INTTMn (master channel timer interrupt) nor INTTMp (slave channel timer interrupt) is
transmitted to TOn register.
<5> The TOn register can always be read, and the TOn pin output level can be checked.
Figure 6-26. Status Transition from Timer Output Setting to Operation Start
Hi-Z
Timer alternate-function pin
TOn
TOEn
Write operation enabled period to TOn Write operation disabled period to TOn
<1> Set the TOMn <2> Set the TOn <3> Set the TOEn <4> Set the port to <5> Timer operation start
Set the TOLn output mode
<2> The timer output signal is set to the initial status by setting TOn.
<3> The timer output operation is enabled by writing 1 to TOEn (writing to TOn is disabled).
<4> The port I/O setting is set to output (see 6.3 (25) Port mode registers 1, 3, 5, 7).
<5> The timer operation is enabled (TSn = 1).
Remark n = 00 to 11
(1) Changing values set in registers TO0, TOE0, and TOL0 during timer operation
Since the timer operations (operations of TCRn and TDRn) are independent of the TOn output circuit and
changing the values set in TO0, TOE0, and TOL0 does not affect the timer operation, the values can be
changed during timer operation.
When the values set in TOE0, TOL0, and TOM0 (except for TO0) are changed close to the timer interrupt
(INTTMn), the waveform output to the TOn pin may be different depending on whether the values are
changed immediately before or immediately after the timer interrupt (INTTMn) signal generation timing.
Remark n = 00 to 11
(2) Default level of TOn pin and output level after timer operation start
The following figure shows the TOn pin output level transition when writing has been done in the state of
TOEn = 0 before port output is enabled and TOEn = 1 is set after changing the default level.
TOEn
TOn = 0, TOLn = 1
Hi-Z
(Same output waveform as TOLn = 0)
(b) When operation starts with TOMn = 1 setting (Combination-operation mode (PWM output))
When TOMn = 1, the active level is determined by TOLn setting.
TOEn
Remarks 1. Set: The output signal of TOn pin changes from inactive level to active level.
Reset: The output signal of TOn pin changes from active level to inactive level.
2. n = 00 to 11
(a) When TOLn setting has been changed during timer operation
When the TOLn setting has been changed during timer operation, the setting becomes valid at the
generation timing of TOn change condition. Rewriting TOLn does not change the output level of TOn.
The following figure shows the operation when the value of TOLn has been changed during timer
operation (TOMn = 1).
Figure 6-29. Operation when TOLn Has Been Changed during Timer Operation
TOLn
TOn pin
Remarks 1. Set: The output signal of TOn pin changes from inactive level to active level.
Reset: The output signal of TOn pin changes from active level to inactive level.
2. n = 00 to 11
fCLK
Count clock
Master channel
INTTMn
to_reset
(Internal signal)
TOn pin/
TOn
Toggle
to_set
(Internal signal)
to_reset
(Internal signal)
TOp pin/
TOp
Set Reset
Before writing
TO0 0 0 0 0 TO11 TO10 TO09 TO08 TO07 TO06 TO05 TO04 TO03 TO02 TO01 TO00
0 1 0 0 0 0 1 0 0 0 1 0
TOE0 0 0 0 0 TOE11 TOE10 TOE09 TOE08 TOE07 TOE06 TOE05 TOE04 TOE03 TOE02 TOE01 TOE00
1 1 1 0 0 0 1 0 1 1 1 1
Data to be written
0 0 0 0 1 0 1 1 1 1 0 0 0 0 1 1
× × × O O O × O × × × ×
After writing
TO0 0 0 0 0 TO11 TO10 TO09 TO08 TO07 TO06 TO05 TO04 TO03 TO02 TO01 TO00
0 1 0 1 1 1 1 0 0 0 1 0
Writing is done only to TOn bits with TOEn = 0, and writing to TOn bits with TOEn = 1 is ignored.
TOn (channel output) to which TOEn = 1 is set is not affected by the write operation. Even if the write operation is
done to TOn, it is ignored and the output change by timer operation is normally done.
TO04
Caution When TOEn = 1, even if the output by timer interrupt of each timer (INTTMn) contends with
writing to TOn, output is normally done to TOn pin.
Remark n = 00 to 11
TCRn
TEn
INTTMn
TOn
When MDn0 is set to 1, a timer interrupt (INTTMn) is output at count operation start, and TOn performs a toggle
operation.
TCRn
TEn
INTTMn
TOn
When MDn0 is set to 0, a timer interrupt (INTTMn) is not output at count operation start, and TOn does not change
either. After counting one cycle, INTTMn is output and TOn performs a toggle operation.
Remark n = 00 to 11
fCLK
Remark n = 00 to 11
(1) Only an even channel (channel 0, 2, 4, etc.) can be set as a master channel.
(2) Any channel, except channel 0, can be set as a slave channel.
(3) The slave channel must be lower than the master channel.
Example: If channel 2 is set as a master channel, channel 3 or those that follow (channels 3, 4, 5, etc.) can
be set as a slave channel.
(4) Two or more slave channels can be set for one master channel.
(5) When two or more master channels are to be used, slave channels with a master channel between them may
not be set.
Example: If channels 0 and 4 are set as master channels, channels 1 to 3 can be set as the slave channels
of master channel 0. Channels 5 to 7 cannot be set as the slave channels of master channel 0.
(6) A master channel can transmit INTTMn (interrupt), start software trigger, and count clock to the lower channels.
(7) A slave channel can use the INTTMn (interrupt), start software trigger, and count clock of the master channel,
but it cannot transmit its own INTTMn (interrupt), start software trigger, and count clock to the lower channel.
(8) A master channel cannot use the INTTMn (interrupt), start software trigger, and count clock from the higher
master channel.
(9) To simultaneously start channels that operate in combination, the TSn bit of the channels in combination must
be set at the same time.
(10) To stop the channels in combination simultaneously, the TTn bit of the channels in combination must be set at
the same time.
Remark n = 00 to 11 (This is, however, n = 00, 02, 04, 06, 08, 10 in the case of the master channel.)
Example
TAUS
Channel 1: Slave
Channel 2: Slave
Generation period of INTTMn (timer interrupt) = Period of count clock × (Set value of TDRn + 1)
• Period of square wave output from TOn = Period of count clock × (Set value of TDRn + 1) × 2
• Frequency of square wave output from TOn = Frequency of count clock/{(Set value of TDRn + 1) × 2}
CK00 or CK02
Operation clockNote Timer counter Output
CK01 or CK03 (TCRn) TOn pin
controller
Trigger selection
Note The operation clocks of channels 0 to 7 are selected from CK00 and CK01, and those of channels 8 to
11 from CK02 and CK03.
Remark n = 00 to 11
Figure 6-37. Example of Basic Timing of Operation as Interval Timer/Square Wave Output (MDn0 = 1)
TSn
TEn
TCRn
0000H
TDRn a b
TOn
INTTMn
Remark n = 00 to 11
Figure 6-38. Example of Set Contents of Registers During Operation as Interval Timer/Square Wave Output
Slave/master selection
0: Cleared to 0 when single-operation function is selected.
Remark n = 00 to 11
Sets TOEn to 1 and enables operation of TOn. TOn does not change because channel stops operating.
Clears the port register and port mode register to 0. The TOn pin outputs the TOn set level.
Operation Sets TOEn to 1 (only when operation is resumed).
start Sets the TSn bit to 1. TEn = 1, and count operation starts.
The TSn bit automatically returns to 0 because it is a Value of TDRn is loaded to TCRn at the count clock input.
trigger bit. INTTMn is generated and TOn performs toggle operation if
the MDn0 bit of the TMRn register is 1.
Operation is resumed.
During Set values of TMRn, TOM0, and TOL0 registers cannot Counter (TCRn) counts down. When count value reaches
operation be changed. 0000H, the value of TDRn is loaded to TCRn again and the
Set value of the TDRn register can be changed. count operation is continued. By detecting TCRn = 0000H,
The TCRn register can always be read. INTTMn is generated and TOn performs toggle operation.
The TSRn register is not used. After that, the above operation is repeated.
Set values of the TO0 and TOE0 registers can be
changed.
Operation The TTn bit is set to 1. TEn = 0, and count operation stops.
stop The TTn bit automatically returns to 0 because it is a TCRn holds count value and stops.
trigger bit. The TOn output is not initialized but holds current status.
TOEn is cleared to 0 and value is set to TOn bit. The TOn pin outputs the TOn set level.
TAUS To hold the TOn pin output level
stop Clears TOn bit to 0 after the value to
be held is set to the port register. The TOn pin output level is held by port function.
When holding the TOn pin output level is not necessary
Switches the port mode register to input mode. The TOn pin output level goes into Hi-Z output state.
The TAU0EN bit of the PER2 register is cleared to 0. Power-off status
All circuits are initialized and SFR of each channel is also
initialized.
(The TOn bit is cleared to 0 and the TOn pin is set to port
mode.)
Remark n = 00 to 11
Edge
TIn pin Timer counter
detection
(TCRn)
Trigger selection
Remark n = 00 to 11
TSn
TEn
TIn
3 3
2 2 2 2
TCRn 1 1 1 1
0000H 0 0 0
INTTMn
Remark n = 00 to 11
Figure 6-42. Example of Set Contents of Registers in External Event Counter Mode
Slave/master selection
0: Cleared to 0 when single-operation function is selected.
Operation clock selection 0: Selects CK00 (channels 0 to 7) or CK02 (channels 8 to 11) as operation clock
of channel n.
1: Selects CK01 (channels 0 to 7) or CK03 (channels 8 to 11) as operation clock
of channel n.
Remark n = 00 to 11
Figure 6-43. Operation Procedure When External Event Counter Function Is Used
During Set value of the TDRn register can be changed. Counter (TCRn) counts down each time input edge of the
operation The TCRn register can always be read. TIn pin has been detected. When count value reaches
The TSRn register is not used. 0000H, the value of TDRn is loaded to TCRn again, and
Set values of TMRn, TOM0, TOL0, TO0, and TOE0 the count operation is continued. By detecting TCRn =
registers cannot be changed. 0000H, the INTTMn output is generated.
After that, the above operation is repeated.
Operation The TTn bit is set to 1. TEn = 0, and count operation stops.
stop The TTn bit automatically returns to 0 because it is a TCRn holds count value and stops.
trigger bit.
TAUS The TAU0EN bit of the PER2 register is cleared to 0. Power-off status
stop All circuits are initialized and SFR of each channel is
also initialized.
Remark n = 00 to 11
Clock period of TOn output = Ideal TOn output clock period ± Operation clock period (error)
TDRn can be rewritten at any time. The new value of TDRn becomes valid during the next count period.
Edge
TIn pin Timer counter Output
detection TOn pin
(TCRn) controller
Trigger selection
Data register
TSn (TDRn)
Remark n = 10, 11
TSn
TEn
TIn
2 2 2
1 1 1 1 1 1 1
TCRn
0000H 0 0 0 0 0 0 0
TOn
INTTMn
Divided Divided
by 6 by 4
Remark n = 10, 11
Figure 6-46. Example of Set Contents of Registers During Operation as Frequency Divider
Slave/master selection
0: Cleared to 0 when single-operation function is selected.
Operation clock selection 0:Selects CK00 (channels 0 to 7) or CK02 (channels 8 to 11) as operation clock
of channel n.
1:Selects CK01 (channels 0 to 7) or CK03 (channels 8 to 11) as operation clock
of channel n.
Remark n = 10, 11
During Set value of the TDRn register can be changed. Counter (TCRn) counts down. When count value reaches
operation The TCRn register can always be read. 0000H, the value of TDRn is loaded to TCRn again, and the
The TSRn register is not used. count operation is continued. By detecting TCRn = 0000H,
Set values of TO0 and TOE0 registers can be changed. INTTMn is generated and TOn performs toggle operation.
Set values of TMRn, TOM0, and TOL0 registers cannot After that, the above operation is repeated.
be changed.
Operation The TTn bit is set to 1. TEn = 0, and count operation stops.
stop The TTn bit automatically returns to 0 because it is a TCRn holds count value and stops.
trigger bit. The TOn output is not initialized but holds current status.
TOEn is cleared to 0 and value is set to the TO0n bit. The TOn pin outputs the TOn set level.
TAUS To hold the TOn pin output level
stop Clears TOn bit to 0 after the value to The TOn pin output level is held by port function.
be held is set to the port register.
When holding the TOn pin output level is not
necessary
Switches the port mode register to input mode. The TOn pin output level goes into Hi-Z output state.
The TAU0EN bit of the PER2 register is cleared to 0. Power-off status
All circuits are initialized and SFR of each channel is also
initialized.
(The TOn bit is cleared to 0 and the TOn pin is set to port
mode).
Remark n = 10, 11
TIn input pulse interval = Period of count clock × ((10000H × TSRn: OVF) + (Capture value of TDRn + 1))
Caution The TIn pin input is sampled using the operating clock selected with the CKSn bit of the
TMRn register, so an error equal to the number of operating clocks occurs.
CK00 or CK02
Operation clockNote Timer counter
CK01 or CK03 (TCRn)
Trigger selection
Edge
TIn pin
detection Data register Interrupt
(TDRn) Interrupt signal
controller
TSn (INTTMn)
Note The operation clocks of channels 0 to 7 are selected from CK00 and CK01, and those of channels 8 to
11 from CK02 and CK03.
Remark n = 00 to 11
Figure 6-49. Example of Basic Timing of Operation as Input Pulse Interval Measurement (MDn0 = 0)
TSn
TEn
TIn
FFFFH
b c d
TCRn a
0000H
TDRn 0000H a b c d
INTTMn
OVFn
Remark n = 00 to 11
Figure 6-50. Example of Set Contents of Registers to Measure Input Pulse Interval
Slave/master selection
0: Cleared to 0 when single-operation function is selected.
Operation clock selection 0: Selects CK00 (channels 0 to 7) or CK02 (channels 8 to 11) as operation clock
of channel n.
1: Selects CK01 (channels 0 to 7) or CK03 (channels 8 to 11) as operation clock
of channel n.
Remark n = 00 to 11
Figure 6-51. Operation Procedure When Input Pulse Interval Measurement Function Is Used
operation register can be changed. input valid edge is detected, the count value is transferred
The TDRn register can always be read. (captured) to TDRn. At the same time, TCRn is cleared to
The TCRn register can always be read. 0000H, and the INTTMn signal is generated.
The TSRn register can always be read. If an overflow occurs at this time, the OVF bit of the TSRn
Set values of TOM0, TOL0, TO0, and TOE0 registers register is set; if an overflow does not occur, the OVF bit is
cannot be changed. cleared.
After that, the above operation is repeated.
Operation The TTn bit is set to 1. TEn = 0, and count operation stops.
stop The TTn bit automatically returns to 0 because it is a TCRn holds count value and stops.
trigger bit. The OVF bit of the TSRn register is also held.
TAUS The TAU0EN bit of the PER2 register is cleared to 0. Power-off status
stop All circuits are initialized and SFR of each channel is
also initialized.
Remark n = 00 to 11
Signal width of TIn input = Period of count clock × ((10000H × TSRn: OVF) + (Capture value of TDRn + 1))
Caution The TIn pin input is sampled using the operating clock selected with the CKSn bit of the
TMRn register, so an error equal to the number of operating clocks occurs.
Remark n = 00 to 11
Figure 6-52. Block Diagram of Operation as Input Signal High-/Low-Level Width Measurement
Clock selection
CK00 or CK02
Operation clockNote
CK01 or CK03 Timer counter
(TCRn)
Trigger selection
Edge Data register Interrupt
TIn pin (TDRn) Interrupt signal
detection controller
(INTTMn)
Note The operation clocks of channels 0 to 7 are selected from CK00 and CK01, and those of channels 8 to
11 from CK02 and CK03.
Remark n = 00 to 11
Figure 6-53. Example of Basic Timing of Operation as Input Signal High-/Low-Level Width Measurement
TSn
TEn
TIn
FFFFH
a
TCRn b
c
0000H
TDRn 0000H a b c
INTTMn
OVFn
Remark n = 00 to 11
Figure 6-54. Example of Set Contents of Registers to Measure Input Signal High-/Low-Level Width
Slave/master selection
0: Cleared to 0 when single-operation function is selected.
Remark n = 00 to 11
Figure 6-55. Operation Procedure When Input Signal High-/Low-Level Width Measurement Function Is Used
During Set value of the TDRn register can be changed. When the TIn pin start edge is detected, the counter
operation The TCRn register can always be read. (TCRn) counts up from 0000H. If a capture edge of the
The TSRn register is not used. TIn pin is detected, the count value is transferred to TDRn
Set values of TMRn, TOM0, TOL0, TO0, and TOE0 and INTTMn is generated.
registers cannot be changed. If an overflow occurs at this time, the OVF bit of the TSRn
register is set; if an overflow does not occur, the OVF bit is
cleared. TCRn stops the count operation until the next
TIn pin start edge is detected.
After that, the above operation is repeated.
Operation The TTn bit is set to 1. TEn = 0, and count operation stops.
stop TTn bit automatically returns to 0 because it is a trigger TCRn holds count value and stops.
bit. The OVF bit of the TSRn register is also held.
TAUS The TAU0EN bit of PER2 register is cleared to 0. Power-off status
stop All circuits are initialized and SFR of each channel is
also initialized.
Remark n = 00 to 11
Remark The duty factor exceeds 100% if the set value of TDRm (slave) > (set value of TDRn (master) + 1), it
summarizes to 100% output.
The master channel operates in the interval timer mode and counts the periods. When the channel start trigger
(TSn) is set to 1, INTTMn is output. TCRn counts down starting from the loaded value of TDRn, in synchronization
with the count clock. When TCRn = 0000H, INTTMn is output. TCRn loads the value of TDRn again. After that, it
continues the similar operation.
TCRm of a slave channel operates in one-count mode, counts the duty factor, and outputs a PWM waveform from
the TOm pin. TCRm of the slave channel loads the value of TDRm, using INTTMn of the master channel as a start
trigger, and stops counting until the next start trigger (INTTMn of the master channel) is input.
The output level of TOm becomes active one count clock after generation of INTTMn from the master channel, and
inactive when TCRm = 0000H.
Caution To rewrite both TDRn of the master channel and TDRm of the slave channel, a write access is
necessary two times. The timing at which the values of TDRn and TDRm are loaded to TCRn and
TCRm is upon occurrence of INTTMn of the master channel. Thus, when rewriting is performed
split before and after occurrence of INTTMn of the master channel, the TOm pin cannot output
the expected waveform. To rewrite both TDRn of the master and TDRm of the slave, therefore,
be sure to rewrite both the registers immediately after INTTMn is generated from the master
channel.
Master channel
(interval timer mode)
Clock selection
CK00 or CK02
Operation clockNote Timer counter
CK01 or CK03 (TCRn)
Trigger selection
Data register Interrupt
TSn (TDRn) Interrupt signal
controller
(INTTMn)
Slave channel
(one-count mode)
Clock selection
CK00 or CK02
Operation clockNote Timer counter Output
CK01 or CK03 (TCRm) TOm pin
controller
Trigger selection
Note The operation clocks of channels 0 to 7 are selected from CK00 and CK01, and those of channels 8 to 11
from CK02 and CK03.
TSn
TEn
FFFFH
Master
TCRn
channel 0000H
TDRn a b
TOn
INTTMn
TSm
TEm
FFFFH
TCRm
Slave 0000H
channel
TDRm c d
TOm
INTTMm
a+1 a+1 b+1
c c d
Figure 6-58. Example of Set Contents of Registers When PWM Function (Master Channel) Is Used
Slave/master selection
1: Channel 1 is set as master channel.
Figure 6-59. Example of Set Contents of Registers When PWM Function (Slave Channel) Is Used
Slave/master selection
0: Channel 0 is set as slave channel.
changed after INTTMn of the master channel is the same time, the value of the TDRn register is loaded to
generated. TCRn, and the counter starts counting down again.
The TCRn and TCRm registers can always be read. At the slave channel, the value of TDRm is loaded to
The TSRn and TSRm registers are not used. TCRm, triggered by INTTMn of the master channel, and
Set values of the TOL0, TO0, and TOE0 registers cannot the counter starts counting down. The output level of
be changed. TOm becomes active one count clock after generation of
the INTTMn output from the master channel. It becomes
inactive when TCRm = 0000H, and the counting operation
is stopped.
After that, the above operation is repeated.
Operation The TTn (master) and TTm (slave) bits are set to 1 at the
stop same time. TEn, TEm = 0, and count operation stops.
The TTn and TTm bits automatically return to 0 TCRn and TCRm hold count value and stops.
because they are trigger bits. The TOm output is not initialized but holds current
status.
TOEm of slave channel is cleared to 0 and value is set to
the TOm bit. The TOm pin outputs the TOm set level.
TAUS To hold the TOm pin output level
stop Clears TOm bit to 0 after the value to The TOm pin output level is held by port function.
be held is set to the port register.
When holding the TOm pin output level is not
necessary
Switches the port mode register to input mode. The TOm pin output level goes into Hi-Z output state.
The TAU0EN bit of the PER2 register is cleared to 0. Power-off status
All circuits are initialized and SFR of each channel is
also initialized.
(The TOm bit is cleared to 0 and the TOm pin is set to
port mode.)
The master channel operates in the one-count mode and counts the delays. TCRn of the master channel starts
operating upon start trigger detection and TCRn loads the value of TDRn. TCRn counts down from the value of TDRn
it has loaded, in synchronization with the count clock. When TCRn = 0000H, it outputs INTTMn and stops counting
until the next start trigger is detected.
The slave channel operates in the one-count mode and counts the pulse width. TCRm of the slave channel starts
operation using INTTMn of the master channel as a start trigger, and loads the TDRm value. TCRm counts down
from the value of TDRm it has loaded, in synchronization with the count value. When TCRm = 0000H, it outputs
INTTMm and stops counting until the next start trigger (INTTMn of the master channel) is detected. The output level
of TOm becomes active one count clock after generation of INTTMn from the master channel, and inactive when
TCRm = 0000H.
Instead of using the TIn pin input, a one-shot pulse can also be output using the software operation (TSn = 1) as a
start trigger.
Caution The timing of loading of TDRn of the master channel is different from that of TDRm of the slave
channel. If TDRn and TDRm are rewritten during operation, therefore, an illegal waveform is
output. Be sure to rewrite TDRn and TDRm after INTTMn of the channel to be rewritten is
generated.
Master channel
(one-count mode)
Clock selection
CK00 or CK02
Operation clockNote Timer counter
CK01 or CK03 (TCRn)
Trigger selection
TSn Data register Interrupt
(TDRn) Interrupt signal
Edge controller
TIn pin (INTTMn)
detection
Slave channel
(one-count mode) Clock selection
CK00 or CK02
Operation clockNote Timer counter Output
CK01 or CK03 (TCRm) TOm pin
controller
Trigger selection
Note The operation clocks of channels 0 to 7 are selected from CK00 and CK01, and those of channels 8 to 11
from CK02 and CK03.
Figure 6-62. Example of Basic Timing of Operation as One-Shot Pulse Output Function
TSn
TEn
TIn
Master
FFFFH
channel
TCRn
0000H
TDRn a
TOn
INTTMn
TSm
TEm
FFFFH
TCRm
Slave 0000H
channel
TDRm b
TOm
INTTMm
a+2 b a+2 b
Slave/master selection
1: Channel 1 is set as master channel.
Slave/master selection
0: Channel 0 is set as slave channel.
The TCRn and TCRm registers can always be read. counter stops until the next valid edge is input to the TIn
The TSRn and TSRm registers are not used. pin.
Set values of the TOL0, TO0, and TOE0 registers can be The slave channel, triggered by INTTMn of the master
changed. channel, loads the value of TDRm to TCRm, and the
counter starts counting down. The output level of TOm
becomes active one count clock after generation of
INTTMn from the master channel. It becomes inactive
when TCRm = 0000H, and the counting operation is
stopped.
After that, the above operation is repeated.
Operation The TTn (master) and TTm (slave) bits are set to 1 at the
stop same time. TEn, TEm = 0, and count operation stops.
The TTn and TTm bits automatically return to 0 TCRn and TCRm hold count value and stops.
because they are trigger bits. The TOm output is not initialized but holds current
status.
TOEm of slave channel is cleared to 0 and value is set to
the TOm bit. The TOm pin outputs the TOm set level.
TAUS To hold the TOm pin output level
stop Clears TOm bit to 0 after the value to The TOm pin output level is held by port function.
be held is set to the port register.
When holding the TOm pin output level is not
necessary
Switches the port mode register to input mode. The TOm pin output level goes into Hi-Z output state.
The TAU0EN bit of the PER2 register is cleared to 0. Power-off status
All circuits are initialized and SFR of each channel is
also initialized.
(The TOm bit is cleared to 0 and the TOm pin is set to
port mode.)
Remark Although the duty factor exceeds 100% if the set value of TDRp (slave 1) > {set value of TDRn
(master) + 1} or if the {set value of TDRq (slave 2)} > {set value of TDRn (master) + 1}, it is
summarized into 100% output.
TCRn of the master channel operates in the interval timer mode and counts the periods.
TCRp of the slave channel 1 operates in one-count mode, counts the duty factor, and outputs a PWM waveform
from the TOp pin. TCRp loads the value of TDRp to TCRp, using INTTMn of the master channel as a start trigger,
and start counting down. When TCRp = 0000H, TCRp outputs INTTMp and stops counting until the next start trigger
(INTTMn of the master channel) has been input. The output level of TOp becomes active one count clock after
generation of INTTMn from the master channel, and inactive when TCRp = 0000H.
In the same way as TCRp of the slave channel 1, TCRq of the slave channel 2 operates in one-count mode, counts
the duty factor, and outputs a PWM waveform from the TOq pin. TCRq loads the value of TDRq to TCRq, using
INTTMn of the master channel as a start trigger, and starts counting down. When TCRq = 0000H, TCRq outputs
INTTMq and stops counting until the next start trigger (INTTMn of the master channel) has been input. The output
level of TOq becomes active one count clock after generation of INTTMn from the master channel, and inactive when
TCRq = 0000H.
When channel 0 is used as the master channel as above, up to seven types of PWM signals can be output at the
same time.
Caution To rewrite both TDRn of the master channel and TDRp of the slave channel 1, write access is
necessary at least twice. Since the values of TDRn and TDRp are loaded to TCRn and TCRp after
INTTMn is generated from the master channel, if rewriting is performed separately before and
after generation of INTTMn from the master channel, the TOp pin cannot output the expected
waveform. To rewrite both TDRn of the master and TDRp of the slave, be sure to rewrite both the
registers immediately after INTTMn is generated from the master channel (This applies also to
TDRq of the slave channel 2).
Figure 6-66. Block Diagram of Operation as Multiple PWM Output Function (Output Two Types of PWMs)
Master channel
(interval timer mode)
Clock selection
CK00 or CK02
Operation clockNote Timer counter
CK01 or CK03 (TCRn)
Trigger selection
Data register Interrupt
TSn (TDRn) Interrupt signal
controller
(INTTMn)
Slave channel 1
(one-count mode)
Clock selection
CK00 or CK02
Operation clockNote
Timer counter Output
CK01 or CK03 (TCRp) TOp pin
controller
Trigger selection
Slave channel 2
(one-count mode)
Clock selection
CK00 or CK02
Operation clockNote Timer counter Output
CK01 or CK03 (TCRq) TOq pin
controller
Trigger selection
Note The operation clocks of channels 0 to 7 are selected from CK00 and CK01, and those of channels 8 to 11
from CK02 and CK03.
Figure 6-67. Example of Basic Timing of Operation as Multiple PWM Output Function (Output Two Types of PWMs)
TSn
TEn
FFFFH
Master
TCRn
channel 0000H
TDRn a b
TOn
INTTMn
TSp
TEp
FFFFH
TCRp
Slave 0000H
channel 1
TDRp c d
TOp
INTTMp
a+1 a+1 b+1
c c d d
TSq
TEq
FFFFH
TCRq
Slave 0000H
channel 2
TDRq e f
TOq
INTTMq
a+1 a+1 b+1
e e f f
Slave/master selection
1: Channel 1 is set as master channel.
Slave/master selection
0: Channel 0 is set as slave channel.
Remark n = 00, 02, 04, 06, 08, 10 n < p < q ≤ 11 (However, p and q are consecutive integers.)
Figure 6-70. Operation Procedure When Multiple PWM Output Function Is Used (Output Two Types of
PWMs) (1/2)
Figure 6-70. Operation Procedure When Multiple PWM Output Function Is Used (Output Two Types of
PWMs (2/2)
The μPD79F9211 can be used as an inverter control function and for motor control by using timer array unit TAUS
(hereinafter referred to as “TAUS”) and the TAUS option unit. It can be used with an operation clock having a 40 MHz
maximum resolution (when the internal high-speed oscillation clock is used). Furthermore, the A/D converter start
timing can be generated.
The following operations can be performed by using the inverter control function.
(5) A/D converter start timing setting function (Four types of timings can be generated.)
The A/D converter start timing can be output by using channels 8 and 9 of the TAUS.
(7) Forward and reverse settings of the timer output can be performed for each pin.
(8) Real-time output function (PWM modulation can be performed with this function)
The inverter function can be achieved by adding functions to timer array unit TAUS.
The hardware configuration of timer array unit TAUS and the inverter control function block is shown below.
Table 7-1. Configuration of Timer Array Unit TAUS and Inverter Control Function Block
Item Configuration
Note
Timer/counter Timer counter register n (TCRn)
Note
Register Timer data register n (TDRn)
Timer input TI02 to TI07, TI109, TI10, TI11, SLTI pins, RxD0 pin (for LIN-bus)
Timer output TO02 to TO07, TO10, TO11, SLTO pins, output controller
Control registers <Registers of unit setting block>
• Peripheral enable register 2 (PER2)
Note
Note. The inverter control function can be achieved by adding option functions to timer array unit TAUS. In this
chapter, only the registers to be used with the inverter control function are described. For other registers
that are to be used in common with timer array unit TAUS, refer to CHAPTER 6 TIMER ARRAY UNIT
TAUS.
Figure 7-1. Entire Configuration of Timer Array Unit TAUS and Inverter Control Function Block
Peripheral enable register 2 (PER2) Timer clock select register 0 (TPS0) TAU option mode register (OPMR)
PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS OPM HPS HSM HDM ATS ATS ATS ATS TLS TLS TLS TLS TLS TLS HIS HIS
TAUOPEN TAU0EN
033 032 031 030 023 022 021 020 013 012 011 010 003 002 001 000 3 2 1 0 7 6 5 4 3 2 1 0
TO00
INTTM00
TO02
Interrupt INTTMM0
INTTM02 signal INTTMV0
TI02
Channel 2 output INTTMM1
circuit INTTMV1
TO03
INTTM03
TI03
Channel 3 TO02
TO04 TO03
INTTM04 Real-time
output TO04
Channel 4 period TO05
controller
TI04 detection signal
Selector
Channel 4 TO06
TI05 INTTM05
ISC4 to ISC2 bits
Channel 5 of the ISC register
TO06
TI06 INTTM06
Channel 6
Selector
ISC1 SLTO
TO07
Selector
TI07
INTTM07 Hi-Z
RxD0
(serial input pin) controller
Channel 7 (LIN-bus supported)
TO10
TO08 TO11
INTTM08
Channel 8
TO09
TI09 INTTM09
Channel 9
TO10
TI10 INTTM10
Channel 10
A/D
TO11 conversion A/D
trigger converter
TI11 INTTM11 output
Channel 11 selector
Remark The configuration diagram in Figure 7-1 includes the registers and pins that are to be used in common
with timer array unit TAUS. For details of timer array unit TAUS, refer to CHAPTER 6 TIMER ARRAY
UNIT TAUS.
TRE TRE TRE TRE TRE TRE TRE TRE TRE TRE TRE TRE Timer real-time output TOM TOM TOM TOM TOM TOM TOM TOM TOM TOM TOM TOM Timer output mode
11 10 09 08 07 06 05 04 03 02 01 00 enable register 0 (TRE0) 11 10 09 08 07 06 05 04 03 02 01 00 register 0 (TOM0)
TRO TRO TRO TRO TRO TRO TRO TRO TRO TRO TRO TRO Timer real-time output TOL TOL TOL TOL TOL TOL TOL TOL TOL TOL TOL TOL Timer output level
11 10 09 08 07 06 05 04 03 02 01 00 register 0 (TRO0) 11 10 09 08 07 06 05 04 03 02 01 00 register 0 (TOL0)
Real-time TO03
Slave/master Interrupt
TI03 controller controller output selector
INTTM03
Channel 3
Shifting up or down to slave channel Interrupt signal to
Trigger signal to slave channel a lower channel Trigger signal to
Clock signal to slave channel a lower channel
Interrupt signal to slave channel
CK00
clock selection
Timer
Count clock
Operation
TCLK Output
selection
MCK controller
CK01 controller TO04
(timer output pin)
Mode Output latch
fXT/4 selection (P12) PM12
Interrupt INTTM04
controller (timer interrupt)
Selector
Edge
detection Channel 4 period
selection
Trigger
detection signal
Timer status
TIS04
register 04 (TSR04)
MAS
CKS04 CKS14 CCS04 STS042 STS041 STS040 CIS041 CIS040 MD043 MD042 MD041 MD040
TER04
TO05
TI05 INTTM05
Channel 5
Remark The block diagram in Figure 7-2 includes the registers and pins that are to be used in common with timer
array unit TAUS. For details of timer array unit TAUS, refer to CHAPTER 6 TIMER ARRAY UNIT TAUS.
The above-mentioned registers are used in common with timer array unit TAUS.
For details, refer to 6.2 Configuration of Timer Array Unit TAUS.
7.3 Registers Controlling Timer Array Unit TAUS and Inverter Control Function Block
The following registers control timer array unit TAUS and the inverter control function block.
Note The inverter control function can be achieved by adding option functions to timer array unit TAUS. In this
chapter, only the registers to be used with the inverter control function are described. For other registers
that are to be used in common with timer array unit TAUS, refer to CHAPTER 6 TIMER ARRAY UNIT
TAUS.
Remark n = 00 to 11
Cautions 1. When setting timer array unit TAUS and the inverter control function, be sure to set
TAU0EN and TAUOPEN to 1 first. If TAU0EN and TAUOPEN are set to 0, writing to a
control register of timer array unit TAUS and the inverter control function is ignored, and
all read values are default values.
2. Be sure to clear bits 2 to 7 of the PER2 register to 0.
The above-mentioned registers (2) to (12) are used in common with timer array unit TAUS.
For details, refer to 6.2 Configuration of Timer Array Unit TAUS.
Figure 7-4. Format of Timer Triangle Wave Output Mode Register 0 (TOT0)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TOT0 0 0 0 0 TOT TOT TOT TOT TOT TOT TOT TOT TOT TOT TOT TOT
11 10 09 08 07 06 05 04 03 02 01 00
0 Sets by a master channel timer interrupt request signal (INTTMn) and resets by a slave channel
timer interrupt request signal (INTTMm).
1 Sets by a timer interrupt request signal during a down status (INTTMn) and resets by a timer
Note
interrupt request signal during an up status (INTTMm) .
Note Set the slave channel to TOTn = 1 when triangle wave PWM has been generated.
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TRE0 0 0 0 0 TRE TRE TRE TRE TRE TRE TRE TRE TRE TRE TRE TRE
11 10 09 08 07 06 05 04 03 02 01 00
Remark n = 00 to 11
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TRO0 0 0 0 0 TRO TRO TRO TRO TRO TRO TRO TRO TRO TRO TRO TRO
11 10 09 08 07 06 05 04 03 02 01 00
0 Low level
1 High level
Remark n = 00 to 11
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TRC0 0 0 0 0 TRC TRC TRC TRC TRC TRC TRC TRC TRC TRC TRC TRC
11 10 09 08 07 06 05 04 03 02 01 00
Remark n = 00 to 11
Figure 7-8. Format of Timer Dead Time Output Enable Register 0 (TDE0)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TDE0 0 0 0 0 TDE TDE TDE TDE TDE TDE TDE TDE TDE TDE TDE TDE
11 10 09 08 07 06 05 04 03 02 01 00
Remark n = 00 to 11
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TME0 0 0 0 0 TME TME TME TME TME TME TME TME TME TME TME TME
11 10 09 08 07 06 05 04 03 02 01 00
Remark n = 00 to 11
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OPMR OPM HPS HSM HDM ATS ATS ATS ATS TLS TLS TLS TLS TLS TLS HIS0 HIS
3 2 1 0 7 6 5 4 3 2 1 0
0 6-phase output control mode (TO02 to TO07 become Hi-Z control targets, and Hi-Z control and
cancellation are set by the HDM bit.)
1 Half-bridge output control mode (when channel 0 and channel 4 are the period registers)
(TO02 and TO03 are set to Hi-Z by the TMOFF0 pin or internal comparator CMP0. TO06 and TO07
are set to Hi-Z by the TMOFF1 pin or internal comparator CMP1. A Hi-Z state is cancelled by the
HSM bit.)
0 Uses the TMOFF0 and TMOFF1 pins as the Hi-Z control signal.
1 Uses the internal comparator output signal as the Hi-Z control signal.
0 A Hi-Z state can be cancelled in synchronization with the period after the inactive edge of an internal
comparator (CMP0/CMP1) or TMOFF0, TMOFF1 is detected.
1 A Hi-Z state can be cancelled in synchronization with the period after the edge by a software write is
detected.
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OPMR OPM HPS HSM HDM ATS ATS ATS ATS TLS TLS TLS TLS TLS TLS HIS HIS
3 2 1 0 7 6 5 4 3 2 1 0
0 0 Generates an A/D trigger for the match interrupt during a down status period of the master
channel.
0 1 Generates an A/D trigger for the match interrupt during an up status period of the master
channel.
1 0 Match interrupt during an up or a down status period of the master channel
1 1 Match interrupt during an up or a down status period of the master channel + valley interrupt
of the master channel
0 0 Generates an A/D trigger for the match interrupt during a down status period of the master
channel.
0 1 Generates an A/D trigger for the match interrupt during an up status period of the master
channel.
1 0 Match interrupt during an up or a down status period of the master channel
1 1 Match interrupt during an up or a down status period of the master channel + valley interrupt
of the master channel
Remark n = 2 to 7
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Figure 7-12. Format of TAU Option Hi-Z Start Trigger Register (OPHS)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 −
1 High level (output port Hi-Z output)
0 −
1 High level (output port Hi-Z output)
Remark n = 02 to 07
Figure 7-13. Format of TAU Option Hi-Z Stop Trigger Register (OPHT)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 −
1 Low level (output port Hi-Z cancellation)
0 −
1 Low level (output port Hi-Z cancellation)
Remark n = 02 to 07
The above-mentioned registers (23) to (25) are used in common with timer array unit TAUS.
For details, refer to 6.2 Configuration of Timer Array Unit TAUS.
The channel to which TRCn = 1 was set becomes the real-time output trigger generation channel and operates in
the interval timer mode.
TCRn loads the value of TDRn at the first count clock, after the channel start trigger bit (TSn) is set to 1. At this
time, INTTMn is not output and TOn is not toggled when MDn0 of TMRn is 0. INTTMn is output and TOn is toggled
when MDn0 of TMRn is 1.
Afterward, TCRn counts down along with the count clock.
When TCRn has become 0000H, INTTMn is output and TOn is toggled upon the next count clock. TCRn loads the
value of TDRn again at the same timing. Similar operation is continued hereafter.
The set value of TROn is output from TOn at the INTTMn output timing of the real-time output trigger generation
channel.
TOm of the lower channel (real-time output channel (TRCm = 0)) of the real-time output trigger generation channel
(TRCn = 1) is controlled by the TREm and TRCm bits. The TOm output level will not change by only rewriting TROm.
When TREm of the real-time output channel (TRCm = 0) is 1, TOm outputs the set value of TROm at the INTTMn
output timing of the real-time output trigger generation channel. When TREm or TRCm of the lower channel is 0 or 1,
TOm is not toggled at the INTTMn output timing of the real-time output trigger generation channel.
When this function is used, TCRm, TDRm, and INTTMm of the lower channel can be operated as different
functions.
Remark n = 01 to 10
m = 02 to 11
selection
CK00 or CK02
Clock
Operation clockNote Timer counter
CK01 or CK03 (TCRn)
Output
TOn pin
controller
selection
Trigger
Data register Interrupt
TSn (TDRn) controller Interrupt signal
(INTTMn)
Real-time output
controller
Note The operation clocks of channels 0 to 7 are selected from CK00 and CK01, and those of channels 8 to 11
from CK02 and CK03.
Remark n = 01 to 10
m = 02 to 11
Figure 7-15. Example of Basic Timing of Operation as Real-Time Output Function (Type 1) (MDn0 = 1)
TSn
TEn
FFFFH
Real-time output trigger
TCRn
generation channel 0000H
TDRn a b
INTTMn
TROn
TOn
TROm
Real-time output
channel
TOm
Remark n = 01 to 10
m = 02 to 11
(a) Timer mode register n (TMRn) of real-time output trigger generation channel (TRCn = 1)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRn CKSn CCS1n CCS0n
TERn
STSn2 STSn1 STSn0 CISn1 CISn0 MDn4 MDn3 MDn2 MDn1 MDn0
1/0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1/0
Slave/master selection
0: Cleared to 0 when single-operation function is selected.
Remark n = 01 to 10
operation The TCRn register can always be read. 0000H, the value of TDRn is loaded to TCRn again and the
Set values of the TROn and TROm bits can be count operation is continued. By detecting TCRn = 0000H,
changed. INTTMn is generated. After that, the above operation is
repeated.
The set value of TROm of the real-time output channel is
output from TOm at the INTTMn output timing.
Operation The TTn bit is set to 1. TEn = 0, and count operation stops.
stop The TTn bit automatically returns to 0 because it is a TCRn holds count value and stops.
trigger bit. The TOn output is not initialized but holds current status
and stops.
The TOEn and TOEm bits are cleared to 0 and values The set values of TOn and TOm initialize the outputs of TOn
are set to TOn and TOm. and TOm.
Remark n = 01 to 10, m = 02 to 11
Remark n = 01 to 10, m = 02 to 11
The channel to which TRCn = 1 was set becomes the real-time output trigger generation channel and operates as
an up counter in the capture mode.
TCRn starts counting up from 0000H along with the count clock, when the channel start trigger (TSn) is set to 1
while TEn is 0 or when the valid edge of the TIn input is detected.
At this time, INTTMn is not output and TOn is not toggled when MDn0 of the TMRn register is 0. INTTMn is output
and TOn is toggled when MDn0 of the TMRn register is 1.
The counter (TCRn) is cleared to 0000H and INTTMn is output at the same time the count value is transferred
(captured) to TDRn, when the valid edge of the TIn pin input is detected or when the channel start trigger (TSn) is set
to 1.
The set value of TROn is output from TOn at the INTTMn output timing of the real-time output trigger generation
channel.
TOm of the lower channel (real-time output channel) of the real-time output trigger generation channel (TRCn = 1)
is controlled by the TREm bit. The TOm output level will not change by only rewriting TROm.
When TREm of the real-time output channel (TRCm = 0) is 1, TOm outputs the set value of TROm at the INTTMn
output timing of the real-time output trigger generation channel. When TREm or TRCm of the lower channel is 0 or 1,
real-time output is not performed at the INTTMn output timing of the real-time output trigger generation channel.
When the real-time output function (type 2) is used, TCRm, TDRm, and INTTMn of the lower channel can be
operated as different functions.
Remark n = 01 to 10
m = 02 to 11
selection
CK00 or CK02
Clock
Operation clockNote Timer counter
CK01 or CK03 (TCRn)
Output TOn pin
controller
TSn
selection
Trigger
Data register Interrupt
TIn pin Edge Interrupt signal
(TDRn) controller
detection (INTTMn)
Timer real-time
TROm output register 0 (TRO0)
Real-time output
controller
Note The operation clocks of channels 0 to 7 are selected from CK00 and CK01, and those of channels 8 to 11
from CK02 and CK03.
Remark n = 01 to 10
m = 02 to 11
Figure 7-19. Example of Basic Timing of Operation as Real-Time Output Function (Type 2) (MDn0 = 1)
TSn
TEn
TIn
TDRn 0000H a b c d
INTTMn
OVF
TROn
TOn
TROm
Real-time output
channel
TOm
Remark n = 01 to 10
m = 02 to 11
(a) Timer mode register n (TMRn) of real-time output trigger generation channel (TRCn = 1)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRn CKSn CCS1n CCS0n MAS STSn2 STSn1 STSn0 CISn1 CISn0 MDn4 MDn3 MDn2 MDn1 MDn0
TERn
1/0 0 0 0 0 0 0 1 1/0 1/0 0 0 0 1 0 1/0
Slave/master selection
0: Cleared to 0 when single-operation function is selected.
Remark n = 01 to 10
m = 02 to 11
Remark n = 01 to 10
m = 02 to 11
TCR00 of the master channel operates in the interval timer mode and counts the periods.
With the 6-phase PWM output function, the operation mode of slave channel 1 will not be fixed and can be set
freely.
(To use the modulated-output function, slave channel 1 is used as the real-time output trigger generation channel.)
TCRm of slave channels 2 to 7 operates in one-count mode, counts the duty factor, and outputs a PWM waveform
from the TOm pin. TCRm loads the value of TDRm to TCRm, using INTTM00 of the master channel as a start trigger,
and starts counting down. When TCRm = 0000H, TCRm outputs INTTMm and stops counting until the next start
trigger (INTTM00 of the master channel) has been input. The output level of TOm becomes active one count clock
after generation of INTTM00 from the master channel, and inactive when TCRm = 0000H.
TDR00 and TDRm of the master channel and slave channel become valid from the next period (generation of
INTTM00 of the master channel).
Caution To rewrite both TDR00 of the master channel and TDRm of slave channels 2 to 7, write access is
necessary at least twice. Since the values of TDR00 and TDRm are loaded to TCR00 and TCRm
after INTTM00 is generated from the master channel, if rewriting is performed separately before
and after generation of INTTM00 from the master channel, the TOm pin cannot output the
expected waveform. To rewrite both TDR00 of the master and TDRm of the slave, be sure to
rewrite both the registers immediately after INTTM00 is generated from the master channel.
Remark m = 02 to 07
Master channel
(interval timer mode)
selection
CK00
Clock
Operation clock Timer counter Output
CK01 (TCR00) TO00 pin
controller
selection
Trigger
Data register Interrupt
TS00 (TDR00) controller Interrupt signal
(INTTM00)
Slave channel 2
(one-count mode)
selection
Clock
Slave channel 7
(one-count mode)
selection
Clock
Figure 7-23. Example of Basic Timing of Operation as 6-Phase PWM Output Function
TS00
TE00
FFFFH
Master
TCR00
channel 0000H
TDR00 a b
TO00
INTTM00
TS02
TE02
FFFFH
TCR02
Slave 0000H
channel 2
TDR02 c d
TO02
INTTM02
a+1 a+1 b+1 b+1
c d d d
TS07
TE07
FFFFH
TCR07
Slave 0000H
channel 7
TDR07 e f
TO07
INTTM07
a+1 a+1 b+1 b+1
e e f f
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMR00 CKS00 CCS100 CCS000 MAS STS002 STS001 STS000 CIS001 CIS000 MD004 MD003 MD002 MD001 MD000
TER00
1/0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1
Slave/master selection
1: Channel 1 is set as master channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRm CKSm CCS1m CCS0m
TERm
STSm2 STSm1 STSm0 CISm1 CISm0 MDm4 MDm3 MDm2 MDm1 MDm0
0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1
Slave/master selection
0: Channel 0 is set as slave channel.
Figure 7-26. Operation Procedure When 6-Phase PWM Output Function Is Used (1/2)
During Set values of the TDR00 and TDRm registers can be The counter of the master channel loads the TDR00 value to
operation changed after INTTM00 of the master channel is TCR00 and counts down. When the count value reaches
generated. TCR00 = 0000H, INTTM00 is generated. At the same time,
The TCR00 and TCRm registers can always be read. the value of the TDR00 register is loaded to TCR00, and the
Set values of the TOL0, TO0, and TOE0 registers can counter starts counting down again.
be changed. At slave channels 2 to 7, the values of the TDRm register
are transferred to TCRm, triggered by INTTM00 of the
master channel, and the counter starts counting down. The
output levels of TOm become active one count clock after
generation of the INTTM00 output from the master channel.
It becomes inactive when TCRm = 0000H, and the counting
operation is stopped. After that, the above operation is
repeated.
Remark m = 02 to 07
Operation is resumed. Figure 7-26. Operation Procedure When 6-Phase PWM Output Function Is Used (2/2)
Operation The TT00 (master) and TTm (slaves 2 to 7) bits are set
stop to 1 at the same time. TE00, TEm = 0, and count operation stops.
The TT00 and TTm bits automatically return to 0 TCR00 and TCRm hold count value and stops.
because they are trigger bits. The TOm output is not initialized but holds current status.
The TOEm bits of slave channels 2 to 7 are cleared to 0
and value is set to the TOm bit. The TOm pin outputs the TOm set level.
TAUS To hold the TOm pin output level
stop Clears the TOm bit to 0 after the value to be held is
set to the port register. The TOm pin output level is held by port function.
When holding the TOm pin output level is not necessary
Switches the port mode register to input mode. The TOm pin output level goes into Hi-Z output state.
The TAU0EN and TAUOPEN bits of the PER2 register
are cleared to 0. Power-off status
All circuits are initialized and SFR of each channel is also
initialized.
(The TO00 and TOm bits are cleared to 0 and the TO00
and TOm pins are set to port mode.)
Remark m = 02 to 07
Pulse period (down/up) = {Set value of TDR00 (master) + 1} × 2 × Count clock period
Duty factor [%] = {Set value of TDR00 (master) + 1 − Set value of TDRm (slave)}/{Set value of TDR00
(master) + 1} × 100
0% output: Set value of TDRm (slave) ≥ {Set value of TDR00 (master) + 1}
100% output: Set value of TDRm (slave) = 0000H
Remark Although the duty factor exceeds 0% if the set value of TDRm (slave) > {set value of TDR00 (master)
+ 1}, it is summarized into 0% output.
The master channel operates in the interval timer mode and counts the periods.
TCR00 loads the value of TDR00 at the first count clock, after the channel start trigger bit (TS00) is set to 1. At this
time, INTTM00 is not output and TO00 is not toggled when MDn0 of TMR00 is 0. INTTM00 is output and TO00 is
toggled when MDn0 of TMRn is 1.
Afterward, TCRn counts down along with the count clock.
When TCR00 has become 0000H, INTTM00 is output and TO00 is toggled upon the next count clock. TCR00
loads the value of TDR00 again at the same timing. Similar operation is continued hereafter.
TCRm of the slave channel operates in the up and down count mode, and counts the duty.
TCRm loads the value of TDRm at the first count clock, after the channel start trigger bit (TSm) is set to 1.
Hereafter, counting up and counting down is switched in accordance with the operation of the master channel.
INTTMm is output when TCRm becomes 0000H.
The TOm output becomes an active level when TCRm generates INTTMm while counting down, and it becomes
an inactive level when TCRm generates INTTMm while counting up.
TCRm loads the value of TDRm again when INTTM00 is generated in an up status of the master channel. Similar
operation is continued hereafter.
Remark m = 02 to 07
Caution TDR00 of the master channel must be rewritten during an up status period of the slave channel.
When the value of TDR00 is rewritten separately during an up status and a down status, the
periods of the up status and down status differ and the TO00 pin cannot output an expected
waveform, because the value of TDR00 of the rewritten master channel becomes valid during the
next down status period.
Figure 7-27. Block Diagram of Operation as Triangular Wave PWM Output Function
Master channel
(interval timer mode)
selection
CK00
Clock
Operation clock Timer counter Output
CK01 (TCR00) TO00 pin
controller
selection
Trigger
Data register Interrupt
TS00 (TDR00) controller Interrupt signal
(INTTM00)
Slave channel
(up and down count mode)
selection
Clock
Remark m = 02 to 07
Figure 7-28. Example of Basic Timing of Operation as Triangular Wave PWM Output Function
TS00
TE00
FFFFH
Master
TCR00
channel 0000H
TDR00 a b
TO00
INTTM00
a+1 a+1 b+1 b+1
Down Up Down Up
status status status status
TSm
TEm
TCRm
Slave 0001H
channel
TDRm e f
INTTMm
TOm
e (a + 1 − e) × 2 e f (b + 1 − f) × 2 f
Remark m = 02 to 07
Figure 7-29. Example of Set Contents of Registers When Triangular Wave PWM Output Function (Master
Channel) Is Used
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMR00 CKS00 CCS100 CCS000
TER00
STS002 STS001 STS000 CIS001 CIS000 MD004 MD003 MD002 MD001 MD000
1/0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1/0
Slave/master selection
1: Channel 1 is set as master channel.
Figure 7-30. Example of Set Contents of Registers When Triangular Wave PWM Output Function (Slave
Channel) Is Used
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRm CKSm CCS1m CCS0m
TERm
STSm2 STSm1 STSm0 CISm1 CISm0 MDm4 MDm3 MDm2 MDm1 MDm0
0 0 1 0 0 1 1 1 0 0 0 1 0 0 1 0
Slave/master selection
0: Channel 0 is set as slave channel.
Figure 7-31. Operation Procedure When Triangular Wave PWM Output Function Is Used (1/2)
Remark m = 02 to 07
Figure 7-31. Operation Procedure When Triangular Wave PWM Output Function Is Used (2/2)
Remark m = 02 to 07
7.4.5 Operation as triangular wave PWM output function with dead time
The triangular wave PWM output function with dead time uses four channels of channels 0 to 3 or channels 4 to 7
in combination to output a triangular wave PWM waveform (with dead time).
It outputs triangular wave PWM output signals with dead times from slave channels 2 and 3, and slave channels 6
and 7. Slave channels 1 and 5 can be operated in any operation mode. (With this function, the operation modes of
slave channels 1 and 5 will not be fixed.)
The output pulse period, duty factor (positive phase), and duty factor (reverse phase) can be calculated by the
following expression.
Pulse period (down/up) = {Set value of TDRn (master) + 1} × 2 × Count clock period
Duty factor (positive phase) [%] = {{Set value of TDRn (master) + 1} − {Set value of TDRp (slave p)} × 2
− {Set value of TDRq (slave q) + 1}} × Count clock period
Duty factor (reverse phase) [%] = {{Set value of TDRn (master) + 1} − {Set value of TDRp (slave p)} × 2
+ {Set value of TDRq (slave q) + 1}} × Count clock period
Errors will be included in the output waveforms when the dead time function is used. The output width of a
positive-phase wave will be shortened by the amount of dead time, and the output width of a reverse- phase wave will
be extended by the amount of dead time. The linearity of output transition will be lost in the neighborhood of 0% and
100% outputs due to the errors.
Remark n = 00, 04
p = 02, 06
q = 03, 07
Slave channels 1 and 5 are not used as PWM output functions with dead times.
Dead time is controlled by using slave channel p (p = 2, 6) and slave channel q (q = 3, 7) in combination. The
triangular wave PWM output function with dead time uses master channel 0, slave channel 2, and slave channel 3,
and master channel 4, slave channel 6, and slave channel 7 in combination.
TCRp of slave channel p operates in the up and down count mode, and counts the duty. TCRp loads the value of
TDRp at the first count clock, after the channel start trigger bit (TSp) is set to 1. Hereafter, counting up and counting
down is switched in accordance with the operation of the master channel. INTTMp is output when TCRp becomes
0001H.
TCRp loads the value of TDRp again when INTTMn is generated in an up status of the master channel. Similar
operation is continued hereafter.
TCRq of slave channel q operates in the one-count mode, and counts the dead time.
TCRq loads the value of TDRq and counts down by using INTTMp of slave channel p as the start trigger. When
TCRq becomes 0000H, it outputs INTTMq and stops counting until the next start trigger is input (INTTMp of slave
channel p).
A triangular wave PWM waveform with dead time is output by changing TOp and TOq by the count operation
(INTTMp, INTTMq) of slave channel p (duty) and slave channel q (dead time). A positive-phase waveform and a
reverse-phase waveform are output by controlling the TOLp and TOLq bits of the TOL0 registers of slave channel p
and slave channel q.
The set condition of TOp (TOLp = 0) is the generation of INTTMq by the operation of slave channel q, which uses
the generation of INTTMp while the TCRp register counts down as the start trigger. The reset condition of TOp (TOLp
= 0) is the generation of INTTMp of slave channel p while TCRp counts up.
The set condition of TOq (TOLq = 1) is the generation of INTTMp while the TCRp register counts down. The reset
condition of TOq (TOLq = 0) is the generation of INTTMq by the operation of slave channel q, which uses the
generation of INTTMp while TCRp counts down as the start trigger.
Caution TDRn of master channel n must be rewritten during an up status period of slave channel p.
When the value of TDRn is rewritten during a down status period, the periods of the down status
and up status differ and an expected waveform cannot be output, because the value of TDRn of
the rewritten master channel becomes valid at the next period.
The value of TDRp of slave channel p becomes valid from the next carrier period (up and down trigger detection).
The value of TDRq of slave channel q becomes valid from the next start timing (dead time control trigger detection).
Remark n = 00, 04
p = 02, 06
q = 03, 07
Figure 7-32. Block Diagram of Operation as Triangular Wave PWM Output Function with Dead Time
Master channels 0, 4
(interval timer mode)
selection
CK00
Clock
Operation clock Timer counter Output
CK01 (TCRn) TOn pin
controller
selection
Trigger
Data register Interrupt
TSn (TDRn) controller Interrupt signal
(INTTMn)
Slave channels 2, 6
(up and down count mode)
selection
Clock
Slave channels 3, 7
(one-count mode)
selection
Clock
Remark n = 00, 04
p = 02, 06
q = 03, 07
Figure 7-33. Example of Basic Timing of Operation as Triangular Wave PWM Output Function with Dead Time
TSn
TEn
FFFFH
Master TCRn
channels 0, 4 0000H
TDRn a b
TOn
INTTMn
a+1 a+1 b+1 b+1
Down Up Down Up
status status status status
TSp
TEp
TCRp
0001H
Slave
channels 2, 6
TDRp e f
INTTMp
e (a + 1 − e) × 2 e f (b + 1 − f) × 2 f
TSq
TEq
TCRq
0000H
Slave
channels 3, 7
TDRq g
INTTMq
g+1 g+1 g+1 g+1
Remark n = 00, 04
p = 02, 06
q = 03, 07
Figure 7-34. Example of Set Contents of Registers When Triangular Wave PWM Output Function with Dead
Time (Master Channel n) Is Used
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRn CKSn CCS1n CCSn0
TERn
STSn2 STSn1 STSn0 CISn1 CISn0 MDn4 MDn3 MDn2 MDn1 MDn0
1/0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1/0
Slave/master selection
1: Channel 1 is set as master channel.
Figure 7-35. Example of Set Contents of Registers When Triangular Wave PWM Output Function with Dead
Time (Slave Channel p) Is Used
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRp CKSp CCS1p CCS0p
TERp
STSp2 STSp1 STSp0 CISp1 CISp0 MDp4 MDp3 MDp2 MDp1 MDp0
0 0 1 0 0 1 1 1 0 0 0 1 0 0 1 0
Slave/master selection
0: Channel 0 is set as slave channel.
Figure 7-36. Example of Set Contents of Registers When Triangular Wave PWM Output Function with Dead
Time (Slave Channel q) Is Used
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRq CKSq CCS1q CCS0q
TERq
STSq2 STSq1 STSq0 CISq1 CISq0 MDq4 MDq3 MDq2 MDq1 MDq0
0 0 1 0 0 1 1 0 0 0 0 0 1 0 0 1
Slave/master selection
0: Channel 0 is set as slave channel.
Figure 7-37. Operation Procedure When Triangular Wave PWM Output Function with Dead Time Is Used (1/2)
The TSn, TSp, and TSq bits automatically return to 0 When the master channel and slave channel p start
because they are trigger bits. counting, and when the MDn0 bit of the TMRn register is
set to 1, INTTMn is generated. Slave channel q waits until
slave channel p detects INTTMp.
During The set value of the TDRn (master) register must be At the master channel, a period is generated and count
operation changed during an up status period of slave channel p. operation of slave channels p and q are controlled. A PWM
The set values of the TDRp and TDRq (slaves) register duty is generated at slave channel p, and dead time is
can be changed. generated at slave channel q.
The TCRn, TCRp, and TCRq registers can always be Triangular wave PWM waveforms with dead times are output
read. from the TOp and TOq pins by a combined operation of
The TSRp (slave) register can always be read. slave channel p and slave channel q.
Remark n = 00, 04 p = 02, 06 q = 03, 07
Figure 7-37. Operation Procedure When Triangular Wave PWM Output Function with Dead Time Is Used (2/2)
stop to 1 at the same time. TEn, TEp, and TEq = 0, and count operation stops.
(to forward page)
The TTn, TTp, and TTq bits automatically return to 0 TCRn, TCRp, and TCRq hold count values and stop.
because they are trigger bits. The TOn, TOp, and TOq outputs are not initialized but
hold current statuses.
The TOEn, TOEp, and TOEq bits are cleared to 0 and
values are set to the TOn, TOp, and TOq bits. The TO00, TOp, and TOq pins output the TO00, TOp, and
TOq set levels.
TAUS To hold the TOn, TOp, and TOq pin output levels
stop Clears the TOn, TOp, and TOq bits to 0 after the
value to be held is set to the port register. The TOn, TOp, and TOq pin output levels are held by port
When holding the TOn, TOp, and TOq pin output levels function.
is not necessary
Switches the port mode register to input mode. The TOn, TOp, and TOq pin output levels go into Hi-Z output
states.
The TAU0EN and TAUOPEN bits of the PER2 register
are cleared to 0. Power-off status
All circuits are initialized and SFR of each channel is also
initialized.
(The TOn, TOp, and TOq bits are cleared to 0 and the
TOn, TOp, and TOq pins are set to port mode.)
Remark n = 00, 04
p = 02, 06
q = 03, 07
It outputs 6-phase triangular wave PWM output signals from slave channel 2, slave channel 3, slave channel 4,
slave channel 5, slave channel 6, and slave channel 7. Slave channel 1 can be operated in any operation mode.
(With this function, the operation mode of slave channel 1 will not be fixed.)
The output pulse period, duty factor (positive phase), and duty factor (reverse phase) can be calculated by the
following expression.
Pulse period (down/up) = {Set value of TDR00 (master) + 1} × 2 × Count clock period
Duty factor (positive phase) [%] = {{Set value of TDR00 (master) + 1} − {Set value of TDRp (slave p)} × 2 −
{Set value of TDRq (slave q) + 1}} × Count clock period
Duty factor (reverse phase) [%] = {{Set value of TDR00 (master) + 1} − {Set value of TDRp (slave p)} × 2 +
{Set value of TDRq (slave q) + 1}} × Count clock period
Errors will be included in the output waveforms when the dead time function is used. The output width of a
positive-phase wave will be shortened by the amount of dead time, and the output width of a reverse- phase wave will
be extended by the amount of dead time. The linearity of output transition will be lost in the neighborhood of 0% and
100% outputs due to the errors.
The master channel operates in the interval timer mode and counts the periods.
Dead time is controlled by using slave channel p (p = 2, 4, 6) and slave channel q (q = 3, 5, 7) in combination. The
6-phase triangular wave PWM output function uses slave channels 2 and 3, slave channels 4 and 5, and slave
channels 6 and 7 in combination. The output operations of TOp and TOq are explained next.
TCRp of slave channel p operates in the up and down count mode, and counts the duty. TCRp loads the value of
TDRp at the first count clock, after the channel start trigger bit (TSp) is set to 1. Hereafter, counting up and counting
down is switched in accordance with the operation of the master channel. INTTMp is output when TCRp becomes
0001H.
TCRp loads the value of TDRp again when INTTM00 is generated in an up status of the master channel. Similar
operation is continued hereafter.
TCRq of slave channel q operates in the one-count mode, and counts the dead time.
TCRq loads the value of TDRq and counts down by using INTTMp of slave channel p as the start trigger. When
TCRq becomes 0000H, it outputs INTTMq and stops counting until the next start trigger is input (INTTMq of slave
channel q).
A 6-phase triangular wave PWM waveform is output by changing TOp and TOq by the count operations (INTTMp,
INTTMq) of slave channel p (duty) and slave channel q (dead time). A positive-phase waveform and a reverse-phase
waveform are output by controlling the TOLp and TOLq bits of the TOL0 registers of slave channel p and slave
channel q.
The set condition of TOp (TOLp = 0) is the generation of INTTMq by the operation of slave channel q, which uses
the generation of INTTMp while the TCRp register counts down as the start trigger. The reset condition of TOp (TOLp
= 0) is the generation of INTTMp of slave channel p while TCRp counts up.
The set condition of TOq (TOLq = 1) is the generation of INTTMp while the TCRp register counts down. The reset
condition of TOq (TOLq = 0) is the generation of INTTMq by the operation of slave channel q, which uses the
generation of INTTMp while TCRp counts up as the start trigger.
Caution TDR00 of the master channel must be rewritten during an up status period of slave channel p.
When the value of TDR00 is rewritten during a down status period, the periods of the down
status and up status differ and an expected waveform cannot be output, because the value of
TDRn of the rewritten master channel becomes valid at the next period.
The value of TDRp of slave channel p becomes valid from the next carrier period (up and down trigger detection).
The value of TDRq of slave channel q becomes valid from the next start timing (dead time control trigger detection).
Figure 7-38. Block Diagram of Operation as 6-Phase Triangular Wave PWM Output Function
Master channel
(interval timer mode)
selection
CK00
Clock
Operation clock Timer counter Output
CK01 (TCR00) TO00 pin
controller
selection
Trigger
Data register Interrupt
TS00 (TDR00) controller Interrupt signal
(INTTM00)
Slave channels 2, 4, 6
(up and down count mode)
selection
Clock
Slave channels 3, 5, 7
(one-count mode)
selection
Clock
Figure 7-39. Example of Basic Timing of Operation as 6-Phase Triangular Wave PWM Output Function
TS00
TE00
FFFFH
Master TCR00
channel 0000H
TDR00 a b
TO00
INTTM00
a+1 a+1 b+1 b+1
down up down up
TSp
TEp
TCRp
0001H
Slave
channels 2, 4, 6
TDRp e f
INTTMp
e (a + 1 − e) × 2 e f (b + 1 − f) × 2 f
TSq
TEq
TCRq
0000H
Slave
channels 3, 5, 7
TDRq g
INTTMq
g+1 g+1 g+1 g+1
TOp TOLp = 0
TOq TOLq = 1
Figure 7-40. Example of Set Contents of Registers of 6-Phase Triangular Wave PWM Output Function
(Master Channel)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMR00 CKS00 CCS100 CCS000
TER00
STS002 STS001 STS000 CIS001 CIS000 MD004 MD003 MD002 MD001 MD000
1/0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1/0
Slave/master selection
1: Channel 1 is set as master channel.
Figure 7-41. Example of Set Contents of Registers of 6-Phase Triangular Wave PWM Output Function
(Slave Channel p)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRp CKSp CCS1p CCS0p
TERp
STSp2 STSp1 STSp0 CISp1 CISp0 MDp4 MDp3 MDp2 MDp1 MDp0
0 0 1 0 0 1 1 1 0 0 0 1 0 0 1 0
Slave/master selection
0: Channel 0 is set as slave channel.
Figure 7-42. Example of Set Contents of Registers of 6-Phase Triangular Wave PWM Output Function
(Slave Channel q)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRq CKSq CCS1q CCS0q
TERq
STSq2 STSq1 STSq0 CISq1 CISq0 MDq4 MDq3 MDq2 MDq1 MDq0
0 0 1 0 0 1 1 0 0 0 0 0 1 0 0 1
Slave/master selection
0: Channel 0 is set as slave channel.
Figure 7-43. Operation Procedure When 6-Phase Triangular Wave PWM Output Function Is Used (1/2)
The TS00 (master), and TSp and TSq (slaves) bits of TE00 = 1, TEp = 1, TEq = 1
the TS0 register are set to 1 at the same time. When the master channel and slave channel q start
The TS00, TSp,and TSq bits automatically return to 0 counting, and when the MD000 bit of the TMR00 register
because they are trigger bits. is set to 1, INTTM00 is generated.
During The set value of the TDR00 (master) register must be At the master channel, a period is generated and count
operation changed during an up status period. operation of slave channels p and q are controlled. A PWM
The set values of the TDRp and TDRq (slaves) register duty is generated at slave channel p, and dead time is
can be changed. generated at slave channel q.
The TCR00, TCRp, and TCRq registers can always be Triangular wave PWM waveforms with dead times are output
read. from the TOp and TOq pins by a combined operation of
The TSRp (slave) register can always be read. slave channel p and slave channel q.
Figure 7-43. Operation Procedure When 6-Phase Triangular Wave PWM Output Function Is Used (2/2)
stop set to 1 at the same time. TE00, TEp, and TEq = 0, and count operation stops.
(to forward page)
The TT00, TTp, and TTq bits automatically return to 0 TCR00, TCRp, and TCRq hold count values and stop.
because they are trigger bits. The TO00, TOp, and TOq outputs are not initialized but
hold current statuses.
The TOE00, TOEp, and TOEq bits are cleared to 0 and
values are set to the TO00, TOp, and TOq bits. The TO00, TOp, and TOq pins output the TO00, TOp, and
TOq set levels.
TAUS To hold the TO00, TOp, and TOq pin output levels
stop Clears the TO00, TOp, and TOq bits to 0 after the
value to be held is set to the port register. The TO00, TOp, and TOq pin output levels are held by port
When holding the TO00, TOp, and TOq pin output levels function.
is not necessary
Switches the port mode register to input mode. The TO00, TOp, and TOq pin output levels go into Hi-Z
output states.
The TAU0EN and TAUOPEN bits of the PER2 register
are cleared to 0. Power-off status
All circuits are initialized and SFR of each channel is also
initialized.
(The TO00, TOp, and TOq bits are cleared to 0 and the
TO00, TOp, and TOq pins are set to port mode.)
TCRn of the master channel counts down in the interval timer mode.
TCRn loads the value of TDRn by setting the channel start trigger bit (TSn) to 1. At this time, INTTMn is not output
and TOn is not toggled when MDn0 of TMRn is 0. INTTMn is output and TOn is toggled when MDn0 of TMRn is 1.
Afterward, TCRn counts down along with the count clock. When TCRn has become 0000H, INTTMn is output and
TOn is toggled upon the next count clock. TCRn loads the value of TDRn again at the same timing. Similar operation
is continued hereafter.
The slave channel operates as a down counter in the event counter mode and controls the thinning of INTTMn
signals of the master channel.
TCRm loads the value of TDRm by setting the channel start trigger bit (TSm) to 1.
TCRm counts down along with the INTTMn output of the master channel, and loads the value of TDRm again and
outputs INTTMm when TCRm becomes 0000H. Similar operation is continued hereafter.
TOn cannot be used, because TOn becomes an irregular waveform that depends on external events.
TDRn of the master channel becomes valid from the next start timing (master channel INTTMn generation).
TDRm of the slave channel becomes valid from the next start timing (slave channel INTTMm generation).
Remark n = 00
m = 01
Master channel
(interval timer mode)
selection
CK00
Clock
Operation clock Timer counter Output
CK01 (TCRn) TOn pin
controller
selection
Trigger
Data register Interrupt
TSn (TDRn) controller Interrupt signal
(INTTMn)
Slave channel
(event count mode)
selection
Clock
Timer counter
(TCRm)
selection
Trigger
Remark n = 00
m = 01
Figure 7-45. Example of Basic Timing of Operation as Interrupt Signal Thinning Function
TSn
TEn
Master TCRn
channel 0000H
TDRn a
INTTMn
a+1
TSm
TEm
3 3 3 3 3
2 2 2 2 2
TCRm 1 1 1 1
0000H 0 0 0 0
Slave
channel
TDRm b = 0003H
INTTMm
(a + 1) × (b + 1)
Remark n = 00
m = 01
Figure 7-46. Example of Set Contents of Registers When Interrupt Signal Thinning Function
(Master Channel) Is Used
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRn CKSn CCS1n CCS0n
TERn
STSn2 STSn1 STSn0 CISn1 CISn0 MDn4 MDn3 MDn2 MDn1 MDn0
1/0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1/0
Slave/master selection
1: Channel 1 is set as master channel.
Figure 7-47. Example of Set Contents of Registers When Interrupt Signal Thinning Function
(Slave Channel) Is Used
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRm CKSm CCS1m CCS0m
TERm
STSm2 STSm1 STSm0 CISm1 CISm0 MDm4 MDm3 MDm2 MDm1 MDm0
0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0
Slave/master selection
0: Channel 0 is set as slave channel.
Figure 7-48. Operation Procedure When Interrupt Signal Thinning Function Is Used
A/D conversion trigger pulse generation period (interval from the start of the carrier period to INTTMn
detection)
= {Set value of TDRm (slave) + 1} × Count clock period
TCRn of the master channel operates in the interval timer mode and counts the periods.
TCRm of the slave channel operates in one-count mode and counts the duty. TCRm of the master channel loads
the value of TDRm by using INTTMn of the master channel as a start trigger, and counts down. When TCRm has
become 0000H, TCRm outputs INTTMm and stops counting until the next start trigger (INTTMn of the master channel)
is input.
TDRn and TDRm of the master channel and slave channel become valid from the next period (master channel
INTTMn generation).
Figure 7-49. Block Diagram of Operation as A/D Conversion Trigger Output Function (Type 1)
Master channel
(interval timer mode)
selection
CK00
Clock
Operation clock Timer counter
CK01 (TCRn)
selection
Trigger
Data register Interrupt
TSn (TDRn) controller Interrupt signal
(INTTMn)
Slave channel
(one-count mode)
selection
Clock
Timer counter
(TCRm)
Interrupt
selection
Trigger
Figure 7-50. Example of Basic Timing of Operation as A/D Conversion Trigger Output Function (Type 1)
TSn
TEn
Master
TCRn
channel 0000H
TDRn a b
TOn
INTTMn
a+1 a+1 b+1 b+1
TSm
TEm
TCRm
Slave 0000H
channel
TDRm c d
INTTMm
Figure 7-51. Example of Set Contents of Registers When A/D Conversion Trigger Output Function (Type 1)
(Master Channel) Is Used
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRn CKSn CCS1n CCS0n
TERn
STSn2 STSn1 STSn0 CISn1 CISn0 MDn4 MDn3 MDn2 MDn1 MDn0
1/0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1
Slave/master selection
1: Channel 1 is set as master channel.
Figure 7-52. Example of Set Contents of Registers When A/D Conversion Trigger Output Function (Type 1)
(Slave Channel) Is Used
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRm CKSm CCS1m CCS0m
TERm
STSm2 STSm1 STSm0 CISm1 CISm0 MDm4 MDm3 MDm2 MDm1 MDm0
0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1
Slave/master selection
0: Channel 0 is set as slave channel.
Figure 7-53. Operation Procedure When A/D Conversion Trigger Output Function (Type 1) Is Used
A/D conversion trigger pulse generation period (interval from the start of the carrier period to INTTMn
detection during a down status) = {Set value of TDRm (slave) + 1} × Count clock period
Setting range of TDRm (slave): 0000H < TDRm (slave) < {Set value of TDRn (master) + 1}
* Interval from INTTMm detection during a down status to INTTMm detection during an up status
= {{Set value of TDRn (master) + 1} − {Set value of TDRm (slave)}} × 2 × Count clock period
TCRn of the master channel operates in the interval timer mode and counts the periods.
TCRn loads the value of TDRn by setting the channel start trigger bit (TSn) to 1.
At this time, INTTMn is not output and TOn is not toggled when MDn0 of TMRn is 0. INTTMn is output and TOn is
toggled when MDn0 of TMRn is 1. Afterward, TCRn counts down along with the count clock. When TCRn has
become 0000H, INTTMn is output and TOn is toggled upon the next count clock. TCRn loads the value of TDRn
again at the same timing. Similar operation is continued hereafter.
TCRm of slave channel m operates in the up and down count mode, and counts the duty. TRm loads the value of
TDRm at the first count clock, after the channel start trigger bit (TSm) is set to 1. Hereafter, counting up and counting
down is switched in accordance with the operation of the master channel. INTTMm is output when TCRm becomes
0001H.
TCRm loads the value of TDRm again when INTTMn is generated in an up status of the master channel. Similar
operation is continued hereafter.
Caution TDRn of the master channel must be rewritten during an up status period of slave channel m.
When the value of TDRn is rewritten during a down status period, the periods of the down status
and up status differ and an expected waveform cannot be output, because the value of TDRn of
the rewritten master channel becomes valid at the next period.
TDRm of the slave channel becomes valid from the next carrier period (up and down trigger detection).
Figure 7-54. Block Diagram of Operation as A/D Conversion Trigger Output Function (Type 2)
Master channel
(interval timer mode)
selection
CK00
Clock
Operation clock Timer counter Output
CK01 TOn pin
(TCRn) controller
selection
Trigger
Data register Interrupt
TSn (TDRn) controller Interrupt signal
(INTTMn)
Slave channel
(up and down count mode)
selection
Clock
Figure 7-55. Example of Basic Timing of Operation as A/D Conversion Trigger Output Function (Type 2)
TSn
TEn
FFFFH
Master
TCRn
channel 0000H
TDRn a b
TOn
INTTMn
a+1 a1 b+1 b+1
down up down up
TSm
TEm
TCRm
Slave 0001H
channel
TDRm e f
INTTMm
e (a + 1 − e) × 2 e f (b + 1 − f) × 2 f
Figure 7-56. Example of Set Contents of Registers When A/D Conversion Trigger Output Function (Type 2)
(Master Channel) Is Used
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRn CKSn CCS1n CCS0n
TERn
STSn2 STSn1 STSn0 CISn1 CISn0 MDn4 MDn3 MDn2 MDn1 MDn0
1/0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1/0
Slave/master selection
1: Channel 1 is set as master channel.
Figure 7-57. Example of Set Contents of Registers When A/D Conversion Trigger Output Function (Type 2)
(Slave Channel m) Is Used
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MAS
TMRm CKSm CCS1m CCS0m
TERm
STSm2 STSm1 STSm0 CISm1 CISm0 MDm4 MDm3 MDm2 MDm1 MDm0
0 0 1 0 0 1 1 1 0 0 0 1 0 0 1 0
Slave/master selection
0: Channel 0 is set as slave channel.
Figure 7-58. Operation Procedure When A/D Conversion Trigger Output Function (Type 2) Is Used (1/2)
because they are trigger bits. the MDn0 bit of the TMRn register is 1, INTTMn is
generated.
During The set value of the TDRn (master) register must be At the master channel, TCRn loads the value of TDRn and
operation changed during an up status period. counts down. When the count value reaches TCRn =
The set value of the TDRm (slave) register can be 0000H, INTTMn is generated. At the same time, the value of
changed. TDRn is loaded to TCRn, and the counter starts counting
The TCRn and TCRm registers can always be read. down again.
The TSRm (slave) register can always be read. At the slave channel, TCRm loads the value of TDRm, and
counting down and up are switched according to the
operation of the master channel. INTTMm is generated and
count operation is stopped upon detection of TCRm =
0001H. TCRm loads the value of TDRm again and count
operation is continued by the generation of INTTMn during
an up status of the master channel.
Figure 7-58. Operation Procedure When A/D Conversion Trigger Output Function (Type 2) Is Used (2/2)
Operation is resumed.
(to forward page)
{ Comparators
• A comparator is equipped with two channels (CMP0, CMP1).
• Negative-side input pins (CMP0M, CMP1M) and a positive-side input pin (CMP0P, CMP1P) can be connected.
• The output signal of an operational amplifier can be used as the positive-side input signal of a comparator. (In
this case, the output signal is simultaneously input to both channels of comparators 0 and 1.)
• CMP0M and CMP1M pin inputs and the internal generation reference voltage (6 combinations for each
comparator) can be selected as the reference voltage.
• The elimination width of the noise elimination digital filter can be selected.
• An interrupt request is generated when an overvoltage is detected (INTCMP0 and INTCMP1).
• The output signal of a comparator is connected to the timer array unit and sets the timer output pin (TOn) to a
Hi-Z state.
{ Operational amplifiers
• An operational amplifier amplifies and outputs an analog voltage that is input. One among eight amplification
factors can be selected.
• The output signal of an operational amplifier can be used as the positive-side input signal of a comparator. (In
this case, the output signal is simultaneously input to both channels of comparators 0 and 1.)
• The output signal of an operational amplifier can be selected as the analog input of an A/D converter.
Both functions can be used by setting two values (comparator 0 < comparator 1) of the reference voltage that
set the pin to a Hi-Z state, and inputting the same signal to the positive-side inputs of comparators 0 and 1.
Internal bus
C1VRE C1VRS2 C1VRS1 C1VRS0 C1EN C1OE C1INV C1DFS2 C1DFS1 C1DFS0
Selector
CMP1P/P82
Timer array unit TAUS,
inverter control function
+ Output reversal Noise filter INTCM1P
circuit
−
Selector
CMP1M/P83
AVREF
Controller
Operational
amplifier AVSS
A/D converter
Selector
OAI/CMP0P/P80
Timer array unit TAUS,
+ inverter control function
Output reversal Noise filter INTCM0P
− circuit
Selector
CMP0M/P81
AVREF
Controller
AVSS
OAEN OAVG2 OAVG1 OAVG0 C0VRE C0VRS2 C0VRS1 C0VRS0 C0EN C0OE C0INV C0DFS2 C0DFS1 C0DFS0
Operational amplifier control Comparator 0 internal reference voltage Comparator 0 control register (C0CTL)
register (OAM) setting register (C0RVM)
Internal bus
Item Configuration
The comparators and operational amplifiers use the following eight registers.
Cautions 1. Make sure to set OACMPEN to 1 first, when setting the comparator or operational
amplifier. Writing to the control register of the comparator or operational amplifier will be
ignored and all values read will be initialized when OACMPEN is set to 0.
2. Make sure to set bits 0 to 2 and bits 4 to 7 of the PER1 register to “0”.
PER1 0 0 0 0 OACMPEN 0 0 0
Symbol <7> 6 5 4 3 2 1 0
0 0 0 ×1
0 0 1 ×4
0 1 0 ×6
0 1 1 ×8
1 0 0 ×10
1 0 1 ×12
Other than the above Setting prohibited
Cautions 1. Set the amplification factor before enabling (OAEN = 1) the operation of the operational
amplifier. Changing the amplification factor setting in the operation enabled state (OAEN
= 1) is prohibited.
2. Comparators 0 and 1 may perform false detection when CnEN of the CnCTL register is set
to 1, because the operational amplifier output signal becomes the positive-side input
voltage of comparators 0 and 1, at the same time as when the operational amplifier enters
the operation enable state. Therefore, set OAM while the comparator output signal is
being stopped.
Remark n = 0, 1
Symbol <7> 6 5 4 3 2 1 0
CnCTL CnEN 0 0 CnOE CnINV CnDFS2 CnDFS1 CnDFS0
Cautions 1. Rewrite CnINV and CnDFS2 to CnDFS0 after setting the comparator output to the disabled
state (CnOE = 0).
2. With the noise elimination width, an extra CPU clock (fCLK) may be eliminated from the
setting value.
(Example: When fCLK = 20 MHz, CnDFS2 to CnDFS0 = 001, noise elimination width = 250 to
300 ns)
3. To operate the comparator in combination with an operational amplifier, set the operation
of the comparator after setting the operation of the operational amplifier (see Figure 8-10
and Figure 8-11).
4. The negative-side external pin input of the comparator will be cutoff when CnVRE of the
CnRVM register is set (1), regardless of the value that enables or disables the comparator
operation (CnEN).
Figure 8-5. Format of Comparator n Internal Reference Voltage Selection Register (CnRVM)
Symbol <7> 6 5 4 3 2 1 0
0 Stops operation
1 Enables operation
Connects the internal reference voltage to the negative-side input of comparator n
0 0 0 Setting prohibited
0 0 1 2AVREF/16 3AVREF/16
0 1 0 4AVREF/16 5AVREF/16
0 1 1 6AVREF/16 7AVREF/16
1 0 0 8AVREF/16 9AVREF/16
1 0 1 10AVREF/16 11AVREF/16
1 1 0 12AVREF/16 13AVREF/16
1 1 1 Setting prohibited
Cautions 1. The operation of the comparator is controlled by CnEN when the operation of the internal
reference voltage is stopped (CnVRE = 0).
2. The negative-side external pin input of the comparator will be cutoff when CnVRE is set
(1), regardless of the value that enables or disables the comparator operation (CnEN).
3. Set the reference voltage before enabling the operation of the internal reference voltage
(CnVRE = 1). Changing the reference voltage setting in the operation enabled state
(CnVRE = 1) is prohibited.
Remark n = 0, 1
Caution The port function that is alternatively used as the CMP0M, CMP1M pin can be used in the
input mode, when the CMP0P, CMP1P pin is selected as the positive-side input of the
comparator, and the internal reference voltage is used on the negative side. Using the
output mode, however, is prohibited. Furthermore accessing port register 8 (P8) is also
prohibited.
The procedures for starting the operation of a comparator and an operational amplifier are described below,
separately for each use method.
Figure 8-8. Using the External Pin Input for the Comparator Reference Voltage (Using Only a Comparator)
Start
PM8 register setting Set the PM8 register to the input mode.
Wait
Operation start
Figure 8-9. Using the Internal Reference Voltage for the Comparator Reference Voltage (Using Only a
Comparator)
Start
PM8 register setting Set the PM8 register to the input mode.
Wait
Operation start
Figure 8-10. Using the External Pin Input for the Comparator Reference Voltage (Using a Comparator and an
Operational Amplifier)
Start
PM8 register setting Set the PM8 register to the input mode.
Wait
Operation start
Remark n = 0, 1
Figure 8-11. Using the Internal Reference Voltage for the Comparator Reference Voltage (Using a Comparator
and an Operational Amplifier)
Start
PM8 register setting Set the PM8 register to the input mode.
Wait
Operation start
Remark n = 0, 1
Perform the following settings before selecting the operational amplifier output signal as the analog input by using
the analog input channel specification register (ADS) of the A/D converter (refer to 12.4.1 Basic operations of A/D
converter).
Figure 8-12. Using the Operational Amplifier Output Voltage as the A/D Converter Analog Input
Start
PM8 register setting Set the PM8 register to the input mode.
Remark n = 0, 1
The procedures for stopping the operation of a comparator and an operational amplifier are described below,
separately for each use method.
Operation in progress
Operation stop
Figure 8-14. Using the Operational Amplifier Output Voltage as the Comparator Compare Voltage Input
Operation in progress
Operation stop
Figure 8-15. Using the Operational Amplifier Output Voltage as the A/D Converter Analog Input
Operation in progress
Operation stop
Remark n = 0, 1
• Having counters of year, month, week, day, hour, minute, and second, and can count up to 99 years.
• Constant-period interrupt function (period: 1 month to 0.5 seconds)
• Alarm interrupt function (alarm: week, hour, minute)
• Interval interrupt function
Item Configuration
Control registers Peripheral enable register 0 (PER0)
Real-time counter control register 0 (RTCC0)
Real-time counter control register 1 (RTCC1)
Real-time counter control register 2 (RTCC2)
Sub-count register (RSUBC)
Second count register (SEC)
Minute count register (MIN)
Hour count register (HOUR)
Day count register (DAY)
Week count register (WEEK)
Month count register (MONTH)
Year count register (YEAR)
Watch error correction register (SUBCUD)
Alarm minute register (ALARMWM)
Alarm hour register (ALARMWH)
Alarm week register (ALARMWW)
WALE WALIE WAFG RIFG RWST RWAIT RTCE AMPM CT2 CT1 CT0
INTRTC
RIFG
Selector
AMPM
Count enable/
disable circuit Watch error
correction
register
(SUBCUD)
Buffer Buffer Buffer Buffer Buffer Buffer Buffer (8-bit)
RTCE
Internal bus
INTRTCI
Note
RTCEN Control of real-time counter (RTC) input clock
Notes The input clock that can be controlled by RTCEN is used when the register that is used by the
real-time counter (RTC) is accessed from the CPU. RTCEN cannot control supply of the
operating clock (fSUB) to RTC.
Cautions 1. When using the real-time counter, first set RTCEN to 1, while oscillation of the
subsystem clock (fSUB) is stable. If RTCEN = 0, writing to a control register of the
real-time counter is ignored, and, even if the register is read, only the default
value is read.
2. Be sure to clear bits 0, 1, 3, 4, and 6 of PER0 register to 0.
• To change the value of AMPM, set RWAIT (bit 0 of RTCC1) to 1, and re-set the hour count register (HOUR).
• Table 9-2 shows the displayed time digits that are displayed.
After changing the values of CT2 to CT0, clear the interrupt request flag.
00 12 (AM12) 12 32 (PM12)
01 01 (AM1) 13 21 (PM1)
02 02 (AM2) 14 22 (PM2)
03 03 (AM3) 15 23 (PM3)
04 04 (AM4) 16 24 (PM4)
05 05 (AM5) 17 25 (PM5)
06 06 (AM6) 18 26 (PM6)
07 07 (AM7) 19 27 (PM7)
08 08 (AM8) 20 28 (PM8)
09 09 (AM9) 21 29 (PM9)
10 10 (AM10) 22 30 (PM10)
11 11 (AM11) 23 31 (PM11)
To set the registers of alarm (WALIE flag of RTCC1, ALARMWM register, ALARMWH register, and ALARMWW
register), disable WALE (clear it to “0”).
0 Alarm mismatch
1 Detection of matching of alarm
This is a status flag that indicates detection of matching with the alarm. It is valid only when WALE = 1 and is set to
“1” one clock (32 kHz) after matching of the alarm is detected. This flag is cleared when “0” is written to it. Writing
“1” to it is invalid.
0 Counter is operating.
1 Mode to read or write counter value
Caution If writing is performed to the WAFG flag with a 1-bit manipulation instruction, the RIFG flag
may be cleared. Therefore, to perform writing to the WAFG flag, be sure to use an 8-bit
manipulation instruction, and at this time, set 1 to the RIFG flag to invalidate writing. In the
same way, to perform writing to the RIFG flag, use an 8-bit manipulation instruction and set 1
the WAFR flag.
Remark Fixed-cycle interrupts and alarm match interrupts use the same interrupt source (INTRTC). When
using these two types of interrupts at the same time, which interrupt occurred can be judged by
checking the fixed-cycle interrupt status flag (RIFG) and the alarm detection status flag (WAFG)
upon INTRTC occurrence.
Cautions 1. When a correction is made by using the SUBCUD register, the value may become 8000H
or more.
2. This register is also cleared by reset effected by writing the second count register.
3. The value read from this register is not guaranteed if it is read during operation, because
a value that is changing is read.
Caution Bit 5 (HOUR20) of HOUR indicates AM(0)/PM(1) if AMPM = 0 (if the 12-hour system is
selected).
When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks (32.768 kHz)
later. Set a decimal value of 01 to 31 to this register in BCD code. If a value outside this range is set, the
register value returns to the normal value after 1 period.
DAY can be set by an 8-bit memory manipulation instruction.
Reset signal generation clears this register to 01H.
SUBCUD DEV F6 F5 F4 F3 F2 F1 F0
0 Corrects watch error when the second digits are at 00, 20, or 40.
1 Corrects watch error only when the second digits are at 00.
When (F6, F5, F4, F3, F2, F1, F0) = (*, 0, 0, 0, 0, 0, *), the watch error is not corrected.
/F5 to /F0 are the inverted values of the corresponding bits (000011 when 111100).
Caution Set a decimal value of 00 to 59 to this register in BCD code. If a value outside the range is
set, the alarm is not detected.
Caution Set a decimal value of 00 to 23, 01 to 12, or 21 to 32 to this register in BCD code. If a value
outside the range is set, the alarm is not detected.
Caution Bit 5 (WH20) of ALARMWH indicates AM(0)/PM(1) if AMPM = 0 (if the 12-hour system is
selected).
Start
Setting AMPM, CT2 to CT0 Selects 12-/24-hour system and interrupt (INTRTC).
No
INTRTC = 1?
Yes
Reading counter
Note First set RTCEN to 1, while oscillation of the subsystem clock (fSUB) is stable.
Start
No
RWST = 1? Checks wait status of counter.
Yes
No
RWST = 0?Note
Yes
End
Caution Complete the series of operations of setting RWAIT to 1 to clearing RWAIT to 0 within 1 second.
Remark SEC, MIN, HOUR, WEEK, DAY, MONTH, and YEAR may be read in any sequence.
All the registers do not have to be set and only some registers may be read.
Start
No
RWST = 1? Checks wait status of counter.
Yes
No
RWST = 0?Note
Yes
End
Caution Complete the series of operations of setting RWAIT to 1 to clearing RWAIT to 0 within 1 second.
Remark SEC, MIN, HOUR, WEEK, DAY, MONTH, and YEAR may be written in any sequence.
All the registers do not have to be set and only some registers may be written.
Start
No
INTRTC = 1?
Yes
No
WAFG = 1?
When a reset occurs due to the watchdog timer, bit 4 (WDRF) of the reset control flag register (RESF) is set to 1.
For details of RESF, see CHAPTER 17 RESET FUNCTION.
When 75% of the overflow time is reached, an interval interrupt can be generated.
Item Configuration
Control register Watchdog timer enable register (WDTE)
How the counter operation is controlled, overflow time, window open period, and interval interrupt are set by the
option byte.
WDCS2 to WDCS0 of
option byte (000C0H)
Internal bus
The watchdog timer is controlled by the watchdog timer enable register (WDTE).
Note The WDTE reset value differs depending on the WDTON setting value of the option byte (000C0H). To
operate watchdog timer, set WDTON to 1.
Cautions 1. If a value other than “ACH” is written to WDTE, an internal reset signal is generated.
2. If a 1-bit memory manipulation instruction is executed for WDTE, an internal reset signal
is generated.
3. The value read from WDTE is 9AH/1AH (this differs from the written value (ACH)).
• Enable counting operation of the watchdog timer by setting bit 4 (WDTON) of the option byte (000C0H) to 1
(the counter starts operating after a reset release) (for details, see CHAPTER 21).
• Set an overflow time by using bits 3 to 1 (WDCS2 to WDCS0) of the option byte (000C0H) (for details, see
10.4.2 and CHAPTER 21).
• Set a window open period by using bits 6 and 5 (WINDOW1 and WINDOW0) of the option byte (000C0H)
(for details, see 10.4.3 and CHAPTER 21).
• If a 1-bit manipulation instruction is executed on the watchdog timer enable register (WDTE)
• If data other than “ACH” is written to WDTE
Cautions 1. When data is written to WDTE for the first time after reset release, the watchdog timer is
cleared in any timing regardless of the window open time, as long as the register is written
before the overflow time, and the watchdog timer starts counting again.
2. If the watchdog timer is cleared by writing “ACH” to WDTE, the actual overflow time may be
different from the overflow time set by the option byte by up to 2/fIL seconds.
3. The watchdog timer can be cleared immediately before the count value overflows.
<Example> When the overflow time is set to 210/fIL, writing “ACH” is valid up to count value
3FH.
Cautions 4. The operation of the watchdog timer in the HALT and STOP modes differs as follows
depending on the set value of bit 0 (WDSTBYON) of the option byte (000C0H).
WDSTBYON = 0 WDSTBYON = 1
In HALT mode Watchdog timer operation stops. Watchdog timer operation continues.
In STOP mode
If WDSTBYON = 0, the watchdog timer resumes counting after the HALT or STOP mode is
released. At this time, the counter is cleared to 0 and counting starts.
When operating with the X1 oscillation clock after releasing the STOP mode, the CPU starts
operating after the oscillation stabilization time has elapsed.
Therefore, if the period between the STOP mode release and the watchdog timer overflow is
short, an overflow occurs during the oscillation stabilization time, causing a reset.
Consequently, set the overflow time in consideration of the oscillation stabilization time
when operating with the X1 oscillation clock and when the watchdog timer is to be cleared
after the STOP mode release by an interval interrupt.
5. The watchdog timer continues its operation during self-programming of the flash memory
and EEPROMTM emulation. During processing, the interrupt acknowledge time is delayed.
Set the overflow time and window size taking this delay into consideration.
Caution The watchdog timer continues its operation during self-programming of the flash memory and
EEPROM emulation. During processing, the interrupt acknowledge time is delayed. Set the
overflow time and window size taking this delay into consideration.
• If “ACH” is written to WDTE during the window open period, the watchdog timer is cleared and starts counting
again.
• Even if “ACH” is written to WDTE during the window close period, an abnormality is detected and an internal
reset signal is generated.
Counting Overflow
starts time
Window open
Window close period (75%)
period (25%)
Caution When data is written to WDTE for the first time after reset release, the watchdog timer is cleared
in any timing regardless of the window open time, as long as the register is written before the
overflow time, and the watchdog timer starts counting again.
0 0 25%
0 1 50%
1 0 75%
1 1 100%
Cautions 1. The watchdog timer continues its operation during self-programming of the flash memory
and EEPROM emulation. During processing, the interrupt acknowledge time is delayed. Set
the overflow time and window size taking this delay into consideration.
2. When bit 0 (WDSTBYON) of the option byte (000C0H) = 0, the window open period is 100%
regardless of the values of WINDOW1 and WINDOW0.
3. Do not set the window open period to 25% if the watchdog timer corresponds to either of the
conditions below.
• When stopping all main system clocks (internal high-speed oscillation clock, X1 clock, and
external main system clock) by use of the STOP mode or software.
Remark If the overflow time is set to 210/fIL, the window close time and open time are as follows.
Caution When operating with the X1 oscillation clock after releasing the STOP mode, the CPU starts
operating after the oscillation stabilization time has elapsed.
Therefore, if the period between the STOP mode release and the watchdog timer overflow is
short, an overflow occurs during the oscillation stabilization time, causing a reset.
Consequently, set the overflow time in consideration of the oscillation stabilization time when
operating with the X1 oscillation clock and when the watchdog timer is to be cleared after the
STOP mode release by an interval interrupt.
Remark The watchdog timer continues counting even after INTWDTI is generated (until ACH is written to the
WDTE register). If ACH is not written to the WDTE register before the overflow time, an internal reset
signal is generated.
The A/D converter is a 10-bit resolution converter that converts analog input signals into digital values, and is
configured to control a total of twelve channels of analog inputs, including up to eleven channels of A/D converter
analog inputs (ANI0 to ANI9) and an internal operational amplifier output (OAI).
The A/D converter has the following function.
AVREF
ADCS bit
Successive
ANI6/P26
approximation register
ANI7/P27 (SAR)
AVSS
ANI8/P150
ANI9/P151
Selector
INTAD
Operational ampli er output Controller Timer triggers 0 and 1
signal from OAI pin
ADPC4 ADPC3 ADPC2 ADPC1 ADPC0 ADOAS ADS3 ADS2 ADS1 ADS0 ADTMD ADTRS ADCS ADMD FR2 FR1 FR0 LV1 LV0 ADCE
A/D port configuration Analog input channel A/D converter mode A/D converter mode
register (ADPC) specification register (ADS) register 1 (ADM1) register (ADM)
Internal bus
The voltage tap of the array and the analog input voltage are compared and bit 10 of the SAR register is
manipulated according to the result of the comparison.
(5) Array
The array generates the comparison voltage input from an analog input pin.
(9) Controller
This circuit controls the conversion time of an input analog signal that is to be converted into a digital signal, as
well as starting and stopping of the conversion operation. When A/D conversion has been completed, this
controller generates INTAD.
Cautions 1. When setting the A/D converter, be sure to set ADCEN to 1 first. If ADCEN = 0, writing to a
control register of the A/D converter is ignored, and, even if the register is read, only the
default value is read.
2. Be sure to clear bits 0, 1, 3, 4, and 6 of PER0 register to 0.
Notes 1. For details of FR2 to FR0, LV1, LV0, and A/D conversion, see Table 11-2 A/D Conversion Time
Selection.
2. The operation of the A/D voltage comparator is controlled by ADCS and ADCE, and it takes 1 μs from
operation start to operation stabilization. Therefore, when ADCS is set to 1 after 1 μs or more has
elapsed from the time ADCE is set to 1, the conversion result at that time has priority over the first
conversion result. Otherwise, ignore data of the first conversion.
ADCE
A/D voltage
comparator
Conversion Conversion Conversion Conversion
operation waiting operation stopped
ADCS
Note
Note To stabilize the internal circuit, the time from the rising of the ADCE bit to the falling of the ADCS bit must be
1 μs or longer.
Caution A/D conversion must be stopped before rewriting bits FR0 to FR2, LV1, and LV0 to values other
than the identical data.
A/D Converter Mode Register (ADM) Mode Conversion Time Selection Conversion
FR2 FR1 FR0 LV1 LV0 fCLK = 2 MHz fCLK = 5 MHz fCLK = 10 MHz fCLK = 20 MHz Clock (fAD)
Cautions 1. When rewriting FR2 to FR0, LV1, and LV0 to other than the same data, stop A/D conversion once
(ADCS = 0) beforehand.
2. The above conversion time does not include clock frequency errors. Select conversion time,
taking clock frequency errors into consideration.
A/D Converter Mode Register (ADM) Mode Conversion Time Selection Conversion
FR2 FR1 FR0 LV1 LV0 fCLK = 2 MHz fCLK = 5 MHz fCLK = 10 MHz fCLK = 20 MHz Clock (fAD)
Cautions 1. When rewriting FR2 to FR0, LV1, and LV0 to other than the same data, stop A/D conversion once
(ADCS = 0) beforehand.
2. The above conversion time does not include clock frequency errors. Select conversion time,
taking clock frequency errors into consideration.
ADCS
Sampling
timing
INTAD
Caution Rewriting ADM1 during A/D conversion is prohibited. Rewrite it when conversion operation
is stopped (ADCS = 0).
Remark For details of the timer trigger signals, refer to 7.4.8 Operation as A/D conversion trigger output
function (type 1) and 7.4.9 Operation as A/D conversion trigger output function (type 2).
FFF1FH FFF1EH
Symbol
ADCR 0 0 0 0 0 0
Caution When writing to A/D converter mode register (ADM), analog input channel specification register
(ADS), and A/D port configuration register (ADPC), the contents of ADCR may become undefined.
Read the conversion result following conversion completion before writing to ADM, ADS, and
ADPC. Using timing other than the above may cause an incorrect conversion result to be read.
Symbol 7 6 5 4 3 2 1 0
ADCRH
Caution When writing to A/D converter mode register (ADM), analog input channel specification register
(ADS), and A/D port configuration register (ADPC), the contents of ADCRH may become
undefined. Read the conversion result following conversion completion before writing to ADM,
ADS, and ADPC. Using timing other than the above may cause an incorrect conversion result to
be read.
ADP ADP ADP ADP ADP Analog input (A)/digital I/O (D) switching
C4 C3 C2 C1 C0 Port 5 Port 2
ANI9 ANI8 ANI7 ANI6 ANI5 ANI4 ANI3 ANI2 ANI1 ANI0
/P151 /P150 /P27 /P26 /P25 /P24 /P23 /P22 /P21 /P20
0 0 0 0 0 A A A A A A A A A A
0 0 0 0 1 A A A A A A A A A D
0 0 0 1 0 A A A A A A A A D D
0 0 0 1 1 A A A A A A A D D D
0 0 1 0 0 A A A A A A D D D D
0 0 1 0 1 A A A A A D D D D D
0 0 1 1 0 A A A A D D D D D D
0 0 1 1 1 A A A D D D D D D D
0 1 0 0 0 A A D D D D D D D D
0 1 0 0 1 A D D D D D D D D D
1 0 0 0 0 D D D D D D D D D D
Other than the above Setting prohibited
Cautions 1. Set a channel to be used for A/D conversion in the input mode by using port mode register 2
and 15 (PM2, PM15).
2. Do not set the pin that is set by ADPC as digital I/O by ADS.
Note 1 →
CHAPTER 11 A/D CONVERTER
Caution If a pin is set as an analog input port, not the pin level but “0” is always read.
Figure 11-12. Formats of Port Mode Registers 2, 8, and 15 (PM2, PM8, PM15)
PMmn Pmn pin I/O mode selection (mn = 20 to 27, 80, 150 to 151)
0 Output mode (output buffer on)
1 Input mode (output buffer off)
Cautions .Be sure to set bit 2 of PM15 to “1”, and bit 2 of P15 to “0”.
The ANI0/P20 to ANI7/P27, OAI/P80, and ANI8/P150 to ANI9/P151 pins are as shown below depending on the
settings of ADPC, ADS, PM2, PM8, and PM15.
Table 11-3. Setting Functions of ANI0/P20 to ANI7/P27, OAI/P80, and ANI8/P150 to ANI9/P151 Pins
<1> Set bit 5 (ADCEN) of peripheral enable register 0 (PER0) to 1 to start the supply of the input clock to the A/D
converter.
<2> Set the A/D conversion time by using bits 5 to 1 (FR2 to FR0, LV1, and LV0) of ADM, and set the operation
mode by using bit 6 (ADMD) of ADM.
<3> Set bit 0 (ADCE) of A/D converter mode register (ADM) to 1 to start the operation of the A/D voltage
comparator.
<4> Set the channels for A/D conversion to analog input by using the A/D port configuration register (ADPC) and
set to input mode by using port mode registers (PM2, PM8, and PM15).
<5> Set the operational amplifier operation to set the operational amplifier output (OAI pin) for the analog input
channel (refer to 8.4.1 Starting comparator and operational amplifier operation).
<6> Select one channel for A/D conversion using the analog input channel specification register (ADS).
<7> Use the A/D converter mode register 1 (ADM1) to set the trigger mode.
<8> Start the conversion operation by setting bit 7 (ADCS) of ADM to 1.
A timer trigger wait state is entered if the timer trigger mode is set in step <7>.
(<9> to <15> are operations performed by hardware.)
<9> The voltage input to the selected analog input channel is sampled by the sample & hold circuit.
<10> When sampling has been done for a certain time, the sample & hold circuit is placed in the hold state and the
sampled voltage is held until the A/D conversion operation has ended.
<11> Bit 9 of the successive approximation register (SAR) is set. The series resistor string voltage tap is set to (1/2)
AVREF by the tap selector.
<12> The voltage difference between the series resistor string voltage tap and sampled voltage is compared by the
voltage comparator. If the analog input is greater than (1/2) AVREF, the MSB of SAR remains set to 1. If the
analog input is smaller than (1/2) AVREF, the MSB is reset to 0.
<13> Next, bit 8 of SAR is automatically set to 1, and the operation proceeds to the next comparison. The series
resistor string voltage tap is selected according to the preset value of bit 9, as described below.
• Bit 9 = 1: (3/4) AVREF
• Bit 9 = 0: (1/4) AVREF
The voltage tap and sampled voltage are compared and bit 8 of SAR is manipulated as follows.
• Sampled voltage ≥ Voltage tap: Bit 8 = 1
• Sampled voltage < Voltage tap: Bit 8 = 0
<14> Comparison is continued in this way up to bit 0 of SAR.
<15> Upon completion of the comparison of 10 bits, an effective digital result value remains in SAR, and the result
value is transferred to the A/D conversion result register (ADCR, ADCRH) and then latched.
At the same time, the A/D conversion end interrupt request (INTAD) can also be generated.
<16> Repeat steps <9> to <15>, until ADCS is cleared to 0.
To stop the A/D converter, clear ADCS to 0.
To restart A/D conversion from the status of ADCE = 1, start from <8>. To start A/D conversion again when
ADCE = 0, set ADCE to 1, wait for 1 μs or longer, and start <8>. To change a channel of A/D conversion,
start from <6>.
Conversion time
Sampling time
Conversion
SAR Undefined result
Conversion
ADCR
result
INTAD
A/D conversion operations are performed continuously until bit 7 (ADCS) of A/D converter mode register (ADM) is
reset (0) by software.
If a write operation is performed to the analog input channel specification register (ADS) during an A/D conversion
operation, the conversion operation is initialized, and if the ADCS bit is set (1), conversion starts again from the
beginning.
Reset signal generation clears the A/D conversion result register (ADCR, ADCRH) to 0000H or 00H.
VAIN
SAR = INT ( × 1024 + 0.5)
AVREF
ADCR = SAR × 64
or
Figure 11-14 shows the relationship between the analog input voltage and the A/D conversion result.
Figure 11-14. Relationship Between Analog Input Voltage and A/D Conversion Result
SAR ADCR
1023 FFC0H
1022 FF80H
1021 FF40H
3 00C0H
2 0080H
1 0040H
0 0000H
1 1 3 2 5 3 2043 1022 2045 1023 2047 1
2048 1024 2048 1024 2048 1024 2048 1024 2048 1024 2048
Input voltage/AVREF
11.4.3 Trigger mode selection
The following two trigger modes that set the A/D conversion start timing are provided. These trigger modes are set
by the ADM1 register.
ANI1
INTAD
Conversion end
Conversion start Conversion stop
Set ADCS bit = 1 Set ADCS bit = 0
ANI0
Data 5
Data 1
Data 6
ANI1
Data 2
Data 7
ANI2 Data 3
Data 8
ANI3
Data 4
A/D conversion Data 1 Data 2 Data 3 Data 4 Data 5 Data 6 Data 7 Data 8
operation (ANI0) (ANI1) (ANI2) (ANI3) (ANI0) (ANI1) (ANI2) (ANI3)
INTAD
(1) Resolution
This is the minimum analog input voltage that can be identified. That is, the percentage of the analog input
voltage per bit of digital output is called 1LSB (Least Significant Bit). The percentage of 1LSB with respect to the
full scale is expressed by %FSR (Full Scale Range).
1......1 1......1
Ideal line
Digital output
Digital output
Overall
error 1/2LSB Quantization error
1/2LSB
0......0 0......0
0 AVREF 0 AVREF
Analog input Analog input
111
Digital output (Lower 3 bits)
Full-scale error
Ideal line
110
010
000 000
0 1 2 3 AVREF 0 AVREF−3 AVREF−2 AVREF−1 AVREF
Analog input (LSB) Analog input (LSB)
Figure 11-21. Integral Linearity Error Figure 11-22. Differential Linearity Error
1......1
1......1
Ideal 1LSB width
Ideal line
Digital output
Digital output
Differential
Integral linearity linearity error
error
0......0 0......0
0 AVREF 0 AVREF
Analog input Analog input
Sampling
time
Conversion time
<1> Conflict between A/D conversion result register (ADCR, ADCRH) write and ADCR or ADCRH read by
instruction upon the end of conversion
ADCR or ADCRH read has priority. After the read operation, the new conversion result is written to ADCR
or ADCRH.
<2> Conflict between ADCR or ADCRH write and A/D converter mode register (ADM) write, analog input
channel specification register (ADS), or A/D port configuration register (ADPC) write upon the end of
conversion
ADM, ADS, or ADPC write has priority. ADCR or ADCRH write is not performed, nor is the conversion end
interrupt signal (INTAD) generated.
Reference
voltage AVREF
input
ANI0 to ANI9
C = 100 to 1,000 pF
AVSS
VSS
<1> The analog input pins (ANI0 to ANI7) are also used as input port pins (P20 to P27).
The analog input pins (ANI8 to ANI19) are also used as input port pins (P150 to P151).
When A/D conversion is performed with any of ANI0 to ANI9 selected, do not access P20 to P27 and P150
to P151 while conversion is in progress; otherwise the conversion resolution may be degraded. It is
recommended to select pins used as P20 to P27 and P150 to P151 starting with the ANI0/P20 that is the
furthest from AVREF.
<2> If a digital pulse is applied to the pins adjacent to the pins currently used for A/D conversion, the expected
value of the A/D conversion may not be obtained due to coupling noise. Therefore, do not apply a pulse to
the pins adjacent to the pin undergoing A/D conversion.
ADIF
Remarks 1. n = 0 to 9
2. m = 0 to 9
R1
ANIn
C1 C2
Table 11-4. Resistance and Capacitance Values of Equivalent Circuit (Reference Values)
AVREF Mode R1 C1 C2
Remarks 1. The resistance and capacitance values shown in Table 11-4 are not guaranteed values.
2. n = 0 to 9
The serial array unit has four serial channels per unit and can use two or more of various serial interfaces (3-wire
2
serial (CSI), UART, and simplified I C) in combination.
Function assignment of each channel supported by the μPD79F9211 is as shown below.
2
Channel Used as CSI Used as UART Used as Simplified I C
(Example of combination) When “UART0” is used for channels 0 and 1, CSI00Note and CSI01Note cannot be used,
but CSI10, UART1, or IIC10 can be used.
Each serial interface supported by the μPD79F9211 has the following features.
Item Configuration
Notes 1. The lower 8 bits of the serial data register 0n (SDR0n) can be read or written as the following SFR,
depending on the communication mode.
• CSIp communication … SIOp (CSIp data register)
• UARTq reception … RXDq (UARTq receive data register)
• UARTq transmission … TXDq (UARTq transmit data register)
• IIC10 communication … SIO10 (IIC10 data register)
0 0 0 0 0 SNFEN SNFEN
0 0 0 1 CKO02 CKO01 CKO00 1 SO02 SO01 SO00
10 00
Peripheral enable
register 0 (PER0) Serial clock select register 0 (SPS0) SE03 SE02 SE01 Serial channel enable
SE00
status register 0 (SE0)
PRS PRS PRS PRS PRS PRS PRS PRS
SAU0EN
013 012 011 010 003 002 001 000 Serial channel start
SS03 SS02 SS01 SS00
register 0 (SS0)
Selector Selector
TCLK
Shift register
Output
Edge SCK controller
Serial clock I/O pin detection
(when CSI00: SCK00)
TXE RXE DAP CKP EOC PTC PTC DIR SLC SLC DLS DLS DLS TSF BFF FEF PEF OVF
00 00 00 00 00 001 000 00 001 000 002 001 000 00 00 00 00 00
When UART0
Serial communication operation setting register 00 (SCR00) Serial status register 00 (SSR00)
CK01 CK00
CK01 CK00
Serial data output pin
(when CSI10: SO10)
Serial clock I/O pin Channel 2 (when IIC10: SDA10)
(when CSI10: SCK10) Communication controller (when UART1: TXD1)
(when IIC10: SCL10)
Noise Mode selection
Serial data input pin elimination Edge/level Serial transfer end interrupt
(when CSI10: SI10)
enabled/
detection CSI10 or IIC10 (when CSI10: INTCSI10)
disabled
(when IIC10: SDA10) or UART1 (when IIC10: INTIIC10)
(when UART1: RXD1) (for transmission) (when UART1: INTST1)
SNFEN10
CK01 CK00
Channel 3
Communication controller
Serial transfer end interrupt
(when UART1: INTSR1)
When UART1 Mode selection
UART1
(for reception) Serial transfer error interrupt
Edge/level Error controller
detection (INTSRE1)
7 6 5 4 3 2 1 0
Shift register
Remarks 1. After data is received, “0” is stored in bits 0 to 7 in bit portions that exceed the data length.
2. n: Channel number (n = 0 to 3),
p: CSI number (p = 00, 01, 10),
q: UART number (q = 0, 1)
Address: FFF10H, FFF11H (SDR00), FFF12H, FFF13H (SDR01), After reset: 0000H R/W
FFF44H, FFF45H (SDR02), FFF46H, FFF47H (SDR03)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SDR0n 0
(n = 0 to 3)
7 6 5 4 3 2 1 0
Shift register
Remarks 1. For the function of the higher 7 bits of SDR0n, see 12.3 Registers Controlling Serial Array
Unit.
2. n: Channel number (n = 0 to 3),
Cautions 1. When setting serial array unit, be sure to set SAU0EN to 1 first. If SAU0EN = 0, writing to
a control register of serial array unit is ignored, and, even if the register is read, only the
default value is read (except for input switch control register (ISC), noise filter enable
register (NFEN0), port input mode registers (PIM3, PIM7), port output mode registers
(POM3, POM7), port mode registers (PM3, PM7), and port registers (P3, P7)).
2. After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more
clocks have elapsed.
3. Be sure to clear bits 0, 1, 3, 4, and 6 of PER0 register to 0.
Address: F0126H, F0127H (SPS0), F0166H, F0167H (SPS1) After reset: 0000H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Note 1
PRS PRS PRS PRS Section of operation clock (CK0p)
0p3 0p2 0p1 0p0 fCLK = 2 MHz fCLK = 5 MHz fCLK = 10 MHz fCLK = 20 MHz
Notes1. When changing the clock selected for fCLK (by changing the system clock control register (CKC)
value), do so after having stopped (ST0 = 000FH) the operation of the serial array unit (SAU). When
selecting INTTM02 for the operation clock, also stop the timer array unit TAUS (TT0 = 00FFH).
2. SAU can be operated at a fixed division ratio of the subsystem clock, regardless of the fCLK frequency
(main system clock, subsystem clock), by setting the TIS02 bit of the TIS0 register of TAUS to 1,
selecting fSUB/4 for the input clock, and selecting INTTM02 using the SPS0 register. When changing
fCLK, however, SAU and TAUS must be stopped as described in Note 1 above.
Address: F0110H, F0111H (SMR00) to F0116H, F0117H (SMR03) After reset: 0020H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Transfer clock TCLK is used for the shift register, communication controller, output controller, interrupt controller,
and error controller. When CCS0n = 0, the division ratio of MCK is set by the higher 7 bits of the SDR0n register.
Caution Be sure to clear bits 13 to 9, 7, 4, and 3 to “0”. Be sure to set bit 5 to “1”.
Address: F0110H, F0111H (SMR00) to F0116H, F0117H (SMR03) After reset: 0020H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 CSI mode
0 1 UART mode
2
1 0 Simplified I C mode
1 1 Setting prohibited
For successive transmission, the next transmit data is written by setting MD0n0 to 1 when SDR0n data has run out.
Figure 12-6. Format of Serial Communication Operation Setting Register 0n (SCR0n) (1/3)
Address: F0118H, F0119H (SCR00) to F011EH, F011FH (SCR03) After reset: 0087H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR0n TXE RXE DAP CKP 0 EOC PTC PTC DIR 0 SLC SLC 0 DLS DLS DLS
0n 0n 0n 0n 0n 0n1 0n0 0n 0n1 0n0 0n2 0n1 0n0
0 0 SCKp
SOp D7 D6 D5 D4 D3 D2 D1 D0
SIp input timing
0 1 SCKp
SOp D7 D6 D5 D4 D3 D2 D1 D0
SIp input timing
1 0 SCKp
SOp D7 D6 D5 D4 D3 D2 D1 D0
SIp input timing
1 1 SCKp
SOp D7 D6 D5 D4 D3 D2 D1 D0
SIp input timing
2
Be sure to set DAP0n, CKP0n = 0, 0 in the UART mode and simplified I C mode.
Caution Be sure to clear bits 3, 6, and 11 to “0”. Be sure to set bit 2 to “1”.
Figure 12-6. Format of Serial Communication Operation Setting Register 0n (SCR0n) (2/3)
Address: F0118H, F0119H (SCR00) to F011EH, F011FH (SCR03) After reset: 0087H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR0n TXE RXE DAP CKP 0 EOC PTC PTC DIR 0 SLC SLC 0 DLS DLS DLS
0n 0n 0n 0n 0n 0n1 0n0 0n 0n1 0n0 0n2 0n1 0n0
0 0 No stop bit
0 1 Stop bit length = 1 bit
1 0 Stop bit length = 2 bits
1 1 Setting prohibited
When the transfer end interrupt is selected, the interrupt is generated when all stop bits have been completely
transferred.
2
Set 1 bit (SLC0n1, SLC0n0 = 0, 1) during UART reception and in the simplified I C mode.
Set no stop bit (SLC0n1, SLC0n0 = 0, 0) in the CSI mode.
Note When using CSI01 not with EOC01 = 0, error interrupt INTSRE0 may be generated.
Caution Be sure to clear bits 3, 6, and 11 to “0”. Be sure to set bit 2 to “1”.
Figure 12-6. Format of Serial Communication Operation Setting Register 0n (SCR0n) (3/3)
Address: F0118H, F0119H (SCR00) to F011EH, F011FH (SCR03) After reset: 0087H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR0n TXE RXE DAP CKP 0 EOC PTC PTC DIR 0 SLC SLC 0 DLS DLS DLS
0n 0n 0n 0n 0n 0n1 0n0 0n 0n1 0n0 0n2 0n1 0n0
DLS DLS DLS Setting of data length in CSI and UART modes
0n2 0n1 0n0
Caution Be sure to clear bits 3, 6, and 11 to “0”. Be sure to set bit 2 to “1”.
Address: FFF10H, FFF11H (SDR00), FFF12H, FFF13H (SDR01), After reset: 0000H R/W
FFF44H, FFF45H (SDR02), FFF46H, FFF47H (SDR03)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SDR0n 0
0 0 0 0 0 0 0 MCK/2
0 0 0 0 0 0 1 MCK/4
0 0 0 0 0 1 0 MCK/6
0 0 0 0 0 1 1 MCK/8
• • • • • • • •
• • • • • • • •
• • • • • • • •
1 1 1 1 1 1 0 MCK/254
1 1 1 1 1 1 1 MCK/256
Remarks 1. For the function of the lower 8 bits of SDR0n, see 12.2 Configuration of Serial Array Unit.
2. n: Channel number (n = 0 to 3)
Address: F0100H, F0101H (SSR00) to F0106H, F0107H (SSR03) After reset: 0000H R
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
This is an updating flag. It is automatically cleared when transfer from the SDR0n register to the shift register is
completed. During reception, it is automatically cleared when data has been read from the SDR0n register. This
flag is cleared also when the ST0n/SS0n bit is set to 1.
This flag is automatically set if transmit data is written to the SDR0n register when the TXE0n bit of the SCR0n
register = 1 (transmission or reception mode in each communication mode). It is automatically set if receive data is
stored in the SDR0n register when the RXE0n bit of the SCR0n register = 1 (transmission or reception mode in
each communication mode). It is also set in case of a reception error.
If data is written to the SDR0n register when BFF0n = 1, the transmit/receive data stored in the register is discarded
and an overrun error (OVF0n = 1) is detected.
Address: F0100H, F0101H (SSR00) to F0106H, F0107H (SSR03) After reset: 0000H R
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 No error occurs.
1 A framing error occurs during UART reception.
<Framing error cause>
A framing error occurs if the stop bit is not detected upon completion of UART reception.
This is a cumulative flag and is not cleared until 1 is written to the FECT0n bit of the SIR0n register.
This is a cumulative flag and is not cleared until 1 is written to the PECT0n bit of the SIR0n register.
0 No error occurs.
1 An overrun error occurs.
<Causes of overrun error>
• Receive data stored in the SDR0n register is not read and transmit data is written or the next receive
data is written.
• Transmit data is not ready for slave transmission or reception in the CSI mode.
This is a cumulative flag and is not cleared until 1 is written to the OVCT0n bit of the SIR0n register.
Address: F0108H, F0109H (SIR00) to F010EH, F010FH (SIR03) After reset: 0000H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 No trigger operation
1 Clears the FEF0n bit of the SSR0n register to 0.
0 No trigger operation
1 Clears the PEF0n bit of the SSR0n register to 0.
0 No trigger operation
1 Clears the OVF0n bit of the SSR0n register to 0.
0 Operation stops (stops with the values of the control register and shift register, and the statuses of the serial
Note
clock I/O pin, serial data output pin, and the FEF, PEF, and OVF error flags retained ).
1 Operation is enabled.
Note Bits 6 and 5 (TSF0n, BFF0n) of the SSR0n register are cleared.
0 No trigger operation
1 Sets SE0n to 1 and enters the communication wait status (if a communication operation is already under
execution, the operation is stopped and the start condition is awaited).
0 No trigger operation
1 Clears SE0n to 0 and stops the communication operation.
(Stops with the values of the control register and shift register, and the statuses of the serial clock I/O pin,
Note
serial data output pin, and the FEF, PEF, and OVF error flags retained ).
Note Bits 6 and 5 (TSF0n, BFF0n) of the SSR0n register are cleared.
• P30/SO10/TxD1/TO11, P31/SI10/RxD1/SDA10/INTP1/TI09,
32/SCK10/SCL10/INTP2, P70/SO01/INTP4, P72/SCK01/INTP6,
P73/SO00/TxD0/TO10, P75/SCK00/TI11
Caution Be sure to set bits 11 and 3of SO0 to “1”. And be sure to clear bits 15 to 12 and 7 to 4 of SO0
to “0”.
SOL Selects inversion of the level of the transmit data of channel n in UART mode
0n
0 Uses the input signal of the TI07 pin as a timer input (normal operation).
1 Input signal of RXD0 pin is used as timer input (wakeup signal detection).
0 Uses the input signal of the INTP0 pin as an external interrupt (normal operation).
1 Uses the input signal of the RXD0 pin as an external interrupt
(to measure the pulse widths of the sync break field and sync field).
Figure 12-18. Format of Port Input Mode Registers 3 and 7 (PIM3 and PIM7)
Figure 12-19. Format of Port Output Mode Registers 3 and 7 (POM3 and POM7)
Figure 12-20. Format of Port Mode Registers 3 and 7 (PM3 and PM7)
Each serial interface of serial array unit has the operation stop mode.
In this mode, serial communication cannot be executed, thus reducing the power consumption.
In addition, the following pins can be used as ordinary port pins in this mode.
Figure 12-21. Peripheral Enable Register 0 (PER0) Setting When Stopping the Operation by Units
× 0 × 0 0 0/1 0 0
Control of SAU input clock
0: Stops supply of input clock
1: Supplies input clock
Cautions 1. If SAU0EN = 0, writing to a control register of serial array unit is ignored, and, even if the
register is read, only the default value is read (except for input switch control register
(ISC), noise filter enable register (NFEN0), port input mode registers (PIM3, PIM7), port
output mode registers (POM3, POM7), port mode registers (PM3, PM7), and port registers
(P3, P7)).
2. Be sure to clear bits 0, 1, 3, 4, and 6 of PER0 register to 0.
Figure 12-22. Each Register Setting When Stopping the Operation by Channels (1/2)
(a) Serial Channel Enable Status Register 0 (SE0) … This register indicates whether data
transmission/reception operation of each channel is enabled or stopped.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
* The SE0 register is a read-only status register, whose operation is stopped by using the ST0 register.
With a channel whose operation is stopped, the value of CKO0n of the SO0 register can be set by software.
(b) Serial channel stop register 0 (ST0) … This register is a trigger register that is used to enable
stopping communication/count by each channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(c) Serial output enable register 0 (SOE0) … This register is a register that is used to enable or stop
output of the serial communication operation of each channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
* For channel n, whose serial output is stopped, the SO0n value of the SO0 register can be set by software.
(d) Serial output register 0 (SO0) …This register is a buffer register for serial output of each channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
* When using pins corresponding to each channel as port function pins, set the corresponding CKO0n and SO0n bits to “1”.
This is a clocked communication function that uses three lines: serial clock (SCK) and serial data (SI and SO) lines.
[Data transmission/reception]
• Data length of 7 or 8 bits
• Phase control of transmit/receive data
• MSB/LSB first selectable
• Level setting of transmit/receive data
[Clock control]
• Master/slave selection
• Phase control of I/O clock
• Setting of transfer period by prescaler and internal counter of each channel
[Interrupt function]
• Transfer end interrupt/buffer empty interrupt
[Error detection flag]
• Overrun error
The channels supporting 3-wire serial I/O (CSI00, CSI01, CSI10) are channels 0 to 2 of SAU and channel.
2
Channel Used as CSI Used as UART Used as Simplified I C
1 CSI01 −
3 − −
3-wire serial I/O (CSI00, CSI01, CIS10) performs the following six types of communication operations.
• Master transmission (See 12.5.1.)
• Master reception (See 12.5.2.)
• Master transmission/reception (See 12.5.3.)
• Slave transmission (See 12.5.4.)
• Slave reception (See 12.5.5.)
• Slave transmission/reception (See 12.5.6.)
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Note Use this operation within a range that satisfies the conditions above and the AC characteristics in the
electrical specifications (see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
Figure 12-23. Example of Contents of Registers for Master Transmission of 3-Wire Serial I/O
(CSI00, CSI01, CSI10)
(a) Serial output register 0 (SO0) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(b) Serial output enable register 0 (SOE0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(c) Serial channel start register 0 (SS0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR0n TXE0n RXE0n DAP0n CKP0n EOC0n PTC0n1 PTC0n0 DIR0n SLC0n1 SLC0n0 DLS0n2 DLS0n1 DLS0n0
1 0 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SDR0n
Baud rate setting Transmit data setting
0
SIOp
Remark n: Channel number (n = 0 to 2 )
p: CSI number (p = 00, 01, 10)
: Setting is fixed in the CSI master transmission mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Remark Even after communication is stopped, the pin level is retained. To resume the operation, re-set the
SO0 register (see Figure 12-26 Procedure for Resuming Master Transmission).
SS0n
SE0n
Data transmission (8-bit length) Data transmission (8-bit length) Data transmission (8-bit length)
TSF0n
Port manipulation
Yes
No
Transmission completed?
Yes
End of communication
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Figure 12-29. Timing Chart of Master Transmission (in Continuous Transmission Mode)
SS0n
SE0n
Data transmission (8-bit length) Data transmission (8-bit length) Data transmission (8-bit length)
MD0n0
TSF0n
BFF0n
Note When transmit data is written to the SDR0n register while BFF0n = 1, the transmit data is overwritten.
Port manipulation
Yes <3>
Yes
Transmitting next data?
No
TSF0n = 1?
No
Yes
No
Transfer end interrupt
generated?
<5>
Yes
Yes
Writing 1 to MD0n0 bit Communication continued?
No
End of communication
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Remark <1> to <5> in the figure correspond to <1> to <5> in Figure 12-29 Timing Chart of Master
Transmission (in Continuous Transmission Mode).
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Note . Use this operation within a range that satisfies the conditions above and the AC characteristics in the electrical
specifications (see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
Figure 12-31. Example of Contents of Registers for Master Reception of 3-Wire Serial I/O
(CSI00, CSI01, CSI10)
(a) Serial output register 0 (SO0) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(c) Serial channel start register 0 (SS0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR0n TXE0n RXE0n DAP0n CKP0n EOC0n PTC0n1 PTC0n0 DIR0n SLC0n1 SLC0n0 DLS0n2 DLS0n1 DLS0n0
0 1 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SIOp
Remark n: Channel number (n = 0 to 2)
p: CSI number (p = 00, 01, 10)
: Setting is fixed in the CSI master transmission mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
(2) Operation procedure
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Remark Even after communication is stopped, the pin level is retained. To resume the operation, re-set the
SO0 register (see Figure 12-34 Procedure for Resuming Master Reception).
SS0n
SE0n
Receive data 1 Receive data 2 Receive data 3
SDR0n Dummy data for reception Dummy data Dummy data
Write Write Write
Read Read Read
SCKp pin
SIp pin Receive data 1 Receive data 2 Receive data 3
Shift
Reception & shift operation Reception & shift operation Reception & shift operation
register 0n
INTCSIp
Port manipulation
Starting reception
No
Transfer end interrupt
generated?
Yes
Reading
SIOp (= SDR0n[7:0])
register
No
Reception completed?
Yes
End of communication
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Pins used SCK00, SI00, SO00 SCK01, SI01, SO01 SCK10, SI10, SO10
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Note. Use this operation within a range that satisfies the conditions above and the AC characteristics in the electrical
specifications (see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
Figure 12-37. Example of Contents of Registers for Master Transmission/Reception of 3-Wire Serial I/O
(CSI00, CSI01, CSI10)
(a) Serial output register 0 (SO0) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(b) Serial output enable register 0 (SOE0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(c) Serial channel start register 0 (SS0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR0n TXE0n RXE0n DAP0n CKP0n EOC0n PTC0n1 PTC0n0 DIR0n SLC0n1 SLC0n0 DLS0n2 DLS0n1 DLS0n0
1 1 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SDR0n
Baud rate setting Transmit data setting/receive data register
0
SIOp
Remark n: Channel number (n = 0 to 2 )
p: CSI number (p = 00, 01, 10)
: Setting is fixed in the CSI master transmission mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Remark Even after communication is stopped, the pin level is retained. To resume the operation, re-set the
SO0 register (see Figure 12-40 Procedure for Resuming Master Transmission/Reception).
SS0n
SE0n
Receive data 1 Receive data 2 Receive data 3
SDR0n Transmit data 1 Transmit data 2 Transmit data 3
Write Write Write
Read Read Read
SCKp pin
SIp pin Receive data 1 Receive data 2 Receive data 3
Shift
Reception & shift operation Reception & shift operation Reception & shift operation
register 0n
SOp pin Transmit data 1 Transmit data 2 Transmit data 3
INTCSIp
Port manipulation
Starting transmission/reception
Yes
Reading
SIOp (=SDR0n[7:0])
register
No
Transmission/reception
completed?
Yes
End of communication
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Figure 12-43. Timing Chart of Master Transmission/Reception (in Continuous Transmission/Reception Mode)
SS0n
SE0n
Receive data 3
SDR0n Transmit data 1 Transmit data 2 Receive data 1 Transmit data 3 Receive data 2
Write Write Write
Read Read Read
SCKp pin
SIp pin Receive data 1 Receive data 2 Receive data 3
Shift
Reception & shift operation Reception & shift operation Reception & shift operation
register 0n
SOp pin Transmit data 1 Transmit data 2 Transmit data 3
INTCSIp
TSF0n
BFF0n
<1> <2> <3> <2> <3> <4> <2> <3> <4> <5> <6> <7><8>
(Note 1) (Note 2) (Note 2)
Notes 1. When transmit data is written to the SDR0n register while BFF0n = 1, the transmit data is
overwritten.
2. The transmit data can be read by reading the SDR0n register during this period. At this time, the
transfer operation is not affected.
Remarks 1. <1> to <8> in the figure correspond to <1> to <8> in Figure 12-44 Flowchart of Master
Transmission/Reception (in Continuous Transmission/Reception Mode).
2. n: Channel number (n = 0 to 2)
p: CSI number (p = 00, 01, 10)
Port manipulation
No
<3> Buffer empty interrupt
generated?
Yes
Reading receive data to
<4>
SIOp (=SDR0n[7:0])
Yes
Communication data
exists?
No
TSF0n = 1?
No
Yes
No
Transfer end interrupt
<6> generated?
Yes
Yes
Writing 1 to MD0n0 bit Communication continued?
No
End of communication
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Remark <1> to <8> in the figure correspond to <1> to <8> in Figure 12-43 Timing Chart of Master
Transmission/Reception (in Continuous Transmission/Reception Mode).
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Notes 1. Because the external serial clock input to pins SCK00, SCK01, and SCK10 is sampled internally and
used, the fastest baud rate is the smaller of fCLK/6 [MHz] and fMCK/2 [MHz].
2. Use this operation within a range that satisfies the conditions above and the AC characteristics in the
electrical specifications (see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
Figure 12-45. Example of Contents of Registers for Slave Transmission of 3-Wire Serial I/O
(CSI00, CSI01, CSI10)
(a) Serial output register 0 (SO0) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(b) Serial output enable register 0 (SOE0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(c) Serial channel start register 0 (SS0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR0n TXE0n RXE0n DAP0n CKP0n EOC0n PTC0n1 PTC0n0 DIR0n SLC0n1 SLC0n0 DLS0n2 DLS0n1 DLS0n0
1 0 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SDR0n
Baud rate setting Transmit data setting
0
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Remark Even after communication is stopped, the pin level is retained. To resume the operation, re-set the
SO0 register (see Figure 12-48 Procedure for Resuming Slave Transmission).
(Essential) Starting target for communication Starts the target for communication.
SS0n
SE0n
Data transmission (8-bit length) Data transmission (8-bit length) Data transmission (8-bit length)
TSF0n
Port manipulation
Yes
No
Transmission completed?
Yes
End of communication
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Figure 12-51. Timing Chart of Slave Transmission (in Continuous Transmission Mode)
SS0n
SE0n
Data transmission (8-bit length) Data transmission (8-bit length) Data transmission (8-bit length)
MD0n0
TSF0n
BFF0n
Note When transmit data is written to the SDR0n register while BFF0n = 1, the transmit data is overwritten.
Caution The MD0n0 bit can be rewritten even during operation. However, rewrite it before transfer of
the last bit is started.
Port manipulation
Yes <3>
Yes
Transmitting next data?
No
TSF0n = 1?
No
Yes
No
Transfer end interrupt
generated?
Yes <5>
Yes
Writing 1 to MD0n0 bit Communication continued?
No
End of communication
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Remark <1> to <5> in the figure correspond to <1> to <5> in Figure 12-51 Timing Chart of Slave
Transmission (in Continuous Transmission Mode).
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Notes 1. Because the external serial clock input to pins SCK00, SCK01, and SCK10 is sampled internally and
used, the fastest baud rate is the smaller of fCLK/6 [MHz] and fMCK/2 [MHz].
2. Use this operation within a range that satisfies the conditions above and the AC characteristics in the
electrical specifications (see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
Figure 12-53. Example of Contents of Registers for Slave Reception of 3-Wire Serial I/O
(CSI00, CSI01, CSI10)
(c) Serial channel start register 0 (SS0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR0n TXE0n RXE0n DAP0n CKP0n EOC0n PTC0n1 PTC0n0 DIR0n SLC0n1 SLC0n0 DLS0n2 DLS0n1 DLS0n0
0 1 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SDR0n 0000000
(baud rate setting) Receive data register
0
SIOp
Remark n: Channel number (n = 0 to 2)
p: CSI number (p = 00, 01, 10)
: Setting is fixed in the CSI master transmission mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
SS0n
SE0n
Receive data 3
SDR0n Receive data 1 Receive data 2
Data reception (8-bit length) Data reception (8-bit length) Data reception (8-bit length)
TSF0n
Port manipulation
Starting reception
Yes
Reading
SIOp (=SDR0n[7:0])
register
No
Reception completed?
Yes
End of communication
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Pins used SCK00, SI00, SO00 SCK01, SI01, SO01 SCK10, SI10, SO10
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Notes 1. Because the external serial clock input to pins SCK00, SCK01, and SCK10 is sampled internally and
used, the fastest baud rate is the smaller of fCLK/6 [MHz] and fMCK/2 [MHz].
2. Use this operation within a range that satisfies the conditions above and the AC characteristics in the
electrical specifications (see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
Figure 12-59. Example of Contents of Registers for Slave Transmission/Reception of 3-Wire Serial I/O
(CSI00, CSI01 CSI10)
(a) Serial output register 0 (SO0) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(b) Serial output enable register 0 (SOE0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(c) Serial channel start register 0 (SS0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR0n TXE0n RXE0n DAP0n CKP0n EOC0n PTC0n1 PTC0n0 DIR0n SLC0n1 SLC0n0 DLS0n2 DLS0n1 DLS0n0
1 1 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SDR0n 0000000
(baud rate setting) Transmit data setting/receive data register
0
SIOp
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Remark Even after communication is stopped, the pin level is retained. To resume the operation, re-set the
SO0 register (see Figure 12-62 Procedure for Resuming Slave Transmission/Reception).
(Essential) Starting target for communication Starts the target for communication.
SS0n
SE0n
Receive data 1 Receive data 2 Receive data 3
SDR0n Transmit data 1 Transmit data 2 Transmit data 3
Write Write Write
Read Read Read
SCKp pin
SIp pin Receive data 1 Receive data 2 Receive data 3
Shift Reception & shift operation Reception & shift operation Reception & shift operation
register 0n
SOp pin Transmit data 1 Transmit data 2 Transmit data 3
INTCSIp
Port manipulation
Starting transmission/reception
Yes
Reading
SIOp (=SDR0n[7:0])
register
No
Transmission/reception
completed?
Yes
End of communication
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Figure 12-65. Timing Chart of Slave Transmission/Reception (in Continuous Transmission/Reception Mode)
SS0n
SE0n
Receive data 3
SDR0n Transmit data 1 Transmit data 2 Receive data 1 Transmit data 3 Receive data 2
Write Write Write
Read Read Read
SCKp pin
SIp pin Receive data 1 Receive data 2 Receive data 3
Shift
Reception & shift operation Reception & shift operation Reception & shift operation
register 0n
SOp pin Transmit data 1 Transmit data 2 Transmit data 3
INTCSIp
TSF0n
BFF0n
<1> <2> <3> <2> <3> <4> <2> <3> <4> <5> <6> <7><8>
(Note 1) (Note 2) (Note 2)
Notes 1. When transmit data is written to the SDR0n register while BFF0n = 1, the transmit data is
overwritten.
2. The transmit data can be read by reading the SDR0n register during this period. At this time, the
transfer operation is not affected.
Remarks 1. <1> to <8> in the figure correspond to <1> to <8> in Figure 12-66 Flowchart of Slave
Transmission/Reception (in Continuous Transmission/Reception Mode).
2. n: Channel number (n = 0 to 2)
p: CSI number (p = 00, 01, 10)
Port manipulation
No
<3> Buffer empty interrupt
generated?
Yes
Reading receive data to
<4>
SIOp (=SDR0n[7:0])
Yes
Communication data
exists?
No
TSF0n = 1?
No
Yes
No
Transfer end interrupt
<6> generated?
Yes
Yes
Writing 1 to MD0n0 bit Communication continued?
No
End of communication
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Remark <1> to <8> in the figure correspond to <1> to <8> in Figure 12-65 Timing Chart of Slave
Transmission/Reception (in Continuous Transmission/Reception Mode).
(1) Master
(Transfer clock frequency) = {Operation clock (MCK) frequency of target channel} ÷ (SDR0n[15:9] + 1) ÷ 2 [Hz]
(2) Slave
(Transfer clock frequency) = {Frequency of serial clock (SCK) supplied by master}Note [Hz]
Note. The permissible maximum frequency is the smaller of fCLK/6 [MHz] and fMCK/2 [MHz].
Remarks 1. The value of SDR0n[15:9] is the value of bits 15 to 9 of the SDR0n register (0000000B to
1111111B) and therefore is 0 to 127.
2. n: Channel number (n = 0 to 2)
The operation clock (MCK) is determined by serial clock select register 0 (SPS0) and bit 15 (CKS0n) of serial mode
register 0n (SMR0n).
Notes 1. When changing the clock selected for fCLK (by changing the system clock control register (CKC)
value), do so after having stopped (ST0 = 000FH) the operation of the serial array unit (SAU).
When selecting INTTM02 for the operation clock, also stop the timer array unit TAUS (TT0 =
00FFH).
2. SAU can be operated at a fixed division ratio of the subsystem clock, regardless of the fCLK
frequency (main system clock, subsystem clock), by setting the TIS02 bit of the TIS0 register of
TAUS to 1, selecting fSUB/4 for the input clock, and selecting INTTM02 using the SPS0 register.
When changing fCLK, however, SAU and TAUS must be stopped as described in Note 1 above.
This is a start-stop synchronization function using two lines: serial data transmission (TxD) and serial data
reception (RxD) lines. It transmits or receives data in asynchronization with the party of communication (by using an
internal baud rate). Full-duplex UART communication can be realized by using two channels, one dedicated to
transmission (even channel) and the other to reception (odd channel).
[Data transmission/reception]
• Data length of 5, 7, or 8 bits
• Select the MSB/LSB first
• Level setting of transmit/receive data and select of reverse
• Parity bit appending and parity check functions
• Stop bit appending
[Interrupt function]
• Transfer end interrupt/buffer empty interrupt
• Error interrupt in case of framing error, parity error, or overrun error
[Error detection flag]
• Framing error, parity error, or overrun error
2
Channel Used as CSI Used as UART Used as Simplified I C
1 CSI01 −
3 − −
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Max. fMCK/6 [bps] (SDR0n [15:9] = 2 or more), Min. fCLK/(2 × 2 × 128) [bps]
11 Note
Transfer rate
Note Use this operation within a range that satisfies the conditions above and the AC characteristics in the electrical
specifications (see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)
(a) Serial output register 0 (SO0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(b) Serial output enable register 0 (SOE0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(c) Serial channel start register 0 (SS0) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(d) Serial output level register 0 (SOL0) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Note. Before transmission is started, be sure to set to 1 when the SOL0n bit of the target channel is set to
0, and set to 0 when the SOL0n bit of the target channel is set to 1. The value varies depending on
the communication data during communication operation.
SCR0n TXE0n RXE0n DAP0n CKP0n EOC0n PTC0n1 PTC0n0 DIR0n SLC0n1 SLC0n0 DLS0n2 DLS0n1 DLS0n0
1 0 0 0 0 0 0/1 0/1 0/1 0 0/1 0/1 0 1 0/1 0/1
SDR0n
Baud rate setting Transmit data setting
0
TXDq
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Remark Even after communication is stopped, the pin level is retained. To resume the operation, re-set the
SO0 register (see Figure 12-70 Procedure for Resuming UART Transmission).
SS0n
SE0n
Data transmission (7-bit length) Data transmission (7-bit length) Data transmission (7-bit length)
TSF0n
Port manipulation
Yes
No
Transmission completed?
Yes
End of communication
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Figure 12-73. Timing Chart of UART Transmission (in Continuous Transmission Mode)
SS0n
SE0n
Data transmission (7-bit length) Data transmission (7-bit length) Data transmission (7-bit length)
MD0n0
TSF0n
BFF0n
Note When transmit data is written to the SDR0n register while BFF0n = 1, the transmit data is overwritten.
Port manipulation
Yes <3>
Yes
Transmitting next data?
No
TSF0n = 1?
No
Yes
Yes <5>
Yes
Writing 1 to MD0n0 bit Communication continued?
No
End of communication
Caution After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Remark <1> to <5> in the figure correspond to <1> to <5> in Figure 12-73 Timing Chart of UART
Transmission (in Continuous Transmission Mode).
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Max. fMCK/6 [bps] (SDR0n [15:9] = 2 or more), Min. fCLK/(2 × 2 × 128) [bps]
11 Note
Transfer rate
Note Use this operation within a range that satisfies the conditions above and the AC characteristics in the electrical
specifications (see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
(c) Serial channel start register 0 (SS0) … Sets only the bits of the target channel is 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Caution For the UART reception, be sure to set SMR0r of channel r that is to be paired with channel n.
SCR0n TXE0n RXE0n DAP0n CKP0n EOC0n PTC0n1 PTC0n0 DIR0n SLC0n1 SLC0n0 DLS0n2 DLS0n1 DLS0n0
0 1 0 0 0 1 0/1 0/1 0/1 0 0 1 0 1 0/1 0/1
SDR0n
Baud rate setting Receive data register
0
RXDq
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
SS0n
SE0n
Receive data 3
SDR0n Receive data 1 Receive data 2
Data reception (7-bit length) Data reception (7-bit length) Data reception (7-bit length)
TSF0n
Port manipulation
Starting reception
Yes
Reading RXDq register
(SDR0n[7:0]) Error processing
Reception completed?
No
Yes
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
Interrupt INTST0 −
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer
mode) can be selected.
Max. fMCK/6 [bps] (SDR00 [15:9] = 2 or more), Min. fCLK/(2 × 2 × 128) [bps]
11 Note
Transfer rate
Note Use this operation within a range that satisfies the conditions above and the AC characteristics in the electrical
specifications (see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TARGET)).
LIN stands for Local Interconnect Network and is a low-speed (1 to 20 kbps) serial communication protocol
designed to reduce the cost of an automobile network.
Communication of LIN is single-master communication and up to 15 slaves can be connected to one master.
The slaves are used to control switches, actuators, and sensors, which are connected to the master via LIN.
Usually, the master is connected to a network such as CAN (Controller Area Network).
A LIN bus is a single-wire bus to which nodes are connected via transceiver conforming to ISO9141.
According to the protocol of LIN, the master transmits a frame by attaching baud rate information to it. A slave
receives this frame and corrects a baud rate error from the master. If the baud rate error of a slave is within ±15%,
communication can be established.
Wakeup signal Sync break Sync field Identification Data field Data field Checksum
frame field field field
LIN Bus
TXD0
(output)
INTST0Note 3
Notes 1. The baud rate is set so as to satisfy the standard of the wakeup signal and data of 00H is transmitted.
2. A sync break field is defined to have a width of 13 bits and output a low level. Where the baud rate for
main transfer is N [bps], therefore, the baud rate of the sync break field is calculated as follows.
(Baud rate of sync break field) = 9/13 × N
By transmitting data of 00H at this baud rate, a sync break field is generated.
3. INTST0 is output upon completion of transmission. INTST0 is also output when SBF transmission is
executed.
Writing 1 to SS00
Transmitting wakeup
signal frame
Transmitting
sync break field
Writing 1 to ST00
Writing 1 to SS00
Identification field
Data field
Receiving data
Checksum field
Interrupt INTSR0 −
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Max. fMCK/6 [bps] (SDR01 [15:9] = 2 or more), Min. fCLK/(2 × 2 × 128) [bps]
11 Note
Transfer rate
Note Use this operation within a range that satisfies the conditions above and the AC characteristics in the electrical
specifications (see CHAPTER 26 ELECTRICAL SPECIFICATIONS (TERGET)).
Wakeup signal Sync break Sync field Identification Data filed Data filed Checksum
frame field field field
LIN Bus
<2> <5>
RXD0 (input)
Disable Enable
<3>
Reception interrupt
(INTSR0)
<1>
Edge detection
(INTP0)
<4>
Capture
Disable Enable
timer
<1> The wakeup signal is detected by detecting an interrupt edge (INTP0) on a pin. When the wakeup signal is
detected, enable reception of UART0 (RXE01 = 1) and wait for SBF reception.
<2> When the start bit of SBF is detected, reception is started and serial data is sequentially stored in the RXD0
register (= bits 7 to 0 of the serial data register 01 (SDR01)) at the set baud rate. When the stop bit is
detected, the reception end interrupt request (INTSR0) is generated. When data of low levels of 11 bits or
more is detected as SBF, it is judged that SBF reception has been correctly completed. If data of low levels
of less than 11 bits is detected as SBF, it is judged that an SBF reception error has occurred, and the system
returns to the SBF reception wait status.
<3> When SBF reception has been correctly completed, start channel 7 of the timer array unit TAUS and
measure the bit interval (pulse width) of the sync field (see 6.7.5 Operation as input signal high-/low-level
width measurement).
<4> Calculate a baud rate error from the bit interval of sync field (SF). Stop UART0 once and adjust (re-set) the
baud rate.
<5> The checksum field should be distinguished by software. In addition, processing to initialize UART0 after the
checksum field is received and to wait for reception of SBF should also be performed by software.
Figure 12-84 shows the configuration of a port that manipulates reception of LIN.
The wakeup signal transmitted from the master of LIN is received by detecting an edge of an external interrupt
(INTP0). The length of the sync field transmitted from the master can be measured by using the external event
capture operation of the timer array unit TAUS to calculate a baud-rate error.
By controlling switch of port input (ISC0/ISC1), the input source of port input (RxD0) for reception can be input to
the external interrupt pin (INTP0) and timer array unit TAUS.
Selector
P74/SI00/RxD0/TI10
RXD0 input
Port mode
(PMxxNote)
Output latch
(PxxNote)
Selector
Selector
P120/INTP0/
EXLVI
INTP0 input
Port mode
(PM120) Port input
switch control
(ISC0)
Output latch
(P120) <ISC0>
0: Selects INTP0 (P120)
1: Selects RxD0 (PxxNote)
Selector
Selector
P51/TI07/TO07
Port mode
(PM51) Port input
switch control
(ISC1)
Output latch
(P51) <ISC1>
0: Selects TI07 (P51)
1: Selects RxD0 (PxxNote)
Note xx = 74
Remark ISC0, ISC1: Bits 0 and 1 of the input switch control register (ISC) (See Figure 12-16.)
The peripheral functions used for the LIN communication operation are as follows.
Wakeup detected?
SBF detected?
INTP0,
TAUS
Stopping operation
Sync field
Detecting low-level width
Writing 1 to SS01
SAU
Identification field
Receiving data
For Data field
Checksum field
details,
See Writing 1 to ST01
Figure
13-81 End of LIN communication
(Baud rate) = {Operation clock (MCK) frequency of target channel} ÷ (SDR0n[15:9] + 1) ÷ 2 [bps]
Remarks 1. When UART is used, the value of SDR0n[15:9] is the value of bits 15 to 9 of the SDR0n
register (0000010B to 1111111B) and therefore is 2 to 127.
2. n: Channel number (n = 0 to 3)
The operation clock (MCK) is determined by serial clock select register 0 (SPS0) and bit 15 (CKS0n) of serial
mode register 0n (SMR0n).
Notes 1. When changing the clock selected for fCLK (by changing the system clock control register (CKC)
value), do so after having stopped (ST0 = 000FH) the operation of the serial array unit (SAU).
When selecting INTTM02 for the operation clock, also stop the timer array unit TAUS (TT0 =
00FFH).
2. SAU can be operated at a fixed division ratio of the subsystem clock, regardless of the fCLK
frequency (main system clock, subsystem clock), by setting the TIS02 bit of the TIS0 register of
TAUS to 1, selecting fSUB/4 for the input clock, and selecting INTTM02 using the SPS0 register.
When changing fCLK, however, SAU and TAUS must be stopped as described in Note 1 above.
(Baud rate error) = (Calculated baud rate value) ÷ (Target baud rate) × 100 − 100 [%]
±0.0 %
3
31250 bps fCLK/2 39 31250.0 bps
2
38400 bps fCLK/2 64 38461.5 bps +0.16 %
2 × k × Nfr
(Maximum receivable baud rate) = × Brate
2 × k × Nfr − k + 2
2 × k × (Nfr − 1)
(Minimum receivable baud rate) = × Brate
2 × k × Nfr − k − 2
Brate: Calculated baud rate value at the reception side (See 12.6.5 (1) Baud rate calculation expression.)
k: SDR0n[15:9] + 1
Nfr: 1 data frame length [bits]
= (Start bit) + (Data length) + (Parity bit) + (Stop bit)
Figure 12-86. Permissible Baud Rate Range for Reception (1 Data Frame Length = 11 Bits)
Latch
timing
FL
1 data frame (11 × FL)
As shown in Figure 12-86, the timing of latching receive data is determined by the division ratio set by bits 15
to 9 of the serial data register 0n (SDR0n) after the start bit is detected. If the last data (stop bit) is received
before this latch timing, the data can be correctly received.
This is a clocked communication function to communicate with two or more devices by using two lines: serial clock
(SCL) and serial data (SDA). This communication function is designed to execute single communication with devices
such as EEPROM, flash memory, and A/D converter, and therefore, can be used only by the master and does not
have a wait detection function. Make sure by using software, as well as operating the control registers, that the AC
specifications of the start and stop conditions are observed.
[Data transmission/reception]
• Master transmission, master reception (only master function with a single master)
• ACK output and ACK detection functions
• Data length of 8 bits
(When an address is transmitted, the address is specified by the higher 7 bits, and the least significant bit is
used for R/W control.)
• Manual generation of start condition and stop condition
[Interrupt function]
• Transfer end interrupt
[Error detection flag]
• Parity error (ACK error)
2
Channel Used as CSI Used as UART Used as Simplified I C
1 CSI01 −
3 − −
Simplified I2C (IIC10) performs the following four types of communication operations.
• Address field transmission (See 12.7.1.)
• Data transmission (See 12.7.2.)
• Data reception (See 12.7.3.)
• Stop condition generation (See 12.7.4.)
2
Simplified I C IIC10
Interrupt INTIIC10
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Transfer data length 8 bits (transmitted with specifying the higher 7 bits as address and the least significant bit as R/W
control)
Figure 12-87. Example of Contents of Registers for Address Field Transmission of Simplified I2C (IIC10)
(a) Serial output register 0 (SO0) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(b) Serial output enable register 0 (SOE0) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(c) Serial channel start register 0 (SS0) … Sets only the bits of the target channel is 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR02 TXE02 RXE02 DAP02 CKP02 EOC02 PTC021 PTC020 DIR02 SLC021 SLC020 DLS022 DLS021 DLS020
1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1
SDR02
Baud rate setting Transmit data setting (address + R/W)
0
SIO10
Remark : Setting is fixed in the IIC mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Cautions After setting the PER0 register to 1, be sure to set the SPS0 register after 4 or more clocks
have elapsed.
SS02
SE02
SOE02
SCL10 output
CKO02
bit manipulation
SDA10 output D7 D6 D5 D4 D3 D2 D1 D0
SO02 bit manipulation
R/W
Address
SDA10 input D7 D6 D5 D4 D3 D2 D1 D0 ACK
Shift
Shift operation
register 02
INTIIC10
TSF02
Yes
No
ACK reception error
Address field
transmission completed
2
Simplified I C IIC10
Interrupt INTIIC10
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Figure 12-91. Example of Contents of Registers for Data Transmission of Simplified I2C (IIC10)
(a) Serial output register 0 (SO0) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(b) Serial output enable register 0 (SOE0) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(c) Serial channel start register 0 (SS0) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(d) Serial mode register 02 (SMR02) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(e) Serial communication operation setting register 02 (SCR02) … Do not manipulate the bits of this
register, except the TXE02 and
RXE02 bits, during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR02 TXE02 RXE02 DAP02 CKP02 EOC02 PTC021 PTC020 DIR02 SLC021 SLC020 DLS022 DLS021 DLS020
1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1
SDR02
Baud rate setting Transmit data setting
0
SIO10
Note. The value varies depending on the communication data during communication operation.
Remark : Setting is fixed in the IIC mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
SS02 “L”
SE02 “H”
SOE02 “H”
SCL10 output
SDA10 output D7 D6 D5 D4 D3 D2 D1 D0
Shift
Shift operation
register 02
INTIIC10
TSF02
Address field
transmission completed
Yes
Yes
Parity error (ACK error) flag
PEF02 = 1 ?
No
ACK reception error
No
Data transfer completed?
Yes
Data transmission
completed
2
Simplified I C IIC10
Interrupt INTIIC10
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Figure 12-94. Example of Contents of Registers for Data Reception of Simplified I2C (IIC10)
(a) Serial output register 0 (SO0) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(b) Serial output enable register 0 (SOE0) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(c) Serial channel start register 0 (SS0) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(d) Serial mode register 02 (SMR02) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(e) Serial communication operation setting register 02 (SCR02) … Do not manipulate the bits of this
register, except the TXE02 and
RXE02 bits, during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCR02 TXE02 RXE02 DAP02 CKP02 EOC02 PTC021 PTC020 DIR02 SLC021 SLC020 DLS022 DLS021 DLS020
0 1 0 0 0 0 0 0 0 0 0 1 0 1 1 1
SDR02
Baud rate setting Dummy transmit data setting (FFH)
0
SIO10
Note. The value varies depending on the communication data during communication operation.
Remark : Setting is fixed in the IIC mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
SS02
ST02
SE02
SOE02 “H”
TXE02,
TXE02 = 1 / RXE02 = 0 TXE02 = 0 / RXE02 = 1
RXE02
SDR02 Dummy data (FFH) Receive data
SCL10 output
SDA10 input D7 D6 D5 D4 D3 D2 D1 D0
Shift
Shift operation
register 02
INTIIC10
TSF02
Yes
No
Data transfer completed?
Yes
ST02
SE02
SOE02
SCL10 output
SDA10 output
Stop condition
Completion of data
transmission/data reception
Remark The value of SDR02[15:9] is the value of bits 15 to 9 of the SDR02 register (0000000B to
1111111B) and therefore is 0 to 127.
The operation clock (MCK) is determined by serial clock select register 0 (SPS0) and bit 15 (CKS02) of serial mode
register 02 (SMR02).
Notes 1. When changing the clock selected for fCLK (by changing the system clock control register (CKC)
value), do so after having stopped (ST0 = 000FH) the operation of the serial array unit (SAU).
When selecting INTTM02 for the operation clock, also stop the timer array unit TAUS (TT0 =
00FFH).
2. SAU can be operated at a fixed division ratio of the subsystem clock, regardless of the fCLK
frequency (main system clock, subsystem clock), by setting the TIS02 bit of the TIS0 register of
TAUS to 1, selecting fSUB/4 for the input clock, and selecting INTTM02 using the SPS0 register.
When changing fCLK, however, SAU and TAUS must be stopped as described in Note 1 above.
Here is an example of setting an IIC transfer rate where MCK = fCLK = 20 MHz.
The processing procedure to be followed if an error of each type occurs is described in Figures 12-99 to 12-101.
Reads SDR0n register. BFF = 0, and channel n is enabled to This is to prevent an overrun error if
receive data. the next reception is completed
during error processing.
Writes SIR0n register. Error flag is cleared. Error can be cleared only during
reading, by writing the value read
from the SSR0n register to the
SIR0n register without modification.
Reads SDR0n register. BFF = 0, and channel n is enabled to This is to prevent an overrun error if
receive data. the next reception is completed
during error processing.
Writes SIR0n register. Error flag is cleared. Error can be cleared only during
reading, by writing the value read
from the SSR0n register to the
SIR0n register without modification.
Figure 12-101. Processing Procedure in Case of Parity Error (ACK error) in Simplified I2C Mode
Reads SDR02 register. BFF = 0, and channel 2 is enabled to This is to prevent an overrun error if
receive data. the next reception is completed
during error processing.
Writes SIR02 register. Error flag is cleared. Error can be cleared only during
reading, by writing the value read
from the SSR02 register to the
SIR02 register without modification.
Sets ST02 bit to 1. SE02 = 0, and channel 2 stops Slave is not ready for reception
operation. because ACK is not returned.
Therefore, a stop condition is
created, the bus is released, and
communication is started again from
the start condition. Or, a restart
condition is generated and
Creates stop condition.
transmission can be redone from
Creates start condition. address transmission.
Tables 12-5 to 12-8 show the relationship between register settings and pins for each channel of serial array units 0
and 1.
Table 12-5. Relationship between register settings and pins (Channel 0: CSI00, UART0 transmission)
SE MD MD0 SOE SO0 CKO TXE RXE PM P75 PM P74 PM P73 Operation mode Pin Function
Note
00 002 01 00 0 00 00 00 75 74 73
Note Note 2 SCK00/ SI00/ SO00/
1 2 TI11/P75 RxD0/TI10/ TxD0/TO10/
Note 2
P74 P73
Notes 1. The SE0 register is a read-only status register which is set using the SS0 and ST0 registers.
2. When channel 1 is set to UART0 reception, this pin becomes an RxD0 function pin (refer to Table 12-6). In
this case, operation stop mode or UART0 transmission must be selected for channel 0.
3. This pin can be set as a port function pin.
4. This is 0 or 1, depending on the communication operation. For details, refer to 12.3 (12) Serial output
register 0 (SO0).
5. When using UART0 transmission and reception in a pair, set channel 1 to UART0 reception (refer to Table
12-6).
Table 12-6. Relationship between register settings and pins (Channel 1: CSI01, UART0 reception)
SE MD MD0 SOE SO CKO TXE RXE PM P72 PM P71 PM P70 PM P74 Operation Pin Function
Note
01 012 11 01 01 01 01 01 72 71 70 74 mode
Note Note 2 SCK01/ SI01/ SO01/ SI00/RxD0/
1 2 INTP6/ INTP5/ INTP4/ TI10/P74
Note 2
P72 P71 P70
Notes 1. The SE0 register is a read-only status register which is set using the SS0 and ST0 registers.
2. When channel 1 is set to UART0 reception, this pin becomes an RxD0 function pin. In this case, set
channel 0 to operation stop mode or UART0 transmission (refer to Table 12-5).
When channel 0 is set to CSI00, this pin cannot be used as an RxD0 function pin. In this case, set channel
1 to operation stop mode or CSI01.
3. This pin can be set as a port function pin.
4. This is 0 or 1, depending on the communication operation. For details, refer to 12.3 (12) Serial output
register 0 (SO0).
5. When using UART0 transmission and reception in a pair, set channel 0 to UART0 transmission (refer to
Table 12-5).
6. The SMR00 register of channel 0 must also be set during UART0 reception. For details, refer to 12.5.2 (1)
Register setting.
Table 12-7. Relationship between register settings and pins (Channel 2: CSI10, UART1 transmission, IIC10)
SE MD MD SOE SO CKO TXE RXE PM3 P32 PM P31 PM P30 Operation Pin Function
Note
02 022 021 02 02 02 02 02 2 31 30 mode
Note Note 2 SCK10/ SI10/SDA10/ SO10/
1 2 SCL10/ RxD1/INTP1/ TxD1/
Note 2
INTP2/P32 TI09/P31 TO11/P30
0 0 0 0 1 1 0 0 × × × × × × Operation stop INTP2/P32 INTP1/TI09/P31 TO11/P30
Note Note Note Note Note Note
0 1 mode RxD1/INTP1/
3 3 3 3 3 3
TI09/P31
1 0 INTP1/TI09/P31
1 0 0 0 1 1 0 1 1 × 1 × × × Slave CSI10 SCK10 SI10 TO11/P30
Note Note
reception (input)
3 3
Notes 1. The SE0 register is a read-only status register which is set using the SS0 and ST0 registers.
2. When channel 3 is set to UART1 reception, this pin becomes an RxD1 function pin (refer to Table 12-8). In
this case, operation stop mode or UART1 transmission must be selected for channel 2.
Table 12-8. Relationship between register settings and pins (Channel 3: UART1 reception)
Note Note Note
SE03 MD032 MD031 TXE03 RXE03 PM31 P31 Operation Pin Function
1 2 2
mode Note
SI10/SDA10/RxD1/INTP1/TI09/P31
2
Notes 1. The SE0 register is a read-only status register which is set using the SS0 and ST0 registers.
2. When channel 3 is set to UART1 reception, this pin becomes an RxD1 function pin. In this case, set
channel 2 to operation stop mode or UART1 transmission (refer to Table 12-7).
When channel 2 is set to CSI10 or IIC10, this pin cannot be used as an RxD1 function pin. In this case, set
channel 3 to operation stop mode.
3. This pin can be set as a port function pin.
4. When using UART1 transmission and reception in a pair, set channel 2 to UART1 transmission (refer to
Table 12-7).
5. The SMR02 register of channel 2 must also be set during UART1 reception. For details, refer to 12.5.2 (1)
Register setting.
Item Configuration
Internal bus
Division Multiplication/division
Multiplication result result Division result control register (MDUC)
(product) (remainder) (quotient)
Multiplication/division data register B Multiplication/division data register C Multiplication/division data register A DIVMODE DIVST
MDBH MDBL MDCH MDCL MDAH MDAL Start
INTMD
Multiplicand
Divisor Multiplier Dividend
Clear
Multiplication/division block
Controller
Address: FFFF0H, FFFF1H, FFFF2H, FFFF3H After reset: 0000H, 0000H R/W
Symbol FFFF3H FFFF2H
MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Cautions 1. Do not rewrite the MDAH and MDAL values during division operation processing (while
the multiplication/division control register (MDUC) is 81H). The operation will be
executed in this case, but the operation result will be an undefined value.
2. The MDAH and MDAL values read during division operation processing (while MDUC is
81H) will not be guaranteed.
The following table shows the functions of MDAH and MDAL during operation execution.
Address: FFFF4H, FFFF5H, FFFF6H, FFFF7H After reset: 0000H, 0000H R/W
Symbol FFFF7H FFFF6H
MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBHL MDBL MDBL MDBL
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Cautions 1. Do not rewrite the MDBH and MDBL values during division operation processing (while
the multiplication/division control register (MDUC) is 81H). The operation result will be an
undefined value.
2. Do not set MDBH and MDBL to 0000H in the division mode. If they are set, the operation
result will be an undefined value.
The following table shows the functions of MDBH and MDBL during operation execution.
Address: F00E0H, F00E1H, F00E2H, F00E3H After reset: 0000H, 0000H R/W
Symbol F00E3H F00E2H
MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Caution The MDCH and MDCL values read during division operation processing (while the
multiplication/division control register (MDUC) is 81H) will not be guaranteed.
0 Multiplication mode − −
1 Division mode − MDCH: Remainder (higher 16 bits)
MDCL: Remainder (lower 16 bits)
The register configuration differs between when multiplication is executed and when division is executed, as
follows.
0 Multiplication mode
1 Division mode
Note
DIVST Division operation start/stop
Note DIVST can only be set (1) in the division mode. In the division mode, division operation is started by
setting (1) DIVST. DIVST is automatically cleared (0) when the operation ends. In the multiplication
mode, operation is automatically started by setting the multiplier and multiplicand to MDAH and MDAL,
respectively.
Cautions 1. Do not rewrite DIVMODE during operation processing (while DIVST is 1). If it is rewritten,
the operation result will be an undefined value.
2. DIVST cannot be cleared (0) by using software during division operation processing
(while DIVST is 1).
• Initial setting
<1> Set bit 7 (DIVMODE) of the multiplication/division control register (MDUC) to 0.
<2> Set the multiplicand to the multiplication/division data register A (L) (MDAL).
<3> Set the multiplier to the multiplication/division data register A (H) (MDAH).
(There is no preference in the order of executing steps <2> and <3>. Multiplication operation is
automatically started when the multiplier and multiplicand are set to MDAH and MDAL, respectively.)
• During operation processing
<4> Wait for at least one clock. The operation will end when one clock has been issued.
• Operation end
<5> Read the product (lower 16 bits) from the multiplication/division data register B (L) (MDBL).
<6> Read the product (higher 16 bits) from the multiplication/division data register B (H) (MDBH).
(There is no preference in the order of executing steps <5> and <6>.)
• Next operation
<7> To execute multiplication operation next, start from the “Initial setting” for multiplication operation.
<8> To execute division operation next, start from the “Initial setting” in 13.4.2 Division operation.
Operation clock
• Initial setting
<1> Set bit 7 (DIVMODE) of the multiplication/division control register (MDUC) to 1.
<2> Set the dividend (higher 16 bits) to the multiplication/division data register A (H) (MDAH).
<3> Set the dividend (lower 16 bits) to the multiplication/division data register A (L) (MDAL).
<4> Set the divisor (higher 16 bits) to the multiplication/division data register B (H) (MDBH).
<5> Set the divisor (lower 16 bits) to the multiplication/division data register B (L) (MDBL).
<6> Set bit 0 (DIVST) of MDUC to 1.
(There is no preference in the order of executing steps <2> to <5>.)
• During operation processing
<7> The operation will end when one of the following processing is completed.
• A wait of at least 16 clocks (The operation will end when 16 clocks have been issued.)
• A check whether DIVST has been cleared
• Generation of a division completion interrupt (INTMD)
(The read values of MDBL, MDBH, MDCH, and MDCL during operation processing are not guaranteed.)
• Operation end
<8> DIVST is cleared (0) and an interrupt request signal (INTMD) is generated (end of operation).
<9> Read the quotient (lower 16 bits) from MDAL.
<10> Read the quotient (higher 16 bits) from MDAH.
<11> Read the remainder (lower 16 bits) from multiplication/division data register C (L) (MDCL).
<12> Read the remainder (higher 16 bits) from the multiplication/division data register C (H) (MDCH).
(There is no preference in the order of executing steps <9> to <12>.)
• Next operation
<13> To execute multiplication operation next, start from the “Initial setting” in 13.4.1 Multiplication operation.
<14> To execute division operation next, start from the “Initial setting” for division operation.
Operation clock
DIVMODE
<8>
DIVST
Counter Undefined 0 1 2 3 4 5 6 7 8 9 A B C D E F 0
XXXX 0000 0000 0000 0000 0000 0000 0000 0002 0008 0023 008C 0230 08C0 2300 8C00 3000 C000 0000
MDAH, MDAL XXXX 0000 0023 008C 0230 08C0 2300 8C00 3000 C000 0000 0000 0000 0000 0000 0000 0000 0001 0005
INTMD <8>
<1> <2> <3> <4> <5> <6> <7> <9>, <10> <11>, <12>
553
CHAPTER 14 DMA CONTROLLER
Item Configuration
Address registers • DMA SFR address registers 0, 1 (DSA0, DSA1)
• DMA RAM address registers 0, 1 (DRA0, DRA1)
Count register • DMA byte count registers 0, 1 (DBC0, DBC1)
Control registers • DMA mode control registers 0, 1 (DMC0, DMC1)
• DMA operation control register 0, 1 (DRC0, DRC1)
Note Except for address FFFFEH because the PMC register is allocated there.
DSAn
Address: FFFB2H, FFFB3H (DRA0), FFFB4H, FFFB5H (DRA1) After reset: 0000H R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DRAn
(n = 0, 1)
Address: FFFB6H, FFFB7H (DBC0), FFFB8H, FFFB9H (DBC1) After reset: 0000H R/W
DBC0H: FFFB7H DBC0L: FFFB6H
DBC1H: FFFB9H DBC1L: FFFB8H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DBCn 0 0 0 0 0 0
(n = 0, 1)
000H 1024 Completion of transfer or waiting for 1024 times of DMA transfer
001H 1 Waiting for remaining one time of DMA transfer
002H 2 Waiting for remaining two times of DMA transfer
003H 3 Waiting for remaining three times of DMA transfer
• • •
• • •
• • •
Note
STGn DMA transfer start software trigger
0 No trigger operation
1 DMA transfer is started when DMA operation is enabled (DENn = 1).
DMA transfer is started by writing 1 to STGn when DMA operation is enabled (DENn = 1).
When this bit is read, 0 is always read.
0 8 bits
1 16 bits
0 Executes DMA transfer upon DMA start request (not held pending).
1 Holds DMA start request pending if any.
DMA transfer that has been held pending can be started by clearing the value of DWAITn to 0.
It takes 2 clocks to actually hold DMA transfer pending when the value of DWAITn is set to 1.
Note The software trigger (STGn) can be used regardless of the IFCn0 to IFCn3 values.
Note
IFCn IFCn IFCn IFCn Selection of DMA stat source
3 2 1 0 Trigger signal Trigger contents
Note. The software trigger (STGn) can be used regardless of the IFCn0 to IFCn3 values.
DMAC waits for a DMA trigger when DSTn = 1 after DMA operation is enabled (DENn = 1).
DMAC waits for a DMA trigger when DSTn = 1 after DMA operation is enabled (DENn = 1).
When a software trigger (STGn) or the start source trigger set by IFCn3 to IFCn0 is input, DMA transfer is started.
When DMA transfer is completed after that, this bit is automatically cleared to 0.
Write 0 to this bit to forcibly terminate DMA transfer under execution.
Cautions 1. The DSTn flag is automatically cleared to 0 when a DMA transfer is completed.
Writing the DENn flag is enabled only when DSTn = 0. When a DMA transfer is
terminated without waiting for generation of the interrupt (INTDMAn) of DMAn, therefore,
set DSTn to 0 and then DENn to 0 (for details, refer to 14.5.5 Forced termination by
software).
2. When the FSEL bit of the OSMC register has been set to 1, do not enable (DENn = 1)
DMA operation for at least three clocks after the setting.
<1> The DMA controller is enabled to operate when DENn = 1. Before writing the other registers, be sure to set
DENn to 1. Use 80H to write with an 8-bit manipulation instruction.
<2> Set an SFR address, a RAM address, the number of times of transfer, and a transfer mode of DMA transfer
to the DSAn, DRAn, CBCn, and DMCn registers.
<3> The DMA controller waits for a DMA trigger when DSTn = 1. Use 81H to write with an 8-bit manipulation
instruction.
<4> When a software trigger (STGn) or a start source trigger specified by IFCn3 to IFCn0 is input, a DMA transfer
is started.
<5> Transfer is completed when the number of times of transfer set by the DBCn register reaches 0, and transfer
is automatically terminated by occurrence of an interrupt (INTDMAn).
<6> Stop the operation of the DMA controller by clearing DENn to 0 when the DMA controller is not used.
DENn = 1
DSTn = 1
No
DMA trigger = 1?
Yes
No
DBCn = 0000H ?
Yes
DSTn = 0
INTDMAn = 1
0 0 Transfer from SFR of 1-byte data (fixed address) to RAM (address is incremented by +1)
0 1 Transfer from SFR of 2-byte data (fixed address) to RAM (address is incremented by +2)
1 0 Transfer from RAM of 1-byte data (address is incremented by +1) to SFR (fixed address)
1 1 Transfer from RAM of 2-byte data (address is incremented by +2) to SFR (fixed address)
By using these transfer modes, up to 1024 bytes of data can be consecutively transferred by using the serial
interface, data resulting from A/D conversion can be consecutively transferred, and port data can be scanned at fixed
time intervals by using a timer.
Start
DEN0 = 1
DSA0 = 10H
DRA0 = FB00H
DBC0 = 0100H
DMC0 = 48H
DST0 = 1
DMA is started.
STG0 = 1
INTCSI10 occurs.
User program
processing
DMA0 transfer
CSI
transmission
Occurrence of
INTDMA0
DST0 = 0Note
DEN0 = 0
RETI
Hardware operation
End
Note The DST0 flag is automatically cleared to 0 when a DMA transfer is completed.
Writing the DEN0 flag is enabled only when DST0 = 0. To terminate a DMA transfer without waiting for
occurrence of the interrupt of DMA0 (INTDMA0), set DST0 to 0 and then DEN0 to 0 (for details, refer to
14.5.5 Forced termination by software).
The fist trigger for consecutive transmission is not started by the interrupt of CSI. Start it by a software trigger.
CSI transmission of the second time and onward is automatically executed.
The DMA interrupt (INTDMA0) is generated as soon as the last data has been written to the transmit buffer. At this
point, the last data of CSI is being transmitted. To start DMA transfer again, therefore, wait until transfer of CSI is
completed.
Start
DEN1 = 1
DSA1 = 1EH
DRA1 = FCE0H
DBC1 = 0100H
DMC1 = 2CH
DST1 = 1
INTAD occurs.
User program
processing
DMA1 transfer
INTDMA1 occurs.
DST1 = 0Note
DEN1 = 0
RETI
Hardware operation
End
Note The DST1 flag is automatically cleared to 0 when a DMA transfer is completed.
Writing the DEN1 flag is enabled only when DST1 = 0. To terminate a DMA transfer without waiting for
occurrence of the interrupt of DMA1 (INTDMA1), set DST1 to 0 and then DEN1 to 0 (for details, refer to
14.5.5 Forced termination by software).
Figure 14-9. Example of Setting for UART Consecutive Reception + ACK Transmission
Start
INTSR0 interrupt routine
DEN0 = 1
DSA0 = 12H
DRA0 = FE00H STG0 = 1
DBC0 = 0040H
DMC0 = 00H
DMA0 transfer
P10 = 0
DST0 = 1
INTSR0 occurs.
RETI
User program
processing
INTDMA0
occurs.
DST0 = 0
DEN0 = 0Note
RETI
Hardware operation
End
Note The DST0 flag is automatically cleared to 0 when a DMA transfer is completed.
Writing the DEN0 flag is enabled only when DST0 = 0. To terminate a DMA transfer without waiting for
occurrence of the interrupt of DMA0 (INTDMA0), set DST0 to 0 and then DEN0 to 0 (for details, refer to
14.5.5 Forced termination by software).
Remark This is an example where a software trigger is used as a DMA start source.
If ACK is not transmitted and if only data is consecutively received from UART, the UART reception
end interrupt (INTSR0) can be used to start DMA for data reception.
Figure 14-10. Example of Setting for Holding DMA Transfer Pending by DWAITn
Main program
DWAITn = 1
Wait for 2 clocks
P10 = 1
Wait for 9 clocks
P10 = 0
DWAITn = 0
• Set DSTn to 0 (use DRCn = 80H to write with an 8-bit manipulation instruction) by software, confirm by polling
that DSTn has actually been cleared to 0, and then set DENn to 0 (use DRCn = 00H to write with an 8-bit
manipulation instruction).
• Set DSTn to 0 (use DRCn = 80H to write with an 8-bit manipulation instruction) by software and then set DENn
to 0 (use DRCn = 00H to write with an 8-bit manipulation instruction) two or more clocks after.
Example 1 Example 2
DSTn = 0 DSTn = 0
2 clock wait
No
DSTn = 0 ?
DENn = 0
Yes
DENn = 0
Note The short period refers to a period of eight or fewer CPU clocks. The relationship between the lengths of
clock period and DMA operations is as follows.
In the following cases, however, DMA transfer may be delayed further. The number of clocks by which DMA
transfer is delayed differs depending on the condition.
• CALL !addr16
• CALL &!addr16
• CALL !!addr20
• CALL rp
• CALLT [addr5]
• BRK
• Bit manipulation instructions for registers IF0L, IF0H, IF1L, IF1H, IF2L, IF2H, MK0L, MK0H, MK1L, MK1H,
MK2L, MK2H, PR00L, PR00H, PR01L, PR01H, PR02L, PR02H, PR10L, PR10H, PR11L, PR11H, PR12L,
PR12H and PSW each, and 8-bit manipulation instructions with operands including ES registers
(5) Operation if address in general-purpose register area or other than those of internal RAM area is
specified
The address indicated by DRA0n is incremented during DMA transfer. If the address is incremented to an
address in the general-purpose register area or exceeds the area of the internal RAM, the following operation
is performed.
In either case, malfunctioning may occur or damage may be done to the system. Therefore, make sure that
the address is within the internal RAM area other than the general-purpose register area.
FFF00H
FFEFFH
General-purpose registers
FFEE0H
FFEDFH
The μPD79F9211 has a total of 43 interrupt sources including maskable interrupts and software interrupts. In
addition, they also have up to five reset sources (see Table 15-1).
Notes 1. The default priority determines the sequence of interrupts if two or more maskable interrupts occur
simultaneously. Zero indicates the highest priority and 41 indicates the lowest priority.
2. Basic configuration types (A) to (C) correspond to (A) to (C) in Figure 15-1.
3. When bit 7 (WDTINT) of the option byte (000C0H) is set to 1.
4. When bit 1 (LVIMD) of the low-voltage detection register (LVIM) is cleared to 0.
Notes 1. The default priority determines the sequence of interrupts if two or more maskable interrupts occur
simultaneously. Zero indicates the highest priority and 41 indicates the lowest priority.
2. Basic configuration types (A) to (C) correspond to (A) to (C) in Figure 15-1.
3. When bit 1 (LVIMD) of the low-voltage detection register (LVIM) is set to 1.
4. When the instruction code in FFH is executed.
Reset by the illegal instruction execution not issued by emulation with the in-circuit emulator or on-chip
debug emulator.
Internal bus
Standby release
signal
Internal bus
Standby release
signal
Internal bus
The following 6 types of registers are used to control the interrupt functions.
• Interrupt request flag registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H)
• Interrupt mask flag registers (MK0L, MK0H, MK1L, MK1H, MK2L, MK2H)
• Priority specification flag registers (PR00L, PR00H, PR01L, PR01H, PR02L, PR02H, PR10L, PR10H, PR11L,
PR11H, PR12L, PR12H)
• External interrupt rising edge enable register (EGP0)
• External interrupt falling edge enable register (EGN0)
• Program status word (PSW)
Table 15-2 shows a list of interrupt request flags, interrupt mask flags, and priority specification flags corresponding
to interrupt request sources.
Interrupt Interrupt Request Flag Interrupt Mask Flag Priority Specification Flag
Source Register Register Register
INTWDTI WDTIIF IF0L WDTIMK MK0L WDTIPR0, WDTIPR1 PR00L,
INTLVI LVIIF LVIMK LVIPR0, LVIPR1 PR10L
Notes 1. Do not use INTP3 and INTMOFF0 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INTP3 and INTMOFF0 is generated, bit 5 of IF0L is set to 1. Bit
5 of MK0L, PR00L, and PR10L supports these two interrupt sources.
2. Do not use UART0 and CSI00 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INST0 and INTCSI00 is generated, bit 5 of IF0H is set to 1. Bit 5
of MK0H, PR00H, and PR10H supports these two interrupt sources.
3. Do not use UART0 and CSI01 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INSR0 and INTCSI01 is generated, bit 6 of IF0H is set to 1. Bit
6 of MK0H, PR00H, and PR10H supports these two interrupt sources.
Interrupt Interrupt Request Flag Interrupt Mask Flag Priority Specification Flag
Source Register Register Register
Note 1 Note 1 Note 1 Note 1
INTST1 STIF1 IF1L STMK1 MK1L STPR01, STPR11 PR01L,
INTCSI10
Note 1
CSIIF10
Note 1
CSIMK10
Note 1
CSIPR010, PR11L
Note 1
CSIPR110
Note 1 Note 1 Note 1 Note 1
INTIIC10 IICIF10 IICMK10 IICPR010, IICPR110
INTSR1 SRIF1 SRMK1 SRPR01, SRPR11
INTSRE1 SREIF1 SREMK1 SREPR01, SREPR11
INTTM00 TMIF00 TMMK00 TMPR000, TMPR100
INTTM01 TMIF01 TMMK01 TMPR001, TMPR101
INTTM02 TMIF02 TMMK02 TMPR002, TMPR102
INTTM03 TMIF03 TMMK03 TMPR003, TMPR103
INTAD ADIF IF1H ADMK MK1H ADPR0, ADPR1 PR01H,
INTRTC RTCIF RTCMK RTCPR0, RTCPR1 PR11H
Notes 1. Do not use UART1, CSI10, and IIC10 at the same time because they share flags for the interrupt
request sources. If one of the interrupt sources INTST1, INTCSI10, and INTIIC10 is generated, bit 0 of
IF1L is set to 1. Bit 0 of MK1L, PR01L, and PR11L supports these three interrupt sources.
2. Do not use INTP7 and INTMOFF1 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INTP7 and INTMOFF1 is generated, bit 4 of IF2L is set to 1. Bit
4 of MK2L, PR02L, and PR12L supports these two interrupt sources.
(1) Interrupt request flag registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H)
The interrupt request flags are set to 1 when the corresponding interrupt request is generated or an instruction is
executed. They are cleared to 0 when an instruction is executed upon acknowledgment of an interrupt request or
upon reset signal generation.
When an interrupt is acknowledged, the interrupt request flag is automatically cleared and then the interrupt
routine is entered.
IF0L, IF0H, IF1L, IF1H, IF2L, and IF2H can be set by a 1-bit or 8-bit memory manipulation instruction. When
IF0L and IF0H, IF1L and IF1H, and IF2L and IF2H are combined to form 16-bit registers IF0, IF1, and IF2, they
can be set by a 16-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
Remark If an instruction that writes data to this register is executed, the number of instruction execution clocks
increases by 2 clocks.
Figure 15-2. Format of Interrupt Request Flag Registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H) (1/2)
Figure 15-2. Format of Interrupt Request Flag Registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H) (2/2)
In this case, even if the request flag of another bit of the same interrupt request flag register
(IF0L) is set to 1 at the timing between “mov a, IF0L” and “mov IF0L, a”, the flag is cleared
to 0 at “mov IF0L, a”. Therefore, care must be exercised when using an 8-bit memory
manipulation instruction in C language.
(2) Interrupt mask flag registers (MK0L, MK0H, MK1L, MK1H, MK2L, MK2H)
The interrupt mask flags are used to enable/disable the corresponding maskable interrupt servicing.
MK0L, MK0H, MK1L, MK1H, MK2L, and MK2H can be set by a 1-bit or 8-bit memory manipulation instruction.
When MK0L and MK0H, MK1L and MK1H, and MK2L and MK2H are combined to form 16-bit registers MK0,
MK1, and MK2, they can be set by a 16-bit memory manipulation instruction.
Reset signal generation sets these registers to FFH.
Remark If an instruction that writes data to this register is executed, the number of instruction execution clocks
increases by 2 clocks.
Figure 15-3. Format of Interrupt Mask Flag Registers (MK0L, MK0H, MK1L, MK1H, MK2L, MK2H)
(3) Priority specification flag registers (PR00L, PR00H, PR01L, PR01H, PR02L, PR02H, PR10L, PR10H, PR11L,
PR11H, PR12L, PR12H)
The priority specification flag registers are used to set the corresponding maskable interrupt priority level.
A priority level is set by using the PR0xy and PR1xy registers in combination (xy = 0L, 0H, 1L, 1H, 2L, or 2H).
PR00L, PR00H, PR01L, PR01H, PR02L, PR02H, PR10L, PR10H, PR11L, PR11H, PR12L, and PR12H can be
set by a 1-bit or 8-bit memory manipulation instruction. If PR00L and PR00H, PR01L and PR01H, PR02L and
PR02H, PR10L and PR10H, PR11L and PR11H, and PR12L and PR12H are combined to form 16-bit registers
PR00, PR01, PR02, PR10, PR11, and PR12, they can be set by a 16-bit memory manipulation instruction.
Reset signal generation sets these registers to FFH.
Remark If an instruction that writes data to this register is executed, the number of instruction execution clocks
increases by 2 clocks.
Caution Be sure to set bit 3 of PR01H and PR11H, and bits 3 to 7 of PR02H and PR12H to 1.
(4) External interrupt rising edge enable register (EGP0), external interrupt falling edge enable register
(EGN0)
These registers specify the valid edge for INTP0 to INTP7.
EGP0 and EGN0 can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
Figure 15-5. Format of External Interrupt Rising Edge Enable Register (EGP0)
and External Interrupt Falling Edge Enable Register (EGN0)
Caution Select the port mode by clearing EGPn and EGNn to 0 because an edge may be
detected when the external interrupt function is switched to the port function.
Remark n = 0 to 7
Note If an interrupt request is generated just before the RET instruction, the wait time becomes longer.
If two or more maskable interrupt requests are generated simultaneously, the request with a higher priority level
specified in the priority specification flag is acknowledged first. If two or more interrupts requests have the same
priority level, the request with the highest default priority is acknowledged first.
An interrupt request that is held pending is acknowledged when it becomes acknowledgeable.
Figure 15-7 shows the interrupt request acknowledgment algorithm.
If a maskable interrupt request is acknowledged, the contents are saved into the stacks in the order of PSW, then
PC, the IE flag is reset (0), and the contents of the priority specification flag corresponding to the acknowledged
interrupt are transferred to the ISP1 and ISP0 flags. The vector table data determined for each interrupt request is the
loaded into the PC and branched.
Restoring from an interrupt is possible by using the RETI instruction.
Start
No
××IF = 1?
No
××MK = 0?
Yes
Interrupt request held pending
Higher priority No
than other interrupt requests
simultaneously
generated?
No
IE = 1?
Yes
Interrupt request held pending
Note For the default priority, refer to Table 15-1 Interrupt Source List.
6 clocks
××IF
9 clocks
6 clocks 6 clocks
PSW and PC saved, Interrupt servicing
CPU processing Instruction RET instruction jump to interrupt
program
servicing
××IF
14 clocks
Caution Do not use the RETI instruction for restoring from the software interrupt.
Table 15-5. Relationship Between Interrupt Requests Enabled for Multiple Interrupt Servicing
During Interrupt Servicing
EI IE = 0 IE = 0 IE = 0
EI EI
RETI
IE = 1
IE = 1 RETI IE = 1 RETI
During servicing of interrupt INTxx, two interrupt requests, INTyy and INTzz, are acknowledged, and multiple
interrupt servicing takes place. Before each interrupt request is acknowledged, the EI instruction must always be
issued to enable interrupt request acknowledgment.
Example 2. Multiple interrupt servicing does not occur due to priority control
EI IE = 0
EI
INTxx INTyy
(PR = 10) (PR = 11)
RETI
IE = 1
1 instruction execution IE = 0
RETI
IE = 1
Interrupt request INTyy issued during servicing of interrupt INTxx is not acknowledged because its priority is lower
than that of INTxx, and multiple interrupt servicing does not take place. The INTyy interrupt request is held pending,
and is acknowledged following execution of one main processing instruction.
Example 3. Multiple interrupt servicing does not occur because interrupts are not enabled
IE = 0
EI
INTyy
INTxx (PR = 00)
(PR = 11) RETI
IE = 1
IE = 0
1 instruction execution
RETI
IE = 1
Interrupts are not enabled during servicing of interrupt INTxx (EI instruction is not issued), therefore, interrupt
request INTyy is not acknowledged and multiple interrupt servicing does not take place. The INTyy interrupt request
is held pending, and is acknowledged following execution of one main processing instruction.
Caution The BRK instruction is not one of the above-listed interrupt request hold instructions. However,
the software interrupt activated by executing the BRK instruction causes the IE flag to be cleared.
Therefore, even if a maskable interrupt request is generated during execution of the BRK
instruction, the interrupt request is not acknowledged.
Figure 15-11 shows the timing at which interrupt requests are held pending.
××IF
In either of these two modes, all the contents of registers, flags and data memory just before the standby mode is
set are held. The I/O port output latches and output buffer statuses are also held.
Cautions 1. The STOP mode can be used only when the CPU is operating on the main system clock. The
STOP mode cannot be set while the CPU operates with the subsystem clock. The HALT
mode can be used when the CPU is operating on either the main system clock or the
subsystem clock.
2. When shifting to the STOP mode, be sure to stop the peripheral hardware operation
operating with main system clock before executing STOP instruction.
3. The following sequence is recommended for operating current reduction of the A/D converter
when the standby function is used: First clear bit 7 (ADCS) and bit 0 (ADCE) of the A/D
converter mode register (ADM) to 0 to stop the A/D conversion operation, and then execute
the STOP instruction.
4. It can be selected by the option byte whether the internal low-speed oscillator continues
oscillating or stops in the HALT or STOP mode. For details, see CHAPTER 21 OPTION BYTE.
5. The STOP instruction cannot be executed when the CPU operates on the double-speed mode
internal high-speed oscillation clock. Be sure to execute the STOP instruction after shifting
to internal high-speed oscillation clock operation.
Remark For the registers that start, stop, or select the clock, see CHAPTER 5 CLOCK GENERATOR.
• If the X1 clock starts oscillation while the internal high-speed oscillation clock or subsystem clock is being
used as the CPU clock.
• If the STOP mode is entered and then released while the internal high-speed oscillation clock is being used
as the CPU clock with the X1 clock oscillating.
Figure 16-1. Format of Oscillation Stabilization Time Counter Status Register (OSTC)
MOST MOST MOST MOST MOST MOST MOST MOST Oscillation stabilization time status
8 9 10 11 13 15 17 18 fX = 10 MHz fX = 20 MHz
X1 pin voltage
waveform
Cautions 1. To set the STOP mode when the X1 clock is used as the CPU clock, set OSTS before
executing the STOP instruction.
2. Setting the oscillation stabilization time to 20 μs or less is prohibited.
3. Before changing the setting of the OSTS register, confirm that the count operation of the
OSTC register is completed.
4. Do not change the value of the OSTS register during the X1 clock oscillation stabilization
time.
5. The oscillation stabilization time counter counts up to the oscillation stabilization time set
by OSTS. If the STOP mode is entered and then released while the internal high-speed
oscillation clock is being used as the CPU clock, set the oscillation stabilization time as
follows.
• Desired OSTC oscillation stabilization time ≤ Oscillation stabilization time set by OSTS
Note, therefore, that only the status up to the oscillation stabilization time set by OSTS is
set to OSTC after STOP mode is released.
6. The X1 clock oscillation stabilization wait time does not include the time until clock
oscillation starts (“a” below).
X1 pin voltage
waveform
HALT Mode Setting When HALT Instruction Is Executed While CPU Is Operating on Main System Clock
When CPU Is Operating on When CPU Is Operating on When CPU Is Operating on
Internal High-Speed Oscillation X1 Clock (fX) External Main System Clock
Item Clock (fIH) or Double-Speed (fEX)
Mode Internal High-Speed
Oscillation Clock (fDSC)
System clock Clock supply to the CPU is stopped
Main system clock fIH, fDSC Operation continues (cannot Status before HALT mode was set is retained
be stopped)
fX Status before HALT mode Operation continues (cannot Cannot operate
was set is retained be stopped)
fEX Cannot operate Operation continues (cannot
be stopped)
Subsystem clock fXT Status before HALT mode was set is retained
fIL Set by bits 0 (WDSTBYON) and 4 (WTON) of option byte (000C0H)
• WTON = 0: Stops
• WTON = 1 and WDSTBYON = 1: Oscillates
• WTON = 1 and WDSTBYON = 0: Stops
CPU Operation stopped
Flash memory Operation stopped
RAM The value is retained
Port (latch) Status before HALT mode was set is retained
Timer array unit TAUS Operable
Inverter control function
Real-time counter (RTC)
Watchdog timer Set by bits 0 (WDSTBYON) and 4 (WTON) of option byte (000C0H)
• WTON = 0: Stops
• WTON = 1 and WDSTBYON = 1: Operates
• WTON = 1 and WDSTBYON = 0: Stops
A/D converter
Operational amplifier
Comparator
Serial array unit (SAU)
Multiplier/divider
DMA controller
Power-on-clear function
Low-voltage detection function
External interrupt
Remark fIH: Internal high-speed oscillation clock
fDSC: Double-speed mode internal high-speed oscillation clock
fX: X1 clock
fEX: External main system clock
fXT: XT1 clock
fIL: Internal low-speed oscillation clock
HALT Mode Setting When HALT Instruction Is Executed While CPU Is Operating on Subsystem Clock
Item When CPU Is Operating on XT1 Clock (fXT)
System clock Clock supply to the CPU is stopped
Main system clock fIH, fDSC Status before HALT mode was set is retained
fX
fEX Operates or stops by external clock input
Subsystem clock fXT Operation continues (cannot be stopped)
fIL Set by bits 0 (WDSTBYON) and 4 (WTON) of option byte (000C0H)
• WTON = 0: Stops
• WTON = 1 and WDSTBYON = 1: Oscillates
• WTON = 1 and WDSTBYON = 0: Stops
CPU Operation stopped
Flash memory Operation stopped (wait state in low-current consumption mode)
RAM The value is retained
Port (latch) Status before HALT mode was set is retained
Timer array unit TAUS Operable
Inverter control function Cannot operate
Real-time counter (RTC) Operable
Watchdog timer Set by bits 0 (WDSTBYON) and 4 (WTON) of option byte (000C0H)
• WTON = 0: Stops
• WTON = 1 and WDSTBYON = 1: Operates
• WTON = 1 and WDSTBYON = 0: Stops
A/D converter Cannot operate
Operational amplifier Operable
Comparator
Serial array unit (SAU)
Multiplier/divider Operable
DMA controller
Power-on-clear function
Low-voltage detection function
External interrupt
Interrupt
HALT request
instruction
Standby
release signal
Remark The broken lines indicate the case when the interrupt request which has released the standby
mode is acknowledged.
HALT
instruction
HALT
instruction
Reset signal
Normal operation
(internal high-speed Reset processing
oscillation clock or
double-speed mode Normal operation
internal high-speed Reset (internal high-speed
Status of CPU oscillation clock) HALT mode period oscillation clock)
Oscillation
Internal high-speed oscillation clock Oscillates stopped Oscillates
or double-speed mode
internal high-speed oscillation clock
Wait for oscillation
accuracy stabilization
HALT
instruction
Cautions 1. Because the interrupt request signal is used to clear the standby mode, if there is an
interrupt source with the interrupt request flag set and the interrupt mask flag reset, the
standby mode is immediately cleared if set. Thus, the STOP mode is reset to the HALT
mode immediately after execution of the STOP instruction and the system returns to the
operating mode as soon as the wait time set using the oscillation stabilization time select
register (OSTS) has elapsed.
2. The STOP instruction cannot be executed when the CPU operates on the double-speed
mode internal high-speed oscillation clock. Be sure to execute the STOP instruction after
shifting to internal high-speed oscillation clock operation.
STOP Mode Setting When STOP Instruction Is Executed While CPU Is Operating on Main System Clock
Cautions 1. To use the peripheral hardware that stops operation in the STOP mode, and the peripheral
hardware for which the clock that stops oscillating in the STOP mode after the STOP mode is
released, restart the peripheral hardware.
2. To stop the internal low-speed oscillation clock in the STOP mode, use an option byte to stop
the watchdog timer operation in the HALT/STOP mode (bit 0 (WDSTBYON) of 000C0H = 0), and
then execute the STOP instruction.
3. To shorten oscillation stabilization time after the STOP mode is released when the CPU operates
with the high-speed system clock (X1 oscillation), temporarily switch the CPU clock to the
internal high-speed oscillation clock before the next execution of the STOP instruction. Before
changing the CPU clock from the internal high-speed oscillation clock to the high-speed system
clock (X1 oscillation) after the STOP mode is released, check the oscillation stabilization time
with the oscillation stabilization time counter status register (OSTC).
STOP mode
High-speed system
clock (X1 oscillation)
High-speed system
clock (external clock
input)
Internal high-speed
oscillation clock
Note When the oscillation stabilization time set by OSTS is equal to or shorter than 61 μs, the HALT status is
retained to a maximum of “61μs + wait time.”
(1) When high-speed system clock (X1 oscillation) is used as CPU clock
Interrupt Wait
request
STOP (set by OSTS)
instruction
(2) When high-speed system clock (external clock input) is used as CPU clock
Interrupt
request
STOP
instruction
High-speed
Oscillates Oscillation stopped Oscillates
system clock
(external clock input)
Remark The broken lines indicate the case when the interrupt request that has released the standby mode
is acknowledged.
Interrupt
STOP request
instruction
Remark The broken lines indicate the case when the interrupt request that has released the standby mode
is acknowledged.
STOP
instruction
Reset signal
Reset processing
STOP
instruction
Reset signal
Reset processing
External and internal resets start program execution from the address at 0000H and 0001H when the reset signal
is generated.
A reset is effected when a low level is input to the RESET pin, the watchdog timer overflows, or by POC and LVI
circuit voltage detection or execution of illegal instructionNote, and each item of hardware is set to the status shown in
Tables 17-1 and 17-2. Each pin is high impedance during reset signal generation or during the oscillation stabilization
time just after a reset release.
When a low level is input to the RESET pin, the device is reset. It is released from the reset status when a high
level is input to the RESET pin and program execution is started with the internal high-speed oscillation clock after
reset processing. A reset by the watchdog timer is automatically released, and program execution starts using the
internal high-speed oscillation clock (see Figures 17-2 to 17-4) after reset processing. Reset by POC and LVI circuit
power supply detection is automatically released when VDD ≥ VPOC or VDD ≥ VLVI after the reset, and program
execution starts using the internal high-speed oscillation clock (see CHAPTER 18 POWER-ON-CLEAR CIRCUIT
and CHAPTER 21 LOW-VOLTAGE DETECTOR) after reset processing.
Note The illegal instruction is generated when instruction code FFH is executed.
Reset by the illegal instruction execution not issued by emulation with the in-circuit emulator or on-chip
debug emulator.
Cautions 1. For an external reset, input a low level for 10 μs or more to the RESET pin.
(If an external reset is effected upon power application, the period during which the supply
voltage is outside the operating range (VDD < 2.7 V) is not counted in the 10 μs. However, the
low-level input may be continued before POC is released.)
2. During reset input, the X1 clock, XT1 clock, internal high-speed oscillation clock, and internal
low-speed oscillation clock stop oscillating. External main system clock input becomes
invalid.
3. When the STOP mode is released by a reset, the RAM contents in the STOP mode are held
during reset input. However, because SFR and 2nd SFR are initialized, the port pins become
high-impedance.
612
Internal bus
Set Set
Watchdog timer reset signal
Set
Reset signal by execution of illegal instruction
Reset signal
Low-voltage detector reset signal
Caution An LVI circuit internal reset does not reset the LVI circuit.
Internal high-speed
oscillation clock
Starting X1 oscillation is specified by software.
High-speed system clock
(when X1 oscillation is selected)
Delay Delay
Hi-Z
Port pin
Internal high-speed
oscillation clock
Starting X1 oscillation is specified by software.
High-speed system clock
(when X1 oscillation is selected)
Reset period
CPU status Normal operation
Normal operation (oscillation stop)
Reset processing (internal high-speed oscillation clock)
Watchdog timer
overflow
Internal high-speed
oscillation clock
Starting X1 oscillation is specified by software.
High-speed system clock
(when X1 oscillation is selected)
Delay Delay
Hi-Z
Port pin
Remark. For the reset timing of the power-on-clear circuit and low-voltage detector, see CHAPTER 18
POWER-ON-CLEAR CIRCUIT and CHAPTER 19 LOW-VOLTAGE DETECTOR.
Notes 1. During reset signal generation or oscillation stabilization time wait, only the PC contents among the
hardware statuses become undefined. All other hardware statuses remain unchanged after reset.
2. When a reset is executed in the standby mode, the pre-reset status is held even after reset.
Notes 1. During reset signal generation or oscillation stabilization time wait, only the PC contents among the
hardware statuses become undefined. All other hardware statuses remain unchanged after reset.
2. The reset value of WDTE is determined by the option byte setting.
Note. During reset signal generation or oscillation stabilization time wait, only the PC contents among the
hardware statuses become undefined. All other hardware statuses remain unchanged after reset.
Notes 1. During reset signal generation or oscillation stabilization time wait, only the PC contents among the
hardware statuses become undefined. All other hardware statuses remain unchanged after reset.
2. These values vary depending on the reset source.
Reset Source RESET Input Reset by POC Reset by Execution of Reset by WDT Reset by LVI
Register Illegal Instruction
RESF TRAP bit Cleared (0) Cleared (0) Set (1) Held Held
LVIS Cleared (0EH) Cleared (0EH) Cleared (0EH) Cleared (0EH) Held
3. This value varies depending on the reset source and the option byte.
Many internal reset generation sources exist in the μPD79F9211. The reset control flag register (RESF) is used to
store which source has generated the reset request.
RESF can be read by an 8-bit memory manipulation instruction.
RESET input, reset by power-on-clear (POC) circuit, and reading RESF set RESF to 00H.
Note 1
Address: FFFA8H After reset: 00H R
Symbol 7 6 5 4 3 2 1 0
Note 2
TRAP Internal reset request by execution of illegal instruction
0 Internal reset request is not generated, or RESF is cleared.
1 Internal reset request is generated.
Notes 1. The value after reset varies depending on the reset source.
2. The illegal instruction is generated when instruction code FFH is executed.
Reset by the illegal instruction execution not issued by emulation with the in-circuit emulator or on-
chipdebug emulator.
The status of RESF when a reset request is generated is shown in Table 17-3.
Reset Source RESET Input Reset by POC Reset by Execution Reset by WDT Reset by LVI
Flag of Illegal Instruction
Caution If the low-voltage detector (LVI) is set to ON by an option byte by default, the reset signal is not
released until the supply voltage (VDD) exceeds 2.07 V ±0.2 V
Note
.
• Compares supply voltage (VDD) and detection voltage (VPDR = 1.59 V ±0.09 V ), generates internal reset
Note
Caution If an internal reset signal is generated in the POC circuit, the reset control flag register (RESF)
is cleared to 00H.
Remark This product incorporates multiple hardware functions that generate an internal reset signal. A flag
that indicates the reset source is located in the reset control flag register (RESF) for when an internal
reset signal is generated by the watchdog timer (WDT), low-voltage-detector (LVI), or illegal
instruction execution. RESF is not cleared to 00H and the flag is set to 1 when an internal reset
signal is generated by WDT or LVI.
For details of RESF, see CHAPTER 17 RESET FUNCTION.
VDD
VDD
+
Internal reset signal
Reference
voltage
source
• An internal reset signal is generated on power application. When the supply voltage (VDD) exceeds the
detection voltage (VPDR = 1.61 V ±0.09 V
Note
), the reset status is released.
Caution If the low-voltage detector (LVI) is set to ON by an option byte by default, the reset signal is not
released until the supply voltage (VDD) exceeds 2.07 V ±0.2 V
Note
.
• The supply voltage (VDD) and detection voltage (VPDR = 1.59 V ±0.09 V ) are compared. When VDD < VPDR,
Note
The timing of generation of the internal reset signal by the power-on-clear circuit and low-voltage detector is shown
below.
(1) When LVI is OFF upon power application (option byte: LVIOFF = 1)
2.7 VNote 1
VPOR = 1.61 V (TYP.)Note 6
VPDR = 1.59 V (TYP.)Note 6 Note 2
0.5 V/ms (MIN.)
0V
Wait for oscillation Wait for oscillation Wait for oscillation
accuracy stabilizationNote 3 accuracy stabilizationNote 4 accuracy stabilizationNote 3
Internal high-speed
oscillation clock (fIH)
Starting oscillation is Starting oscillation is Starting oscillation is
specified by software specified by software specified by software
High-speed
system clock (fMX)
(when X1 oscillation
is selected) Reset processing Normal operation Reset Normal operation Reset Reset processing Normal operation
period period
Wait for voltage (internal high-speed (oscillation (internal high-speed (oscillation Wait for voltage (internal high-speed
Operation stabilization oscillation clock)Note 5
stop) oscillation clock)Note 5 stop) stabilization oscillation clock)Note 5
CPU stops Operation stops
Reset processing
Notes 1. The operation guaranteed range is 2.7 V ≤ VDD ≤ 5.5 V. Make sure to perform normal operation after
the supply voltage has become at least 2.7 V. To make the state at lower than 2.7 V reset state when
the supply voltage falls, use the reset function of the low-voltage detector, or input the low level to the
RESET pin.
2. If the rate at which the voltage rises to 2.7 V after power application is slower than 0.5 V/ms (MIN.),
input a low level to the RESET pin before the voltage reaches to 2.7 V, or set LVI to ON by default by
using an option byte (option byte: LVIOFF = 0).
3. The internal voltage stabilization time includes the oscillation accuracy stabilization time of the internal
high-speed oscillation clock.
4. The internal reset processing time includes the oscillation accuracy stabilization time of the internal
high-speed oscillation clock.
5. The internal high-speed oscillation clock and a high-speed system clock or subsystem clock can be
selected as the CPU clock. To use the X1 clock, use the OSTC register to confirm the lapse of the
oscillation stabilization time. To use the XT1 clock, use the timer function for confirmation of the lapse
of the stabilization time.
6. This is a preliminary value and subject to change.
Caution Set the low-voltage detector by software after the reset status is released (see CHAPTER 19
LOW-VOLTAGE DETECTOR).
VLVI
2.7 VNote 1
VLVI = 2.07 V (TYP.)Note 3
VPOR = 1.61 V (TYP.)Note 3
VPDR = 1.59 V (TYP.)Note 3
0V
Wait for oscillation Wait for oscillation Wait for oscillation
accuracy stabilizationNote 4 accuracy stabilizationNote 4 accuracy stabilizationNote 4
Internal high-speed
oscillation clock (fIH)
Starting oscillation is Starting oscillation is Starting oscillation is
specified by software specified by software specified by software
High-speed
system clock (fMX)
(when X1 oscillation
is selected) Normal operation Reset Normal operation Reset Normal operation
period period
(internal high-speed (oscillation (internal high-speed (oscillation (internal high-speed
oscillation clock)Note 2 stop) oscillation clock)Note 2 stop) oscillation clock)Note 2
CPU Operation Operation stops
stops Reset processing time Reset processing time
Reset processing time
POC processing time POC processing time
Notes 1. The operation guaranteed range is 2.7 V ≤ VDD ≤ 5.5 V. Make sure to perform normal operation after
the supply voltage has become at least 2.7 V. To make the state at lower than 2.7 V reset state when
the supply voltage falls, use the reset function of the low-voltage detector, or input the low level to the
RESET pin.
2. The internal high-speed oscillation clock and a high-speed system clock or subsystem clock can be
selected as the CPU clock. To use the X1 clock, use the OSTC register to confirm the lapse of the
oscillation stabilization time. To use the XT1 clock, use the timer function for confirmation of the lapse
of the stabilization time.
3. These are preliminary values and subject to change.
4. The internal reset processing time includes the oscillation accuracy stabilization time of the internal
high-speed oscillation clock.
Caution Set the low-voltage detector by software after the reset status is released (see CHAPTER 19
LOW-VOLTAGE DETECTOR).
In a system where the supply voltage (VDD) fluctuates for a certain period in the vicinity of the POC detection
voltage (VPOR, VPDR), the system may be repeatedly reset and released from the reset status. In this case, the time
from release of reset to the start of the operation of the microcontroller can be arbitrarily set by taking the following
action.
<Action>
After releasing the reset signal, wait for the supply voltage fluctuation period of each system by means of a
software counter that uses a timer, and then initialize the ports.
Reset
Power-on-clear
Clearing WDT
Note 1
No 50 ms has passed?
(TMIFn = 1?)
Yes
Notes 1. If reset is generated again during this period, initialization processing <2> is not started.
2. A flowchart is shown on the next page.
Remark n = 00 to 11
Yes
TRAP of RESF
register = 1?
No
Reset processing by
illegal instruction execution Note
Yes
WDRF of RESF
register = 1?
No
Reset processing by
watchdog timer
Yes
LVIRF of RESF
register = 1?
No
Reset processing by
low-voltage detector
Power-on-clear/external
reset generated
Note The illegal instruction is generated when instruction code FFH is executed.
Reset by the illegal instruction execution not issued by emulation with the in-circuit emulator or on-chip
debug emulator.
• The LVI circuit compares the supply voltage (VDD) with the detection voltage (VLVI) or the input voltage from an
external input pin (EXLVI) with the detection voltage (VEXLVI = 1.21 V ±0.1 VNote), and generates an internal reset
or internal interrupt signal.
• The low-voltage detector (LVI) can be set to ON by an option byte by default. If it is set to ON to raise the power
supply from the POC detection voltage (VPOR = 1.61 V (TYP.)) or lower, the internal reset signal is generated
when the supply voltage (VDD) < detection voltage (VLVI = 2.07 V ±0.2 V ). After that, the internal reset signal
Note
is generated when the supply voltage (VDD) < detection voltage (VLVI = 2.07 V ±0.1 VNote).
• The supply voltage (VDD) or the input voltage from the external input pin (EXLVI) can be selected to be detected
by software.
• A reset or an interrupt can be selected to be generated after detection by software.
• Detection levels (VLVI,16 levels) of supply voltage can be changed by software.
• Operable in STOP mode.
The reset and interrupt signals are generated as follows depending on selection by software.
Selection of Level Detection of Supply Voltage (VDD) Selection Level Detection of Input Voltage from
(LVISEL = 0) External Input Pin (EXLVI) (LVISEL = 1)
Selects reset (LVIMD = 1). Selects interrupt (LVIMD = 0). Selects reset (LVIMD = 1). Selects interrupt (LVIMD = 0).
Generates an internal reset Generates an internal interrupt Generates an internal reset Generates an internal interrupt
signal when VDD < VLVI and signal when VDD drops lower signal when EXLVI < VEXLVI signal when EXLVI drops
releases the reset signal when than VLVI (VDD < VLVI) or when and releases the reset signal lower than VEXLVI (EXLVI <
VDD ≥ VLVI. VDD becomes VLVI or higher when EXLVI ≥ VEXLVI. VEXLVI) or when EXLVI
(VDD ≥ VLVI). becomes VEXLVI or higher
(EXLVI ≥ VEXLVI).
While the low-voltage detector is operating, whether the supply voltage or the input voltage from an external input
pin is more than or less than the detection level can be checked by reading the low-voltage detection flag (LVIF: bit 0
of LVIM).
When the low-voltage detector is used to reset, bit 0 (LVIRF) of the reset control flag register (RESF) is set to 1 if
reset occurs. For details of RESF, see CHAPTER 17 RESET FUNCTION.
VDD
VDD
N-ch
Low-voltage detection
Selector
+
EXLVI/P120/
INTP0 Selector −
INTLVI
Reference
4 voltage
source
Internal bus
Notes 3,
LVION Enables low-voltage detection operation
4
0 Disables operation
1 Enables operation
Note 3
LVISEL Voltage detection selection
0 Detects level of supply voltage (VDD)
1 Detects level of input voltage from external input pin (EXLVI)
Notes 1. The reset value changes depending on the reset source and the setting of the option byte.
This register is not cleared (00H) by LVI reset.
It is set to “82H” when a reset signal other than LVI is applied if option byte LVIOFF = 0, and to “00H”
if option byte LVIOFF = 1.
2. Bit 0 is read-only.
3. LVION, LVIMD, and LVISEL are cleared to 0 in the case of a reset other than an LVI reset. These
are not cleared to 0 in the case of an LVI reset.
Note 4. When LVION is set to 1, operation of the comparator in the LVI circuit is started. Use software to wait
for the following periods of time, between when LVION is set to 1 and when the voltage is confirmed
with LVIF.
• Operation stabilization time (10 μs (MAX.))
• Minimum pulse width (200 μs (MIN.))
• Detection delay time (200 μs (MAX.))
The LVIF value for these periods may be set/cleared regardless of the voltage level, and can
therefore not be used. Also, the LVIIF interrupt request flag may be set to 1 in these periods.
Cautions 2. Change the LVIS value with either of the following methods.
• When changing the value after stopping LVI
<1> Stop LVI (LVION = 0).
<2> Change the LVIS register.
<3> Set to the mode used as an interrupt (LVIMD = 0).
<4> Mask LVI interrupts (LVIMK = 1).
<5> Enable LVI operation (LVION = 1).
<6> Before cancelling the LVI interrupt mask (LVIMK = 0), clear it with software
because an LVIIF flag may be set when LVI operation is enabled.
• When changing the value after setting to the mode used as an interrupt (LVIMD =
0)
<1> Mask LVI interrupts (LVIMK = 1).
<2> Set to the mode used as an interrupt (LVIMD = 0).
<3> Change the LVIS register.
<4> Before cancelling the LVI interrupt mask (LVIMK = 0), clear it with software
because an LVIIF flag may be set when the LVIS register is changed.
3. When an input voltage from the external input pin (EXLVI) is detected, the detection
voltage (VEXLVI) is fixed. Therefore, setting of LVIS is not necessary.
Remark The low-voltage detector (LVI) can be set to ON by an option byte by default. If it is set to ON to
raise the power supply from the POC detection voltage (VPOR = 1.61 V (TYP.)) or lower, the internal
reset signal is generated when the supply voltage (VDD) < detection voltage (VLVI = 2.07 V ±0.2
Note
V ). After that, the internal reset signal is generated when the supply voltage (VDD) < detection
voltage (VLVI = 2.07 V ±0.1 VNote).
While the low-voltage detector is operating, whether the supply voltage or the input voltage from an external input
pin is more than or less than the detection level can be checked by reading the low-voltage detection flag (LVIF: bit 0
of LVIM).
Figure 19-5 shows the timing of the internal reset signal generated by the low-voltage detector. The
numbers in this timing chart correspond to <1> to <7> above.
Cautions 1. Be sure to execute <1>. When LVIMK = 0, an interrupt may occur immediately after
the
processing in <4>.
2. If supply voltage (VDD) ≥ detection voltage (VLVI) when LVIMD is set to 1, an internal
reset
signal is not generated.
Set LVI to be
used for reset
VLVI
Time
LVIMK flag HNote 1
(set by software)
<1>
<2>
Not Not cleared
LVION flag
(set by software) cleared
<4> Cleared
<5>Wait time
LVIF flag
<6> Cleared
Note 2
LVIMD flag Not Not cleared
(set by software) cleared
<7> Cleared
LVIRF flagNote 3
Remarks 1. <1> to <7> in Figure 19-5 above correspond to <1> to <7> in the description of “When starting
operation” in 19.4.1 (1) (a) When LVI default start function stopped is set (LVIOFF = 1).
2. VPOR: POC power supply rise detection voltage
VPDR: POC power supply fall detection voltage
Figure 19-6 shows the timing of the internal reset signal generated by the low-voltage detector.
Caution Even when the LVI default start function is used, if it is set to LVI operation prohibition by
the software, it operates as follows:
• Does not perform low-voltage detection during LVION = 0.
• If a reset is generated while LVION = 0, LVION will be re-set to 1 when the CPU starts
after reset release. There is a period when low-voltage detection cannot be
performed normally, however, when a reset occurs due to WDT and illegal
instruction execution.
This is due to the fact that while the pulse width detected by LVI must be 200 μs max.,
LVION = 1 is set upon reset occurrence, and the CPU starts operating without
waiting for the LVI stabilization time.
Time
LVISEL flag
L
(set by software)
LVIF flag
Cleared
LVIRF flag
(2) When detecting level of input voltage from external input pin (EXLVI)
• When starting operation
<1> Mask the LVI interrupt (LVIMK = 1).
<2> Set bit 2 (LVISEL) of the low-voltage detection register (LVIM) to 1 (detects level of input voltage from
external input pin (EXLVI)).
<3> Set bit 7 (LVION) of LVIM to 1 (enables LVI operation).
<4> Use software to wait for the following periods of time (Total 410 μs).
• Operation stabilization time (10 μs (MAX.))
• Minimum pulse width (200 μs (MIN.))
• Detection delay time (200 μs (MAX.))
<5> Wait until it is checked that (input voltage from external input pin (EXLVI) ≥ detection voltage (VEXLVI =
1.21 V (TYP.))) by bit 0 (LVIF) of LVIM.
<6> Set bit 1 (LVIMD) of LVIM to 1 (generates reset signal when the level is detected).
Figure 19-7 shows the timing of the internal reset signal generated by the low-voltage detector. The numbers
in this timing chart correspond to <1> to <6> above.
Cautions 1. Be sure to execute <1>. When LVIMK = 0, an interrupt may occur immediately after the
processing in <3>.
2. If input voltage from external input pin (EXLVI) ≥ detection voltage (VEXLVI = 1.21 V (TYP.))
when LVIMD is set to 1, an internal reset signal is not generated.
3. Input voltage from external input pin (EXLVI) must be EXLVI < VDD.
Set LVI to be
used for reset
Input voltage from
external input pin (EXLVI)
VEXLVI
Time
LVIF flag
Note 2 <5>
LVIMD flag Not cleared Not cleared
(set by software)
<6> Not cleared
LVIRF flagNote 3
Remark <1> to <6> in Figure 19-7 above correspond to <1> to <6> in the description of “When starting
operation” in 19.4.1 (2) When detecting level of input voltage from external input pin (EXLVI).
Figure 19-8 shows the timing of the interrupt signal generated by the low-voltage detector. The numbers in
this timing chart correspond to <1> to <8> above.
VLVI
<2>
LVION flag
(set by software)
<4>
<5> Wait time
LVIF flag
<6>
Note 2
INTLVI
Note 2
LVIIF flag
<7>
Note 2 Cleared by software
LVIMD flag
(set by software) L
Remarks 1. <1> to <8> in Figure 19-8 above correspond to <1> to <8> in the description of “When starting
operation” in 19.4.2 (1) (a) When LVI default start function stopped is set (LVIOFF = 1).
2. VPOR: POC power supply rise detection voltage
VPDR: POC power supply fall detection voltage
Figure 19-9 shows the timing of the interrupt signal generated by the low-voltage detector. The numbers in
this timing chart correspond to <1> to <3> above.
Cautions 1. Even when the LVI default start function is used, if it is set to LVI operation prohibition by
the software, it operates as follows:
• Does not perform low-voltage detection during LVION = 0.
• If a reset is generated while LVION = 0, LVION will be re-set to 1 when the CPU starts
after reset release. There is a period when low-voltage detection cannot be performed
normally, however, when a reset occurs due to WDT and illegal instruction execution.
This is due to the fact that while the pulse width detected by LVI must be 200 μs max.,
LVION = 1 is set upon reset occurrence, and the CPU starts operating without waiting
for the LVI stabilization time.
2. When the LVI default start function (bit 0 (LVIOFF) of 000C1H = 0) is used, the LVIRF flag
may become 1 from the beginning due to the power-on waveform.
For details of RESF, see CHAPTER 17 RESET FUNCTION.
Note 2 Note 2
Time
LVIMK flag
(set by software)
<1>
Note 1
<3> Cleared by software
LVISEL flag
(set by software) L
LVION flag
(set by software)
LVIF flag
INTLVI
Note 3
LVIIF flag
Cleared by software
LVIMD flag <2>
(set by software)
Remarks 1. <1> to <3> in Figure 19-9 above correspond to <1> to <3> in the description of “When starting
operation” in 19.4.2 (1) (b) When LVI default start function enabled is set (LVIOFF = 0).
2. VPOR: POC power supply rise detection voltage
VPDR: POC power supply fall detection voltage
(2) When detecting level of input voltage from external input pin (EXLVI)
• When starting operation
<1> Mask the LVI interrupt (LVIMK = 1).
<2> Set bit 2 (LVISEL) of the low-voltage detection register (LVIM) to 1 (detects level of input voltage from
external input pin (EXLVI)).
Clear bit 1 (LVIMD) of LVIM to 0 (generates interrupt signal when the level is detected) (default value).
<3> Set bit 7 (LVION) of LVIM to 1 (enables LVI operation).
<4> Use software to wait for the following periods of time (Total 410 μs).
• Operation stabilization time (10 μs (MAX.))
• Minimum pulse width (200 μs (MIN.))
• Detection delay time (200 μs (MAX.))
<5> Confirm that “input voltage from external input pin (EXLVI) ≥ detection voltage (VEXLVI = 1.21 V (TYP.))”
when detecting the falling edge of EXLVI, or “input voltage from external input pin (EXLVI) < detection
voltage (VEXLVI = 1.21 V (TYP.))” when detecting the rising edge of EXLVI, at bit 0 (LVIF) of LVIM.
<6> Clear the interrupt request flag of LVI (LVIIF) to 0.
<7> Release the interrupt mask flag of LVI (LVIMK).
<8> Execute the EI instruction (when vector interrupts are used).
Figure 19-10 shows the timing of the interrupt signal generated by the low-voltage detector. The numbers in
this timing chart correspond to <1> to <7> above.
Caution Input voltage from external input pin (EXLVI) must be EXLVI < VDD.
VEXLVI
LVIMK flag
(set by software) <1>
Note 1
<7> Cleared by software
LVISEL flag
(set by software)
<2>
LVION flag
(set by software) <3>
<4> Wait time
LVIF flag
<5>
Note 2
INTLVI
Note 2
LVIIF flag
<6>
Note 2 Cleared by software
LVIMD flag
(set by software) L
Remark <1> to <7> in Figure 19-10 above correspond to <1> to <7> in the description of “When starting
operation” in 19.4.2 (2) When detecting level of input voltage from external input pin (EXLVI).
(1) Measures method when supply voltage (VDD) frequently fluctuates in the vicinity of the LVI detection
voltage (VLVI)
In a system where the supply voltage (VDD) fluctuates for a certain period in the vicinity of the LVI detection
voltage (VLVI), the operation is as follows depending on how the low-voltage detector is used.
<Action>
After releasing the reset signal, wait for the supply voltage fluctuation period of each system by means of a
software counter that uses a timer, and then initialize the ports (see Figure 19-11).
Remark If bit 2 (LVISEL) of the low voltage detection register (LVIM) is set to “1”, the meanings of the above
words change as follows.
• Supply voltage (VDD) → Input voltage from external input pin (EXLVI)
• Detection voltage (VLVI) → Detection voltage (VEXLVI = 1.21 V)
Reset
Clearing WDT
Detection Yes
voltage or higher
(LVIF = 0?)
No
Restarting timer array unit ; The timer counter is cleared and the timer is started.
(TTn = 1 → TSn = 1)
No 50 ms has passed?
(TMIFn = 1?)
Yes
Remarks 1. If bit 2 (LVISEL) of the low voltage detection register (LVIM) is set to “1”, the meanings of the above
words change as follows.
• Supply voltage (VDD) → Input voltage from external input pin (EXLVI)
• Detection voltage (VLVI) → Detection voltage (VEXLVI = 1.21 V)
2. n = 00 to 11
Yes
TRAP of RESF
register = 1?
No
Reset processing by
illegal instruction execution Note
Yes
WDRF of RESF
register = 1?
No
Reset processing by
watchdog timer
No
LVIRF of RESF
register = 1?
Yes
Power-on-clear/external
reset generated
Reset processing by
low-voltage detector
Remark If bit 2 (LVISEL) of the low voltage detection register (LVIM) is set to “1”, the meanings of the above
words change as follows.
• Supply voltage (VDD) → Input voltage from external input pin (EXLVI)
• Detection voltage (VLVI) → Detection voltage (VEXLVI = 1.21 V)
<Action>
Confirm that “supply voltage (VDD) ≥ detection voltage (VLVI)” when detecting the falling edge of VDD, or
“supply voltage (VDD) < detection voltage (VLVI)” when detecting the rising edge of VDD, in the servicing routine
of the LVI interrupt by using bit 0 (LVIF) of the low-voltage detection register (LVIM). Clear bit 1 (LVIIF) of
interrupt request flag register 0L (IF0L) to 0.
For a system with a long supply voltage fluctuation period near the LVI detection voltage, take the above
action after waiting for the supply voltage fluctuation time.
Remark If bit 2 (LVISEL) of the low voltage detection register (LVIM) is set to “1”, the meanings of the above
words change as follows.
• Supply voltage (VDD) → Input voltage from external input pin (EXLVI)
• Detection voltage (VLVI) → Detection voltage (VEXLVI = 1.21 V)
(2) Delay from the time LVI reset source is generated until the time LVI reset has been generated or released
There is some delay from the time supply voltage (VDD) < LVI detection voltage (VLVI) until the time LVI reset has
been generated.
In the same way, there is also some delay from the time LVI detection voltage (VLVI) ≤ supply voltage (VDD) until
the time LVI reset has been released (see Figure 19-12).
Figure 19-12. Delay from the time LVI reset source is generated until the time LVI reset has been generated or released
VLVI
Time
LVIF flag
<1> <1>
<2> <2>
The μPD79F9211 contains a circuit for operating the device with a constant voltage. At this time, in order to
stabilize the regulator output voltage, connect the REGC pin to VSS via a capacitor (0.47 to 1 μF: target). However,
when using the STOP mode that has been entered since operation of the internal high-speed oscillation clock and
external main system clock, 0.47 μF is recommended. Also, use a capacitor with good characteristics, since it is used
to stabilize internal voltage.
The regulator output voltage is normally 2.4 V (typ.), and in the low consumption current mode, 1.8 V (typ.).
RMC
Cautions 1. The RMC register can be rewritten only in the low consumption current mode (refer to
Table 20-1). In other words, rewrite this register during CPU operation with the subsystem
clock (fXT) while the high-speed system clock (fMX), the high-speed internal oscillation
clock (fIH), and the double-speed mode internal high-speed oscillation clock (fDSC) are
both stopped.
2. When using the setting fixed to the low consumption current mode, the RMC register can
be used in the following cases.
<When X1 clock is selected as the CPU clock> fX ≤ 5 MHz and fCLK ≤ 5 MHz
<When the high-speed internal oscillation clock, external input clock, or subsystem clock
are selected for the CPU clock> fCLK ≤ 5 MHz
3. The self-programming function is disabled in the low consumption current mode.
Addresses 000C0H to 000C3H of the flash memory of the μPD79F9211 form an option byte area.
Option bytes consist of user option byte (000C0H to 000C2H) and on-chip debug option byte (000C3H).
Upon power application or resetting and starting, an option byte is automatically referenced and a specified
function is set. When using the product, be sure to set the following functions by using the option bytes.
To use the boot swap operation during self programming, 000C0H to 000C3H are replaced by 010C0H to 010C3H.
Therefore, set the same values as 000C0H to 000C3H to 010C0H to 010C3H.
Caution Be sure to set FFH to 000C2H (000C2H/010C2H when the boot swap operation is used).
(1) 000C0H/010C0H
{ Operation of watchdog timer
• Operation is stopped or enabled in the HALT or STOP mode.
{ Setting of interval time of watchdog timer
{ Operation of watchdog timer
• Operation is stopped or enabled.
{ Setting of window open period of watchdog timer
{ Setting of interval interrupt of watchdog timer
• Used or not used
Caution Set the same value as 000C0H to 010C0H when the boot swap operation is used because
000C0H is replaced by 010C0H.
(2) 000C1H/010C1H
{ Setting of LVI upon reset release (upon power application)
• LVI is ON or OFF by default upon reset release (reset by RESET pin excluding LVI, POC, WDT, or illegal
instructions).
Caution Set the same value as 000C1H to 010C1H when the boot swap operation is used because
000C1H is replaced by 010C1H.
(3) 000C2H/010C2H
{ Be sure to set FFH, as these addresses are reserved areas.
Caution Set FFH to 010C2H when the boot swap operation is used because 000C2H is replaced by
010C2H.
Caution Set the same value as 000C3H to 010C3H when the boot swap operation is used because
000C3H is replaced by 010C3H.
Note 2
WINDOW1 WINDOW0 Watchdog timer window open period
0 0 25%
0 1 50%
1 0 75%
1 1 100%
Notes 1. Set the same value as 000C0H to 010C0H when the boot swap operation is used because 000C0H is
replaced by 010C0H.
2. The window open period is 100% when WDSTBYON = 0, regardless the value of WINDOW1 and
WINDOW0.
Caution The watchdog timer continues its operation during self-programming of the flash memory and
EEPROM emulation. During processing, the interrupt acknowledge time is delayed. Set the
overflow time and window size taking this delay into consideration.
Note Set the same value as 000C1H to 010C1H when the boot swap operation is used because 000C1H is
replaced by 010C1H.
Note Be sure to set FFH to 000C2H, as these addresses are reserved areas. Also set FFH to 010C2H when the
boot swap operation is used because 000C2H is replaced by 010C2H.
Note Set the same value as 000C3H to 010C3H when the boot swap operation is used because 000C3H is
replaced by 010C3H.
Caution Bits 7 and 0 (OCDENSET and OCDERSD) can only be specified a value.
Be sure to set 000010B to bits 6 to 1.
Remark The value on bits 3 to 1 will be written over when the on-chip debug function is in use and thus it will
become unstable after the setting.
However, be sure to set the default values (0, 1, and 0) to bits 3 to 1 at setting.
Set the user option byte and on-chip debug option byte using a linker option of assembler package RA78K0R.
For how to set the option byte, refer to RA78K0R Assembler Package User’s Manual.
Remark The option byte is referenced during reset processing. For the timing of reset processing, see
CHAPTER 17 RESET FUNCTION.
The μPD79F9211 incorporates the flash memory to which a program can be written, erased, and overwritten while
mounted on the board.
Data can be written to the flash memory on-board or off-board, by using a dedicated flash memory programmer.
Remark The FA series is a product of Naito Densei Machida Mfg. Co., Ltd.
Table 22-1. Wiring Between μPD79F9211 and Dedicated Flash Memory Programmer
Examples of the recommended connection when using the adapter for flash memory writing are shown below.
Figure 22-1. Example of Wiring Adapter for Flash Memory Writing (MC Package)
1 38
2 37
3 36
4 35
5 34
6 33
7 32
8 31
9 30
10 29
11 28
12 27
13 26
14 25
15 24
16 23
17 22
18 21
19 20
GND
VDD
VDD2
WRITER INTERFACE
Figure 22-2. Example of Wiring Adapter for Flash Memory Writing (GB Package)
44 43 42 41 40 39 38 37 36 35 34
1 33
2 32
3 31
4 30
5 29
6 28
7 27
8 26
9 25
10 24
11 23
12 13 14 15 16 17 18 19 20 21 22
GND
VDD
VDD2
WRITER INTERFACE
Figure 22-3. Example of Wiring Adapter for Flash Memory Writing (GA Package)
48 47 46 45 44 43 42 41 40 39 38 37
1 36
2 35
3 34
4 33
5 32
6 31
7 30
8 29
9 28
10 27
11 26
12 25
13 14 15 16 17 18 19 20 21 22 23 24
GND
VDD
VDD2
WRITER INTERFACE
The environment required for writing a program to the flash memory of the μPD79F9211 is illustrated below.
FLMD0
RS-232C Axxxx
VDD
XXXXXX
XXXXYYYY
Bxxxxx
XXXX
Cxxxxxx
STATVE
VSS
XXXXX
XXXYYY
PG-FP4 (Flash Pro4)
USB RESET
Dedicated flash TOOL0 (dedicated single-line UART) uPD79F9211
memory programmer
Host machine
A host machine that controls the dedicated flash memory programmer is necessary.
To interface between the dedicated flash memory programmer and the μPD79F9211, the TOOL0 pin is used for
manipulation such as writing and erasing via a dedicated single-line UART. To write the flash memory off-board, a
dedicated program adapter (FA series) is necessary.
Communication between the dedicated flash memory programmer and the μPD79F9211 is established by serial
communication using the TOOL0 pin via a dedicated single-line UART of the μPD79F9211.
FLMD0 FLMD0
VDD VDD
Axxxx
GND VSS
XXXXXX
XXXXYYYY
Bxxxxx
/RESET RESET
XXXX
Cxxxxxx
STATVE
XXXXX
XXXYYY
SI/RxD TOOL0
Dedicated flash SO/TxD uPD79F9211
memory programmer
When using the FlashPro4 as the dedicated flash memory programmer, the FlashPro4 generates the following
signals for the μPD79F9211. For details, refer to the user’s manual for the FlashPro4.
To write the flash memory on-board, connectors that connect the dedicated flash memory programmer must be
provided on the target system. First provide a function that selects the normal operation mode or flash memory
programming mode on the board.
When the flash memory programming mode is set, all the pins not used for programming the flash memory are in
the same status as immediately after reset. Therefore, if the external device does not recognize the state immediately
after reset, the pins must be handled as described below.
uPD79F9211
Dedicated flash memory programmer
connection pin
FLMD0
Remark The SAU pins are not used for communication between the μPD79F9211 and dedicated flash memory
programmer, because single-line UART is used.
uPD79F9211
Output pin
Remark In the flash memory programming mode, the internal high-speed oscillation clock (fIH) is used.
BECTL FLMDPUP 0 0 0 0 0 0 0
Start
No
End?
Yes
End
5.5 V
VDD
0V
VDD
RESET
0V
VDD
FLMD0
0V
VDD
TOOL0
0V
Flash memory programming mode
Table 22-3. Relationship Between FLMD0 Pin and Operation Mode After Reset Release
Notes 1. Selection items for Standard settings on GUI of the flash memory programmer.
2. Because factors other than the baud rate error, such as the signal waveform slew, also affect UART
communication, thoroughly evaluate the slew as well as the baud rate error.
Axxxx Command
XXXX XXXXXX
XXXXYYYY
Bxxxxx
Cxxxxxx
XXXXX
XXXYYY
STATVE
The flash memory control commands of the μPD79F9211 are listed in the table below. All these commands are
issued from the programmer and the μPD79F9211 perform processing corresponding to the respective commands.
Verify Verify Compares the contents of a specified area of the flash memory with
data transmitted from the programmer.
Erase Chip Erase Erases the entire flash memory.
Block Erase Erases a specified area in the flash memory.
Blank check Block Blank Check Checks if a specified block in the flash memory has been correctly
erased.
Write Programming Writes data to a specified area in the flash memory.
Getting information Silicon Signature Gets μPD79F9211 information (such as the part number and flash
memory configuration).
Version Get Gets the μPD79F9211 firmware version.
Checksum Gets the checksum data for a specified area.
Security Security Set Sets security information.
Others Reset Used to detect synchronization status of communication.
Baud Rate Set Sets baud rate when UART communication mode is selected.
The μPD79F9211 return a response for the command issued by the dedicated flash memory programmer. The
response names sent from the μPD79F9211 are listed below.
The μPD79F9211 supports a security function that prohibits rewriting the user program written to the internal flash
memory, so that the program cannot be changed by an unauthorized person.
The operations shown below can be performed using the Security Set command. The security setting is valid
when the programming mode is set next.
Caution After the security setting for the batch erase is set, erasure cannot be performed for the device.
In addition, even if a write command is executed, data different from that which has already
been written to the flash memory cannot be written, because the erase command is disabled.
• Disabling write
Execution of the write and block erase commands for entire blocks in the flash memory is prohibited during on-
board/off-board programming. However, blocks can be written by means of self programming.
The batch erase (chip erase), block erase, write commands, and rewriting boot cluster 0 are enabled by the default
setting when the flash memory is shipped. Security can be set by on-board/off-board programming and self
programming. Each security setting can be used in combination.
All the security settings are cleared by executing the batch erase (chip erase) command.
Table 22-7 shows the relationship between the erase and write commands when the μPD79F9211 security
function is enabled.
Remark To prohibit writing and erasing during self-programming, use the flash sealed window function (see 22.8.2
for detail).
Note Confirm that no data has been written to the write area. Because data cannot be erased after batch erase
(chip erase) is prohibited, do not write data if the data has not been erased.
Prohibition of batch erase (chip erase) Blocks can be erased. Can be performed.
Prohibition of block erase
Prohibition of writing
Prohibition of rewriting boot cluster 0 Boot cluster 0 cannot be erased. Boot cluster 0 cannot be written.
Remark To prohibit writing and erasing during self-programming, use the flash sealed window function (see 22.8.2
for detail).
Prohibition of batch erase (chip erase) Set via GUI of dedicated flash memory Cannot be disabled after set.
Prohibition of block erase programmer, etc. Execute batch erase (chip erase)
Prohibition of writing command
Prohibition of batch erase (chip erase) Set by using information library. Cannot be disabled after set.
Prohibition of block erase Execute batch erase (chip erase)
Prohibition of writing command during on-board/off-board
programming (cannot be disabled during
Prohibition of rewriting boot cluster 0
self programming)
The μPD79F9211 supports a self-programming function that can be used to rewrite the flash memory via a user
program. Because this function allows a user application to rewrite the flash memory by using the μPD79F9211 self-
programming library, it can be used to upgrade the program in the field.
If an interrupt occurs during self-programming, self-programming can be temporarily stopped and interrupt
servicing can be executed. If an unmasked interrupt request is generated in the EI state, the request branches
directly from the self-programming library to the interrupt routine. After the self-programming mode is later restored,
self-programming can be resumed. However, the interrupt response time is different from that of the normal operation
mode.
Cautions 1. The self-programming function cannot be used when the CPU operates with the subsystem
clock.
2. In the self-programming mode, call the self-programming start library (FlashStart).
3. To prohibit an interrupt during self-programming, in the same way as in the normal operation
mode, execute the self-programming library in the state where the IE flag is cleared (0) by the
DI instruction. To enable an interrupt, clear (0) the interrupt mask flag to accept in the state
where the IE flag is set (1) by the EI instruction, and then execute the self-programming
library.
4. The self-programming function is disabled in the low consumption current mode. For details
of the low consumption current mode, see CHAPTER 20 REGULATOR.
The following figure illustrates a flow of rewriting the flash memory by using a self programming library.
FlashStart
FlashEnv
CheckFLMD
FlashBlockBlankCheck
No
Normal completion?
Yes
FlashBlockErase
FlashWordWrite
FlashBlockVerify
No
Normal completion?
Yes
FlashBlockErase
FlashWordWrite
FlashBlockVerify
No
Normal completion?
Error
FlashEnd
Note A boot cluster is a 4 KB area and boot clusters 0 and 1 are swapped by the boot swap function.
XXXXXH
Self-programming User program Execution of boot User program Self-programming User program
User program
to boot cluster 1 swap by firmware to boot cluster 0
02000H
New boot program Boot program New user program
User program (boot cluster 1) (boot cluster 0) (boot cluster 0)
01000H
Boot program Boot program New boot program New boot program
(boot cluster 0) (boot cluster 0) (boot cluster 1) (boot cluster 1)
00000H Boot
Boot Boot Boot
Block number
Erasing block 4 Erasing block 5 Erasing block 6 Erasing block 7
7 Program 7 Program 7 Program 7 Program 7
Boot 6 Program 6 Program 6 Program 6 6
cluster 1 5 Program 5 Program 5 5 5
4 Program 01000H 4 4 4 4
3 Boot program 3 Boot program 3 Boot program 3 Boot program 3 Boot program
Boot
2 Boot program 2 Boot program 2 Boot program 2 Boot program 2 Boot program
cluster 0 1 Boot program 1 Boot program 1 Boot program 1 Boot program 1 Boot program
0 Boot program 00000H 0 Boot program 0 Boot program 0 Boot program 0 Boot program
Booted by boot cluster 0
Caution If the rewrite-prohibited area of the boot cluster 0 overlaps with the flash shield window range,
prohibition to rewrite the boot cluster 0 takes priority.
Table 22-9. Relationship between Flash Shield Window Function Setting/Change Methods and Commands
Self-programming Specify the starting and Block erasing is enabled Writing is enabled only
ending blocks by the set only within the window within the range of
information library. range. window range.
On-board/Off-board Specify the starting and Block erasing is enabled Writing is enabled also
programming ending blocks on GUI of also outside the window outside the window
dedicated flash memory range. range.
programmer, etc.
Remark See 22.7 Security Settings to prohibit writing/erasing during on-board/off-board programming.
Note 1
The μPD79F9211 uses the VDD, FLMD0, RESET, TOOL0, TOOL1 , and VSS pins to communicate with the host
machine via an on-chip debug emulator (QB-MINI2).
Caution The μPD79F9211 has an on-chip debug function, which is provided for development and
evaluation. Do not use the on-chip debug function in products designated for mass production,
because the guaranteed number of rewritable times of the flash memory may be exceeded when
this function is used, and product reliability therefore cannot be guaranteed. NEC Electronics is
not liable for problems occurring when the on-chip debug function is used.
FLMD0 FLMD0
RESET_OUT RESET
VDD
GND VSS
VDD VDD
Notes 1. Connection is not required for communication in 1-line mode but required for communication in 2-line
mode. At this time, perform necessary connections according to Table 2-2 Connection of Unused Pins
since TOOL1 is an unused pin when QB-MINI2 is unconnected.
2. Connecting the dotted line is not necessary since RXD and TXD are shorted within QB-MIN2. When
using the other flash memory programmer, RXD and TXD may not be shorted within the programmer. In
this case, they must be shorted on the target system.
Remark The FLMD0 pin is recommended to be open for self-programming in on-chip debugging. To pull down
externally, use a resistor of 100 kΩ or more.
1-line mode (single line UART) using the TOOL0 pin or 2-line mode using the TOOL0 and TOOL1 pins is used for
serial communication For flash memory programming, 1-line mode is used. 1-line mode or 2-line mode is used for on-
chip debugging. Table 23-1 lists the differences between 1-line mode and 2-line mode.
Table 23-1. Lists the Differences Between 1-line Mode and 2-line Mode.
Remark 2-line mode is not used for flash programming, however, even if TOOL1 pin is connected with CLK_IN of
QB-MINI2, writing is performed normally with no problem.
The μPD79F9211 has an on-chip debug operation control bit in the flash memory at 000C3H (see CHAPTER 21
OPTION BYTE) and an on-chip debug security ID setting area at 000C4H to 000CDH, to prevent third parties from
reading memory content.
When the boot swap function is used, also set a value that is the same as that of 010C3H and 010C4H to 010CDH
in advance, because 000C3H, 000C4H to 000CDH and 010C3H, and 010C4H to 010CDH are switched.
For details on the on-chip debug security ID, refer to the QB-MINI2 On-Chip Debug Emulator with Programming
Function User’s Manual (U18371E).
010C4H to 010CDH
To perform communication between the μPD79F9211 and QB-MINI2, as well as each debug function, the securing
of memory space must be done beforehand.
If NEC Electronics assembler RA78K0R or compiler CC78K0R is used, the items can be set by using linker options.
Figure 23-2. Memory Spaces Where Debug Monitor Programs Are Allocated
Note 1 (1 KB)
Stack area for debugging Internal RAM
(6 bytes) Note 3 area
02000H
Use prohibited
010D8H
000D8H
For details of the way to secure of the memory space, refer to the QB-MINI2 On-Chip Debug Emulator with
Programming Function User’s Manual (U18371E).
The result of addition/subtraction of the BCD (binary-coded decimal) code and BCD code can be obtained as BCD
code with this circuit.
The decimal correction operation result is obtained by performing addition/subtraction having the A register as the
operand and then adding/ subtracting the BCDADJ register.
BCDADJ
(1) Addition: Calculating the result of adding a BCD code value and another BCD code value by using a
BCD code value
<1> The BCD code value to which addition is performed is stored in the A register.
<2> By adding the value of the A register and the second operand (value of one more BCD code to be added)
as are in binary, the binary operation result is stored in the A register and the correction value is stored in
the BCDADJ register.
<3> Decimal correction is performed by adding in binary the value of the A register (addition result in binary)
and the BCDADJ register (correction value), and the correction result is stored in the A register and CY
register.
Caution The value read from the BCDADJ register varies depending on the value of the A
register when it is read and those of the CY and AC flags. Therefore, execute the
instruction <3> after the instruction <2> instead of executing any other instructions. To
perform BCD correction in the interrupt enabled state, saving and restoring the A
register is required within the interrupt function. PSW (CY flag and AC flag) is restored
by the RETI instruction.
Examples 1: 99 + 89 = 188
Examples 2: 85 + 15 = 100
Examples 3: 80 + 80 = 160
(2) Subtraction: Calculating the result of subtracting a BCD code value from another BCD code value by
using a BCD code value
<1> The BCD code value from which subtraction is performed is stored in the A register.
<2> By subtracting the value of the second operand (value of BCD code to be subtracted) from the A register
as is in binary, the calculation result in binary is stored in the A register, and the correction value is stored
in the BCDADJ register.
<3> Decimal correction is performed by subtracting the value of the BCDADJ register (correction value) from
the A register (subtraction result in binary) in binary, and the correction result is stored in the A register
and CY register.
Caution The value read from the BCDADJ register varies depending on the value of the A
register when it is read and those of the CY and AC flags. Therefore, execute the
instruction <3> after the instruction <2> instead of executing any other instructions. To
perform BCD correction in the interrupt enabled state, saving and restoring the A
register is required within the interrupt function. PSW (CY flag and AC flag) is restored
by the RETI instruction.
Example: 91 − 52 = 39
This chapter lists the instructions in the 78K0R microcontroller instruction set. For details of each operation and
operation code, refer to the separate document 78K0R Microcontrollers Instructions User’s Manual (U17792E).
Remark The shaded parts of the tables in Table 25-5 Operation List indicate the operation or instruction format
that is newly added for the 78K0R microcontrollers.
In the case of immediate data, describe an appropriate numeric value or a label. When using a label, be sure to
describe the #, !, !!, $, $!, [ ], and ES: symbols.
For operand register identifiers, r and rp, either function names (X, A, C, etc.) or absolute names (names in
parentheses in the table below, R0, R1, R2, etc.) can be used for description.
Remark For special-function register symbol, see Table 3-5 SFR List and Table 3-6 Extended SFR (2nd SFR)
List.
Symbol Function
Instruction Opcode
1 2 3 4 5
Caution Set the ES register value with MOV ES, A, etc., before executing the PREFIX instruction.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
3. Except r = A
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
3. Except r = A
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
3. Except rp = AX
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
3. Except rp = AX
4. Except r = A
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
3. Except r = A
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
3. Except r = A
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
3. Except r = A
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
3. Except r = A
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
3. cnt indicates the bit shift count.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
− PC ← PC + 4 + jdisp8 if (saddr).bit = 1
Note 3
BT saddr.bit, $addr20 4 3/5
− PC ← PC + 4 + jdisp8 if sfr.bit = 1
Note 3
sfr.bit, $addr20 4 3/5
− PC ← PC + 3 + jdisp8 if A.bit = 1
Note 3
A.bit, $addr20 3 3/5
− PC ← PC + 4 + jdisp8 if PSW.bit = 1
Note 3
PSW.bit, $addr20 4 3/5
PC ← PC + 3 + jdisp8 if (HL).bit = 1
Note 3
[HL].bit, $addr20 3 3/5 6/8
ES:[HL].bit, 4 4/6
Note 3
7/9 PC ← PC + 4 + jdisp8
$addr20 if (ES, HL).bit = 1
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
3. This indicates the number of clocks “when condition is not met/when condition is met”.
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
− PC ← PC + 4 + jdisp8 if (saddr).bit = 0
Note 3
Condition BF saddr.bit, $addr20 4 3/5
al branch sfr.bit, $addr20 4 3/5
Note 3
− PC ← PC + 4 + jdisp8 if sfr.bit = 0
− PC ← PC + 3 + jdisp8 if A.bit = 0
Note 3
A.bit, $addr20 3 3/5
− PC ← PC + 4 + jdisp8 if PSW.bit = 0
Note 3
PSW.bit, $addr20 4 3/5
PC ← PC + 3 + jdisp8 if (HL).bit = 0
Note 3
[HL].bit, $addr20 3 3/5 6/8
PC ← PC + 4 + jdisp8 if (ES, HL).bit = 0
Note 3
ES:[HL].bit, $addr20 4 4/6 7/9
BTCLR saddr.bit, $addr20 4 3/5
Note 3
− PC ← PC + 4 + jdisp8 if (saddr).bit = 1
then reset (saddr).bit
sfr.bit, $addr20 4 3/5
Note 3
− PC ← PC + 4 + jdisp8 if sfr.bit = 1
then reset sfr.bit
A.bit, $addr20 3 3/5
Note 3
− PC ← PC + 3 + jdisp8 if A.bit = 1
then reset A.bit
PSW.bit, $addr20 4 5/7
Note 3
− PC ← PC + 4 + jdisp8 if PSW.bit = 1 × × ×
then reset PSW.bit
[HL].bit, $addr20 3 3/5
Note 3
− PC ← PC + 3 + jdisp8 if (HL).bit = 1
then reset (HL).bit
ES:[HL].bit, $addr20 4 4/6
Note 3
− PC ← PC + 4 + jdisp8 if (ES, HL).bit = 1
then reset (ES, HL).bit
Conditional SKC − 2 1 − Next instruction skip if CY = 1
skip SKNC − 2 1 − Next instruction skip if CY = 0
SKZ − 2 1 − Next instruction skip if Z = 1
SKNZ − 2 1 − Next instruction skip if Z = 0
SKH − 2 1 − Next instruction skip if (Z ∨ CY) = 0
SKNH − 2 1 − Next instruction skip if (Z ∨ CY) = 1
CPU SEL RBn 2 1 − RBS[1:0] ← n
control NOP − 1 1 − No Operation
EI − 3 4 − IE ← 1(Enable Interrupt)
DI − 3 4 − IE ← 0(Disable Interrupt)
HALT − 2 3 − Set HALT Mode
STOP − 2 3 − Set STOP Mode
Notes 1. When the internal RAM area or SFR area is accessed, or for an instruction with no data access.
2. When the program memory area is accessed.
3. This indicates the number of clocks “when condition is not met/when condition is met”.
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the system clock control
register (CKC).
2. This number of clocks is for when the program is in the internal ROM (flash memory) area.
3. n indicates the number of register banks (n = 0 to 3)
Cautions 1. These specifications show target values, which may change after device evaluation.
2. The 78K0R/IC3 has an on-chip debug function, which is provided for development and
evaluation. Do not use the on-chip debug function in products designated for mass
production, because the guaranteed number of rewritable times of the flash memory may be
exceeded when this function is used, and product reliability therefore cannot be guaranteed.
NEC Electronics is not liable for problems occurring when the on-chip debug function is used.
Caution Product quality may suffer if the absolute maximum rating is exceeded even momentarily for any
parameter. That is, the absolute maximum ratings are rated values at which the product is on the
verge of suffering physical damage, and therefore the product must be used under conditions
that ensure that the absolute maximum ratings are not exceeded.
Remarks . Unless specified otherwise, the characteristics of alternate-function pins are the same as those of
port pins.
Caution Product quality may suffer if the absolute maximum rating is exceeded even momentarily for any
parameter. That is, the absolute maximum ratings are rated values at which the product is on the
verge of suffering physical damage, and therefore the product must be used under conditions
that ensure that the absolute maximum ratings are not exceeded.
Remarks. Unless specified otherwise, the characteristics of alternate-function pins are the same as those of
port pins.
X1 Oscillator Characteristics
(TA = −40 to +85°C, 2.7 V ≤ VDD ≤ 5.5 V, VSS = AVSS = 0 V)
Resonator Recommended Parameter Conditions MIN. TYP. MAX. Unit
Circuit
Ceramic resonator X1 clock oscillation 2.7 V ≤ VDD ≤ 5.5 V 2.0 20.0 MHz
VSS X1 X2 frequency (fX)
Note
C1 C2
Crystal resonator X1 clock oscillation 2.7 V ≤ VDD ≤ 5.5 V 2.0 20.0 MHz
VSS X1 X2 frequency (fX)
Note
C1 C2
Note Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time.
Cautions 1. When using the X1 oscillator, wire as follows in the area enclosed by the broken lines in the
above figures to avoid an adverse effect from wiring capacitance.
2. Since the CPU is started by the internal high-speed oscillation clock after a reset release,
check the X1 clock oscillation stabilization time using the oscillation stabilization time counter
status register (OSTC) by the user. Determine the oscillation stabilization time of the OSTC
register and oscillation stabilization time select register (OSTS) after sufficiently evaluating
the oscillation stabilization time with the resonator to be used.
Remark For the resonator selection and oscillator constant, customers are requested to either evaluate the
oscillation themselves or apply to the resonator manufacturer for evaluation.
Notes 1. This only indicates the oscillator characteristics. Refer to AC Characteristics for instruction execution
time.
2. Regulator output is set to low consumption current mode in the following cases:
Remark For details on the normal current mode and low consumption current mode according to the regulator
output voltage, refer to CHAPTER 22 REGULATOR.
C4 C3
Note Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time.
Cautions 1. When using the XT1 oscillator, wire as follows in the area enclosed by the broken lines in the
above figures to avoid an adverse effect from wiring capacitance.
2. The XT1 oscillator is designed as a low-amplitude circuit for reducing power consumption,
and is more prone to malfunction due to noise than the X1 oscillator. Particular care is
therefore required with the wiring method when the XT1 clock is used.
Remark For the resonator selection and oscillator constant, customers are requested to either evaluate the
oscillation themselves or apply to the resonator manufacturer for evaluation.
DC Characteristics (1/8)
(TA = −40 to +85°C, 2.7 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ AVREF ≤ VDD, VSS = AVSS = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Output current, IOH1 Per pin for P10 to P13, P30 to P32, 4.0 V ≤ VDD ≤ 5.5 V −3.0 mA
Note 1
high P40, P41, P50 to P52, P70 to P75, 2.7 V ≤ VDD < 4.0 V −1.0 mA
P120
Total of P40, P41, P120 4.0 V ≤ VDD ≤ 5.5 V −20.0 mA
Note 2
(When duty = 70% ) 2.7 V ≤ VDD < 4.0 V −10.0 mA
Total of P10 to P13, P30 to P32, 4.0 V ≤ VDD ≤ 5.5 V −30.0 mA
P50 to P52, P70 to P75
Note 2 2.7 V ≤ VDD < 4.0 V −19.0 mA
(When duty = 70% )
Total of all pins 4.0 V ≤ VDD ≤ 5.5 V −50.0 mA
Note 2
(When duty = 60% ) 2.7 V ≤ VDD < 4.0 V −29.0 mA
IOH2 Per pin for P20 to P27, P80 to P83, AVREF ≤ VDD −0.1 mA
P150 to P151
Notes 1. Value of current at which the device operation is guaranteed even if the current flows from VDD pin to
an output pin.
2. Specification under conditions where the duty factor is 60% or 70%.
The output current value that has changed the duty ratio can be calculated with the following
expression (when changing the duty factor from 70% to n%).
•Total output current of pins = (IOH × 0.7)/(n × 0.01)
<Example> Where n = 50% and IOH = 20.0 mA
Total output current of pins = (−20.0 × 0.7)/(50 × 0.01) = −28.0 mA
However, the current that is allowed to flow into one pin does not vary depending on the duty factor. A
current higher than the absolute maximum rating must not flow into one pin.
Caution P30 to P32, P70, P72, P73, and P75 do not output high level in N-ch open-drain mode.
Remarks . Unless specified otherwise, the characteristics of alternate-function pins are the same as those of
port pins.
DC Characteristics (2/8)
(TA = −40 to +85°C, 2.7 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ AVREF ≤ VDD, VSS = AVSS = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Output current, IOL1 Per pin for P30 to P32, P40, P41, 4.0 V ≤ VDD ≤ 5.5 V 8.5 mA
Note 1
low P52, P70 to P75, P120 2.7 V ≤ VDD < 4.0 V 1.0 mA
Per pin for P10 to P13, P50, P51 4.0 V ≤ VDD ≤ 5.5 V 10.0 mA
2.7 V ≤ VDD < 4.0 V 1.0 mA
Total of P40, P41, P120 4.0 V ≤ VDD ≤ 5.5 V 20.0 mA
Note 2
(When duty = 70% ) 2.7 V ≤ VDD < 4.0 V 15.0 mA
Total of P10 to P13, P30 to P32, 4.0 V ≤ VDD ≤ 5.5 V 45.0 mA
P50 to P52, P70 to P75
Note 2 2.7 V ≤ VDD < 4.0 V 35.0 mA
(When duty = 70% )
Total of all pins 4.0 V ≤ VDD ≤ 5.5 V 65.0 mA
Note 2
(When duty = 70% ) 2.7 V ≤ VDD < 4.0 V 40.0 mA
IOL2 Per pin for P20 to P27, P80 to P83, AVREF ≤ VDD 0.4 mA
P150 to P151
Notes 1. Value of current at which the device operation is guaranteed even if the current flows from an output
pin to VSS and AVSS pin.
2. Specification under conditions where the duty factor is 60% or 70%.
The output current value that has changed the duty ratio can be calculated with the following
expression (when changing the duty factor from 70% to n%).
•Total output current of pins = (IOL × 0.7)/(n × 0.01)
<Example> Where n = 50% and IOL = 20.0 mA
Total output current of pins = (20.0 × 0.7)/(50 × 0.01) = 28.0 mA
However, the current that is allowed to flow into one pin does not vary depending on the duty factor. A
current higher than the absolute maximum rating must not flow into one pin.
Remarks . Unless specified otherwise, the characteristics of alternate-function pins are the same as those of
port pins.
DC Characteristics (3/8)
(TA = −40 to +85°C, 2.7 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ AVREF ≤ VDD, VSS = AVSS = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Input voltage, VIH1 P30, P123, P124 0.7VDD VDD V
high VIH2 P10 to P13, P31, P32, P40, P41, Normal input buffer 0.8VDD VDD V
P50 to P52, P70 to P75,
P120 to P122, EXCLK, RESET
VIH3 P31, P32, P71, P72, P74, P75 TTL input buffer 2.2 VDD V
4.0 V ≤ VDD ≤ 5.5 V
TTL input buffer 2.0 VDD V
2.7 V ≤ VDD < 4.0 V
VIH4 P20 to P27, P81, P83, P150, P151 2.7 V ≤ AVREF ≤ VDD 0.7AVREF AVREF V
VIH5 P80, P82 2.7 V ≤ AVREF ≤ VDD 0.8AVREF AVREF V
VIH7 FLMD0 0.9VDD VDD V
Note
Note Must be 0.9VDD or higher when used in the flash memory programming mode.
Caution The maximum value of VIH of pins P30 to P32, P70, P72, P73, and P75 is VDD, even in the N-ch
open-drain mode.
Remark. Unless specified otherwise, the characteristics of alternate-function pins are the same as those of
port pins.
DC Characteristics (4/8)
(TA = −40 to +85°C, 2.7 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ AVREF ≤ VDD, VSS = AVSS = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Input voltage, VIL1 P30, P123, P124 0 0.3VDD V
low VIL2 P10 to P13, P31, P32, P40, P41, Normal input buffer 0 0.2VDD V
P50 to P52, P70 to P75,
P120 to P122, EXCLK, RESET
VIL3 P31, P32, P71, P72, P74, P75 TTL input buffer 0 0.8 V
4.0 V ≤ VDD ≤ 5.5 V
TTL input buffer 0 0.5 V
2.7 V ≤ VDD < 4.0 V
VIL4 P20 to P27, P81, P83, P150 to P151 2.7 V ≤ AVREF ≤ VDD 0 0.3AVREF V
VIL5 P80, P82 2.7 V ≤ AVREF ≤ VDD 0 0.2AVREF V
Note
VIL7 FLMD0 0 0.1VDD V
Note When disabling writing of the flash memory, connect the FLMD0 pin processing directly to VSS, and maintain a
voltage less than 0.1VDD.
Remarks . Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port
pins.
DC Characteristics (5/8)
(TA = −40 to +85°C, 2.7 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ AVREF ≤ VDD, VSS = AVSS = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Output voltage, VOH1 P10 to P13, P30 to P32, P40, P41, 4.0 V ≤ VDD ≤ 5.5 V, VDD − 0.7 V
high P50 to P52, P70 to P75, P120 IOH1 = − 3.0 mA
2.7 V ≤ VDD ≤ 5.5 V, VDD − 0.5 V
IOH1 = −1.0 mA
VOH2 P20 to P27, P80 to P83, P150 to AVREF ≤ VDD, AVREF − V
P151 IOH2 = −0.1 mA 0.5
Output voltage, VOL1 P10 to P13, P30 to P32, P40, P41, 4.0 V ≤ VDD ≤ 5.5 V, 0.7 V
low P50 to P52, P70 to P75, P120 IOL1 = 8.5 mA
2.7 V ≤ VDD ≤ 5.5 V, 0.5 V
IOL1 = 1.0 mA
VOL2 P10 to P13, P50, P51 4.0 V ≤ VDD ≤ 5.5 V, 1.4 V
IOL1 = 10.0 mA
2.7 V ≤ VDD ≤ 5.5 V, 0.5 V
IOL1 = 1.0 mA
VOL3 P20 to P27, P80 to P83, AVREF = VDD, 0.4 V
P150 to P151 IOL2 = 0.4 mA
Caution P30 to P32, P70, P72, P73, and P75 do not output high level in N-ch open-drain mode.
Remarks 1. Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port
pins.
DC Characteristics (6/8)
(TA = −40 to +85°C, 2.7 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ AVREF ≤ VDD, VSS = AVSS = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Input leakage ILIH1 P10 to P13, P30 to P32, P40, VI = VDD 1 μA
current, high P41, P50 to P52
P70 to P75, P120, FLMD0,
RESET
ILIH2 P20 to P27, P80 to P83, VI = AVREF, 1 μA
P150 to P151 AVREF = VDD
ILIH3 P121 to P124 VI = VDD In input port 1 μA
(X1, X2, XT1, XT2) In resonator 10 μA
connection
Input leakage ILIL1 P10 to P13, P30 to P32, P40, VI = VSS −1 μA
current, low P41, P50 to P52,
P70 to P75, P120, FLMD0,
RESET
ILIL2 P20 to P27, P80 to P83, VI = VSS, −1 μA
P150 to P151 AVREF = VDD
Remarks . Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port
pins.
DC Characteristics (7/8)
(TA = −40 to +85°C, 2.7 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ AVREF ≤ VDD, VSS = AVSS = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
O-chip pll-up RU P10 to P13, P30 to P32, P40, VI = VSS, In input port 10 20 100 kΩ
resistance P41, P50 to P52, P120
FLMD0 pin RFLMD0 When enabling the self-programming mode setting with 100 kΩ
external pull-down software
Note
resistance
Note It is recommended to leave the FLMD0 pin open. If the pin is required to be pulled down externally, set
RFLMD0 to 100 kΩ or more.
uPD79F9211
FLMD0 pin
RFLMD0
Remark. Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port
pins.
DC Characteristics (8/8)
(TA = −40 to +85°C, 2.7 V ≤ VDD = ≤ 5.5 V, 2.7 V ≤ AVREF ≤ VDD, VSS = AVSS = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Operational IAMP
Note 5
T.B.D T.B.D μA
amplifier
operating
current
Comparator ICMP
Note 6
Per channel when the internal reference AVREF = VDD = 5.0 V T.B.D T.B.D μA
operating voltage is not used AVREF = VDD = 3.0 V T.B.D T.B.D μA
current
Per channel when the internal reference AVREF = VDD = 5.0 V T.B.D T.B.D μA
voltage is used AVREF = VDD = 3.0 V T.B.D T.B.D μA
LVI operating ILVI
Note 7
9 18 μA
current
Notes 1. Current flowing only to the real-time counter (excluding the operating current of the XT1 oscillator). The
current value of the 78K0R/IC3 is the TYP. value, the sum of the TYP. values of either IDD1 or IDD2, and IRTC,
when the real-time counter operates in operation mode or HALT mode. The IDD1 and IDD2 MAX. values also
include the real-time counter operating current.
2. When internal high-speed oscillator and high-speed system clock are stopped.
3. Current flowing only to the watchdog timer (including the operating current of the 30 kHz internal oscillator).
The current value of the 78K0R/IC3 is the sum of IDD1, I DD2 or I DD3 and IWDT when fCLK = fSUB/2 when the
watchdog timer operates in STOP mode.
4. Current flowing only to the A/D converter (AVREF pin). The current value of the 78K0R/IC3 is the sum of IDD1
or IDD2 and IADC when the A/D converter operates in an operation mode or the HALT mode.
5. Current flowing only to the operational amplifier (AVREF pin). The current value of the 78K0R/IC3 is the sum
of IDD1 or IDD2 and IAMP when the operational amplifier operates in an operation mode or the HALT mode.
6. Current flowing only to the comparator (AVREF pin). The current value of the 78K0R/IC3 is the sum of IDD1
or IDD2 and ICMP when the comparator operates in an operation mode or the HALT mode.
7. Current flowing only to the LVI circuit. The current value of the 78K0R/IC3 is the sum of IDD1, IDD2 or IDD3
and ILVI when the LVI circuit operates in the Operating, HALT or STOP mode.
AC Characteristics
Minimum instruction execution time during main system clock operation (FSEL = 0, RMC = 00H)
10
8.0
Guaranteed range of
1.0 main system clock operation
Cycle time TCY [ μ s]
0.1
0.01
5.5
0 1.0 2.0 3.0 4.0 5.0 6.0
2.7
Remark FSEL: Bit 0 of the operation speed mode control register (OSMC)
Minimum instruction execution time during main system clock operation (FSEL = 1, RMC = 00H)
10
8.0
Guaranteed range of
main system clock operation
Cycle time TCY [ μ s]
1.0
(FSEL = 1, RMC = 00H)
0.2
0.1
0.05
0.01
0 1.0 2.0 3.0 4.0 5.0 5.5 6.0
2.7
Supply voltage VDD [V]
Caution The following operations are prohibited when VDD is less than 2.7 V.
- Operation rewriting FSEL from 0 to 1 when VDD is less than 2.7 V
- Releasing STOP mode during fEX operation and fIH operation, when VDD is less than 2.3 V and
FSEL is set to 1
(This must not be performed even if the frequency is divided. The STOP mode may be
released during fX operation.)
Remarks 1. FSEL: Bit 0 of the operation speed mode control register (OSMC)
2. fIH: Internal high-speed oscillation clock frequency
fX: X1 clock oscillation frequency
fEX: External main system clock frequency
Minimum instruction execution time during main system clock operation (FSEL = 0, RMC = 5AH)
10
8.0
Guaranteed range of
main system clock operation
(FSEL = 0, RMC = 5AH)
Cycle time TCY [ μ s]
1.0
The range enclosed in dotted
lines applies when the internal
high-speed oscillation clock
(8 MHz) is selected.
0.2
0.1
0.05
0.01
0 1.0 2.0 3.0 4.0 5.0 5.5 6.0
2.7
Supply voltage VDD [V]
Remarks 1. FSEL: Bit 0 of the operation speed mode control register (OSMC)
2. The entire voltage range is 5 MHz (MAX.) when RMC is set to 5AH.
Minimum instruction execution time during self programming mode (RMC = 00H)
10
8.0
0.5
0.2
0.1
0.05
0.01
0 1.0 2.0 3.0 4.0 5.0 5.5 6.0
1.8 2.7
Supply voltage VDD [V]
Remarks 1. FSEL: Bit 0 of the operation speed mode control register (OSMC)
2. The self programming function cannot be used when RMC is set to 5AH or the CPU operates with
the subsystem clock.
VIH VIH
Test points
VIL VIL
1/fEX
tEXL tEXH
0.8VDD (MIN.)
EXCLK
0.2VDD (MAX.)
TI Timing
t TIL t TIH
TI02 to TI07,
TI09 to TI11 ,
SLTI
tINTL tINTH
INTP0 to INTP7
tRSL
RESET
(a) During communication at same potential (UART mode) (dedicated baud rate generator output)
TxDq Rx
RxDq Tx
1/Transfer rate
High-/Low-bit width
Baud rate error tolerance
TxDq
RxDq
Caution Select the normal input buffer for RxDq and the normal output mode for TxDq by using the PIMg
and POMg registers.
(b) During communication at same potential (CSI mode) (master mode, SCKp... internal clock output)
Notes 1. When DAP0n = 0 and CKP0n = 0, or DAP0n = 1 and CKP0n = 1. The SIp setup time becomes “to SCKp↓”
when DAP0n = 0 and CKP0n = 1, or DAP0n = 1 and CKP0n = 0.
2. When DAP0n = 0 and CKP0n = 0, or DAP0n = 1 and CKP0n = 1. The SIp hold time becomes “from
SCKp↓” when DAP0n = 0 and CKP0n = 1, or DAP0n = 1 and CKP0n = 0.
3. When DAP0n = 0 and CKP0n = 0, or DAP0n = 1 and CKP0n = 1. The delay time to SOp output becomes
“from SCKp↑” when DAP0n = 0 and CKP0n = 1, or DAP0n = 1 and CKP0n = 0.
4. C is the load capacitance of the SCKp and SOp output lines.
Caution Select the normal input buffer for SIp and the normal output mode for SOp and SCKp by using the
PIMg and POMg registers.
(c) During communication at same potential (CSI mode) (slave mode, SCKp... external clock input)
Notes 1. When DAP0n = 0 and CKP0n = 0, or DAP0n = 1 and CKP0n = 1. The SIp setup time becomes “to SCKp↓”
when DAP0n = 0 and CKP0n = 1, or DAP0n = 1 and CKP0n = 0.
2. When DAP0n = 0 and CKP0n = 0, or DAP0n = 1 and CKP0n = 1. The SIp hold time becomes “from
SCKp↓” when DAP0n = 0 and CKP0n = 1, or DAP0n = 1 and CKP0n = 0.
3. When DAP0n = 0 and CKP0n = 0, or DAP0n = 1 and CKP0n = 1. The delay time to SOp output becomes
“from SCKp↑” when DAP0n = 0 and CKP0n = 1, or DAP0n = 1 and CKP0n = 0.
4. C is the load capacitance of the SCKp and SOp output lines.
Caution Select the normal input buffer for SIp and SCKp and the normal output mode for SOp by using the
PIMg and POMg registers.
SCKp SCK
SOp SI
tKCY1, 2
tKL1, 2 tKH1, 2
SCKp
tSIK1, 2 tKSI1, 2
tKSO1, 2
tKCY1, 2
tKH1, 2 tKL1, 2
SCKp
tSIK1, 2 tKSI1, 2
tKSO1, 2
2
(d) During communication at same potentia (simplified I C mode)
Hold time when SCL10 = “L” tLOW 4.0 V ≤ VDD ≤ 5.5 V, 475 ns
Cb = 100 pF, Rb = 1.7 kΩ
Hold time when SCL10 = “H” tHIGH 4.0 V ≤ VDD ≤ 5.5 V, 475 ns
Cb = 100 pF, Rb = 1.7 kΩ
2
Simplified I C mode mode connection diagram (during communication at same potential)
VDD
Rb
SDA10 SDA
SCL10 SCL
2
Simplified I C mode serial transfer timing (during communication at same potential)
1/fSCL
tLOW tHIGH
SCL10
SDA10
tHD:DAT tSU:DAT
Caution Select the normal input buffer and the N-ch open drain output (VDD tolerance) mode for SDA10
and the normal output mode for SCL10 by using the PIM3 and POM3 registers.
(e) Communication at different potential (2.5 V, 3 V) (UART mode) (dedicated baud rate generator output) (1/2)
Caution Select the TTL input buffer for RxDq and the N-ch open drain output (VDD tolerance) mode for TxDq
by using the PIMg and POMg registers.
(e) Communication at different potential (2.5 V, 3 V) (UART mode) (dedicated baud rate generator output) (2/2)
Notes 1. The smaller maximum transfer rate derived by using fMCK/6 or the following expression is the valid
maximum transfer rate.
Expression for calculating the transfer rate when 4.0 V ≤ VDD ≤ 5.5 V and 2.7 V ≤ Vb ≤ 4.0 V
1
Maximum transfer rate = [bps]
2.2
{−Cb × Rb × ln (1− )} × 3
Vb
1 2.2
−{ −Cb × Rb × ln (1 − )}
Transfer rate × 2 Vb
Baud rate error (theoretical value) = × 100 [%]
1
( ) ×Number of transferred bits
Transfer rate
* This value is the theoretical value of the relative difference between the transmission and reception sides.
2. This value as an example is calculated when the conditions described in the “Conditions” column are met.
Refer to Note 1 above to calculate the maximum transfer rate under conditions of the customer.
3. The smaller maximum transfer rate derived by using fMCK/6 or the following expression is the valid
maximum transfer rate.
Expression for calculating the transfer rate when 2.7 V ≤ VDD ≤ 4.0 V and 2.3 V ≤ Vb ≤ 2.7 V
1
Maximum transfer rate = [bps]
2.0
{−Cb × Rb × ln (1− )} × 3
Vb
1 2.0
−{ −Cb × Rb × ln (1 − )}
Transfer rate × 2 Vb
Baud rate error (theoretical value) = × 100 [%]
1
( ) ×Number of transferred bits
Transfer rate
* This value is the theoretical value of the relative difference between the transmission and reception sides.
4. This value as an example is calculated when the conditions described in the “Conditions” column are met.
Refer to Note 3 above to calculate the maximum transfer rate under conditions of the customer.
Caution Select the TTL input buffer for RxDq and the N-ch open drain output (VDD tolerance) mode for TxDq
by using the PIMg and POMg registers.
Remarks 1. Rb[Ω]:Communication line (TxDq) pull-up resistance, Cb[F]: Communication line (TxDq) load
capacitance, Vb[V]: Communication line voltage
2. q: UART number (q = 0, 1) , g: PIM and POM number (g = 3, 7)
3. fMCK: Serial array unit operation clock frequency
(Operation clock to be set by the CKS0n bit of the SMR0n register. n: Channel number (n = 0 to 3))
4. VIH and VIL below are observation points for the AC characteristics of the serial array unit when
communicating at different potentials in UART mode.
4.0 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V: VIH = 2.2 V, VIL = 0.8 V
2.7 V ≤ VDD ≤ 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V: VIH = 2.0 V, VIL = 0.5 V
Vb
Rb
TxDq Rx
RxDq Tx
1/Transfer rate
Low-bit width
High-bit width
Baud rate error tolerance
TxDq
1/Transfer rate
High-/Low-bit width
Baud rate error tolerance
RxDq
Caution Select the TTL input buffer for RxDq and the N-ch open drain output (VDD tolerance) mode for TxDq
by using the PIMg and POMg registers.
Remarks 1. Rb[Ω]:Communication line (TxDq) pull-up resistance, Vb[V]: Communication line voltage
2. q: UART number (q = 0, 1) , g: PIM and POM number (g = 3, 7)
(f) Communication at different potential (2.5 V, 3 V) (CSI mode) (master mode, SCKp... internal clock
output) (1/2)
SCKp cycle time tKCY1 4.0 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, 500 ns
Cb = 50 pF, Rb = 1.4 kΩ
SCKp low-level width tKL1 4.0 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, tKCY1/2 − 20 ns
Cb = 50 pF, Rb = 1.4 kΩ
SIp setup time tSIK1 4.0 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, 195 ns
Note
(to SCKp↑) Cb = 50 pF, Rb = 1.4 kΩ
2.7 V ≤ VDD ≤ 4.0 V, 2.3 V ≤ Vb < 2.7 V, 380 ns
Cb = 50 pF, Rb = 2.7 kΩ
SIp hold time tKSI1 4.0 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, 30 ns
Note
(from SCKp↑) Cb = 50 pF, Rb = 1.4 kΩ
2.7 V ≤ VDD ≤ 4.0 V, 2.3 V ≤ Vb < 2.7 V, 30 ns
Cb = 50 pF, Rb = 2.7 kΩ
Delay time from SCKp↓ to tKSO1 4.0 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, 165 ns
Note
SOp output Cb = 50 pF, Rb = 1.4 kΩ
2.7 V ≤ VDD ≤ 4.0 V, 2.3 V ≤ Vb < 2.7 V, 320 ns
Cb = 50 pF, Rb = 2.7 kΩ
Caution Select the TTL input buffer for SIp and the N-ch open drain output (VDD tolerance) mode for SOp and
SCKp by using the PIMg and POMg registers.
(f) Communication at different potential (2.5 V, 3 V) (CSI mode) (master mode, SCKp... internal clock
output) (2/2)
<Master> Vb Vb
Rb Rb
SCKp SCK
SOp SI
Caution Select the TTL input buffer for SIp and the N-ch open drain output (VDD tolerance) mode for SOp and
SCKp by using the PIMg and POMg registers.
tKCY1
tKL1 tKH1
SCKp
tSIK1 tKSI1
tKSO1
tKCY1
tKH1 tKL1
SCKp
tSIK1 tKSI1
tKSO1
Caution Select the TTL input buffer for SIp and the N-ch open drain output (VDD tolerance) mode for SOp and
SCKp by using the PIMg and POMg registers.
(g) Communication at different potential (2.5 V, 3 V) (CSI mode) (slave mode, SCKp... external clock input)
SCKp cycle time tKCY2 4.0 V ≤ VDD ≤ 5.5 V, 16.6 MHz < fMCK 12/fMCK ns
2.7 V ≤ Vb ≤ 4.0 V 12.5 MHz < fMCK ≤ 16.6 MHz 10/fMCK ns
8.3 MHz < fMCK ≤ 12.5 MHz 8/fMCK ns
fMCK ≤ 8.3 MHz 6/fMCK ns
2.7 V ≤ VDD < 4.0 V, 17.5 MHz < fMCK 18/fMCK ns
2.3 V ≤ Vb ≤ 2.7 V 15 MHz < fMCK ≤ 17.5 MHz 16/fMCK ns
12.5 MHz < fMCK ≤ 15 MHz 14/fMCK ns
10 MHz < fMCK ≤ 12.5 MHz 12/fMCK ns
7.5 MHz < fMCK ≤ 10 MHz 10/fMCK ns
5 MHz < fMCK ≤ 7.5 MHz 8/fMCK ns
fMCK ≤ 5 MHz 6/fMCK ns
SCKp high-/low-level tKH2, 4.0 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V fKCY2/2 − ns
width tKL2 20
2.7 V ≤ VDD < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V fKCY2/2 − ns
35
Notes 1. When DAP0n = 0 and CKP0n = 0, or DAP0n = 1 and CKP0n = 1. The SIp setup time becomes “to SCKp↓”
when DAP0n = 0 and CKP0n = 1, or DAP0n = 1 and CKP0n = 0.
2. When DAP0n = 0 and CKP0n = 0, or DAP0n = 1 and CKP0n = 1. The SIp hold time becomes “from
SCKp↓” when DAP0n = 0 and CKP0n = 1, or DAP0n = 1 and CKP0n = 0.
3. When DAP0n = 0 and CKP0n = 0, or DAP0n = 1 and CKP0n = 1. The delay time to SOp output becomes
“from SCKp↑” when DAP0n = 0 and CKP0n = 1, or DAP0n = 1 and CKP0n = 0.
<Slave> Vb
Rb
SCKp SCK
SOp SI
Caution Select the TTL input buffer for SIp and SCKp and the N-ch open drain output (VDD tolerance)
mode for SOp by using the PIMg and POMg registers.
tKCY2
tKL2 tKH2
SCKp
tSIK2 tKSI2
tKSO2
tKCY2
tKH2 tKL2
SCKp
tSIK2 tKSI2
tKSO2
Caution Select the TTL input buffer for SIp and SCKp and the N-ch open drain output (VDD tolerance) mode
for SOp by using the PIMg and POMg registers.
2
(h) Communication at different potential (2.5 V, 3 V) (simplified I C mode)
Caution Select the TTL input buffer and the N-ch open drain output (VDD tolerance) mode for SDA10 and the
N-ch open drain output (VDD tolerance) mode for SCL10 by using the PIM3 and POM3 registers.
2
Simplified I C mode connection diagram (communication at different potential)
Vb Vb
Rb Rb
SDA10 SDA
SCL10 SCL
2
Simplified I C mode serial transfer timing (communication at different potential)
1/fSCL
tLOW tHIGH
SCL10
SDA10
Caution Select the TTL input buffer and the N-ch open drain output (VDD tolerance) mode for SDA10 and the
N-ch open drain output (VDD tolerance) mode for SCL10 by using the PIM3 and POM3 registers.
Remark Rb[Ω]:Communication line (SDA10, SCL10) pull-up resistance, Vb[V]: Communication line voltage
Remark Slew rate: The change with respect to the rise or fall of the output voltage
V/μs: The change in voltage per 1 μs
Operation stabilization wait time: Time required until a state is entered where the DC and AC
specifications of the operational amplifier are satisfied after the operation
of the operational amplifier has been enabled (OAEN = 1)
Comparator characteristics
(TA = −40 to +85°C, 2.7 V ≤ VDD ≤ 5.5 V, 2.7 V ≤ AVREF ≤ VDD, VSS = AVSS = 0 V)
Notes 1. Characteristics of pulse response when CMP0P and CMP1P input or operational amplifier output changes
from the comparator reference voltage −100 mV to the comparator reference voltage +100 mV.
2. Characteristics of pulse response when CMP0P and CMP1P input or operational amplifier output changes
from the comparator reference voltage +100 mV to the comparator reference voltage −100 mV.
5V
Output voltage VO
0V
tCR tCF
+100 mV
Comparator
Input voltage VIN
ref. voltage
-100 mV
Remark Operation stabilization wait time: Time required until a state is entered where the DC and AC
specifications of the comparator are satisfied after the operation of the
comparator has been enabled (CnEN = 1)
stabilization wait time: Time required until the voltage level of the internal reference voltage
circuit reaches 99% of the ideal value after the internal reference voltage
has been enabled (CnREN = 1)
Supply voltage
(VDD)
Detection voltage VPOR (MAX.)
Detection voltage VPOR (TYP.)
Detection voltage VPOR (MIN.)
Detection voltage VPDR (MAX.)
Detection voltage VPDR (TYP.)
Detection voltage VPDR (MIN.)
tPTH
tPW
Time
Note Make sure to raise the power supply in a shorter time than this.
• When RESET pin input is not used • When RESET pin input is used (when external reset is
released by the RESET pin, after POC has been
released)
1.8 V 1.8 V
0V 0V
Time Time
tPUP1
RESET pin
tPUP2
Internal reset
signal
LVI Circuit Characteristics (TA = −40 to +85°C, VPDR ≤ VDD ≤ 5.5 V, VSS = AVSS = 0 V)
Supply voltage
(VDD)
tLW
tLWAIT
LVION ← 1 Time
Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics (TA = −40 to +85°C)
Note The value depends on the POC detection voltage. When the voltage drops, the data is retained until a POC
reset is effected, but data is not retained when a POC reset is effected.
VDD
VDDDR
Note When a product is first written after shipment, “erase → write” and “write only” are both taken as one rewrite.
HD
detail of lead end
D
L1 A3
33 23
c
34 22
θ L
Lp
E HE
(UNIT:mm)
44 12 ITEM DIMENSIONS
1 11 D 10.00±0.20
E 10.00±0.20
ZE HD 12.00±0.20
HE 12.00±0.20
ZD e A 1.60 MAX.
b x M S A1 0.10±0.05
A A2 1.40±0.05
A3 0.25
A2
b 0.35 +0.08
−0.04
c 0.125 +0.075
−0.025
S
L 0.50
Lp 0.60±0.15
y A1 L1 1.00±0.20
S
θ 3° +5°
−3°
e 0.80
x 0.20
NOTE y 0.10
Each lead centerline is located within 0.20 mm of ZD 1.00
its true position at maximum material condition.
ZE 1.00
P44GB-80-GAF
NEC Electronics America, Inc. NEC Electronics (Europe) GmbH NEC Electronics (China) Co., Ltd
2880 Scott Blvd. Arcadiastrasse 10 7th Floor, Quantum Plaza, No. 27 ZhiChunLu Haidian
Santa Clara, CA 95050-2554, U.S.A. 40472 Düsseldorf, Germany District, Beijing 100083, P.R.China
Tel: 408-588-6000 Tel: 0211-65030 Tel: 010-8235-1155
800-366-9782 http://www.eu.necel.com/ http://www.cn.necel.com/
http://www.am.necel.com/
Hanover Office Shanghai Branch
Podbielskistrasse 166 B Room 2509-2510, Bank of China Tower,
30177 Hannover 200 Yincheng Road Central,
Tel: 0 511 33 40 2-0 Pudong New Area, Shanghai, P.R.China P.C:200120
Tel:021-5888-5400
Munich Office http://www.cn.necel.com/
Werner-Eckert-Strasse 9
81829 München Shenzhen Branch
Tel: 0 89 92 10 03-0 Unit 01, 39/F, Excellence Times Square Building,
Stuttgart Office No. 4068 Yi Tian Road, Futian District, Shenzhen,
Industriestrasse 3 P.R.China P.C:518048
70565 Stuttgart Tel:0755-8282-9800
Tel: 0 711 99 01 0-0 http://www.cn.necel.com/
United Kingdom Branch
NEC Electronics Hong Kong Ltd.
Cygnus House, Sunrise Parkway
Unit 1601-1613, 16/F., Tower 2, Grand Century Place,
Linford Wood, Milton Keynes 193 Prince Edward Road West, Mongkok, Kowloon, Hong Kong
MK14 6NP, U.K. Tel: 2886-9318
Tel: 01908-691-133 http://www.hk.necel.com/
Succursale Française
9, rue Paul Dautier, B.P. 52 NEC Electronics Taiwan Ltd.
78142 Velizy-Villacoublay Cédex 7F, No. 363 Fu Shing North Road
France Taipei, Taiwan, R. O. C.
Tel: 01-3067-5800 Tel: 02-8175-9600
http://www.tw.necel.com/
Sucursal en España
Juan Esplandiu, 15
NEC Electronics Singapore Pte. Ltd.
28007 Madrid, Spain
238A Thomson Road,
Tel: 091-504-2787
#12-08 Novena Square,
Tyskland Filial Singapore 307684
Täby Centrum Tel: 6253-8311
Entrance S (7th floor) http://www.sg.necel.com/
18322 Täby, Sweden
Tel: 08 638 72 00 NEC Electronics Korea Ltd.
11F., Samik Lavied’or Bldg., 720-2,
Filiale Italiana
Yeoksam-Dong, Kangnam-Ku,
Via Fabio Filzi, 25/A
Seoul, 135-080, Korea
20124 Milano, Italy
Tel: 02-558-3737
Tel: 02-667541
http://www.kr.necel.com/
Branch The Netherlands
Steijgerweg 6
5616 HS Eindhoven
The Netherlands
Tel: 040 265 40 10
G0706