M34509G4FP
M34509G4FP
On April 1st, 2010, NEC Electronics Corporation merged with Renesas Technology
Corporation, and Renesas Electronics Corporation took over all the business of both
companies. Therefore, although the old company name remains in this document, it is a valid
Renesas Electronics document. We appreciate your understanding.
(Note 1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its majority-
owned subsidiaries.
(Note 2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.
4509 Group REJ03B0147-0103
SINGLE-CHIP 4-BIT CMOS MICROCOMPUTER Rev.1.03
2009.07.27
PIN CONFIGURATION
VDD 1 24 P30/AIN2
VSS 2 23 P31/AIN3
M34509G4HFP
M34509G4H-XXXFP
M34509G4FP
M34509G4-XXXFP
XIN 3 22 P00/SIN
XOUT 4 21 P01/SOUT
CNVSS 5 20 P02/SCK
RESET 6 19 P03
P21/AIN1 7 18 P10
P20/AIN0 8 17 P11/CNTR1
D5 9 16 P12/CNTR0
D4 10 15 P13/INT
D3/AIN5 11 14 D0
12 13 D1
D2/AIN4
4 4 2 2 6
REJ03B0147-0103
Rev.1.03 2009.07.27
I/O port Port P0 Port P1 Port P2 Port P3 Port D
page 2 of 140
Timer
XIN -XOUT
Timer 1 (8 bits)
(Ceramic/RC)
Timer 2 (8 bits) On-chip oscillator
Watchdog timer
(16 bits) Memory
A/D converter 4500 Series ROM
(10 bits ✕ 6 ch) 4096 words ✕ 10 bits
CPU core
Serial I/O ALU (4 bits)
(8 bits ✕ 1) Register A (4 bits) Register B (4 bits)
Register D (3 bits) Register E (8 bits)
Stack register SK (8 levels) RAM
Interrupt stack register SDP (1level)
256 words ✕ 4 bits
PERFORMANCE OVERVIEW
Parameter Function
Number of M34509G4 134
basic instructions M34509G4H 135
Minimum instruction execution time 0.5 µs (at 6 MHz oscillation frequency, in through mode)
Memory sizes ROM 4096 words ✕ 10 bits
RAM 256 words ✕ 4 bits
Input/Output D0–D5 I/O Six independent I/O ports.
ports Input is examined by skip decision.
Ports D 2 and D 3 are equipped with a pull-up function and a key-on wakeup function.
Both functions can be switched by software.
Ports D2 and D3 are also used as AIN4, and AIN5, respectively.
P00–P03 I/O 4-bit I/O port; each pin is equipped with a pull-up function and a key-on wakeup function.
Both functions and output structure can be switched by software.
Ports P00, P01 and P02 are also used as SIN, SOUT and SCK, respectively.
P10–P13 I/O 4-bit I/O port; each pin is equipped with a pull-up function and a key-on wakeup function.
Both functions and output structure can be switched by software.
Ports P11, P12 and P13 are also used as CNTR1, CNTR0 and INT, respectively.
P20, P21 I/O 2-bit I/O port; each pin is equipped with a pull-up function and a key-on wakeup function.
Both functions and output structure can be switched by software.
Ports P20 and P21 are also used as AIN0 and AIN1, respectively.
P30, P31 I/O 2-bit I/O port; The output structure can be switched by software.
Ports P30 and P31 are also used as AIN2 and AIN3, respectively.
CNTR0, Timer I/O Two independent I/O; CNTR1 and CNTR0 pins are also used as ports P1 1 and P12, respectively.
CNTR1
INT Interrupt input 1-bit input; INT pin is also used as port P13.
SIN, SOUT, Serial interface Three independent I/O;
SCK input/output SIN, SOUT, and SCK are also used as ports P00, P01, and P02, respectively.
AIN0–AIN5 Analog input Six independent input; AIN0–AIN5 are also used as P20, P21, P30, P31, D2 and D3, respectively.
Timers Timer 1 8-bit programmable timer/event counter with two reload registers and PWM output function.
Timer 2 8-bit programmable timer/event counter with two reload registers and PWM output function.
Watchdog timer function 16-bit timer (fixed dividing frequency) (for watchdog)
A/D 10-bit wide, This is equipped with an 8-bit comparator function.
converter Analog input 6 channel (AIN0–AIN5 pins)
Serial interface 8-bit ✕ 1
Voltage drop Reset occurrence Typ. 2.6 V (Ta = 25 °C)
detection Reset release Typ. 2.7 V (Ta = 25 °C)
circuit (Note)
Power-on reset circuit (Note) Built-in type
Interrupt Sources 5 (one for external, two for timer, one for A/D, one for Serial interface)
Nesting 1 level
Subroutine nesting 8 levels
Device structure CMOS silicon gate
Package 24-pin plastic molded SSOP (PRSP0024GA-A)
Operating temperature range –20 °C to 85 °C
Supply voltage 1.8 V to 5.5 V (It depends on operation source clock, oscillation frequency and operating mode.)
Power Active mode 2.2 mA (Ta = 25°C, VDD = 5.0 V, f(XIN) = 6.0 MHz, f(STCK) = f(XIN)/1)
dissipation RAM back-up mode 0.1 µA (Ta = 25°C, VDD = 5.0 V, output transistors in the cut-off state)
(typical value)
Note: These circuits are equipped with only the H version.
PIN DESCRIPTION
Pin Name Input/Output Function
VDD Power supply — Connected to a plus power supply.
VSS Ground — Connected to a 0 V power supply.
CNVSS CNVSS — Connect CNVSS to VSS and apply “L” (0V) to CNVSS certainly.
RESET Reset input/output I/O An N-channel open-drain I/O pin for a system reset. When the SRST instruction,
watchdog timer, the voltage drop detection circuit (only for H version) or the built-in
power-on reset (only for H version) causes the system to be reset, the RESET pin out-
puts “L” level.
XIN System clock input Input I/O pins of the main clock generating circuit. When using a ceramic resonator, connect it
between pins XIN and XOUT. A feedback resistor is built-in between them. When using
XOUT System clock output Output the RC oscillation, connect a resistor and a capacitor to XIN, and leave XOUT pin open.
D0–D5 I/O port D I/O Each pin of port D has an independent 1-bit wide I/O function.
Input is examined by The output structure can be switched to N-channel open-drain or CMOS by software.
skip decision. For input use, set the latch of the specified bit to “1” and select the N-channel open-drain.
Ports D2 and D3 are equipped with a pull-up function and a key-on wakeup function.
Both functions can be switched by software.
Ports D2 and D3 are also used as AIN4 and AIN5, respectively.
P00–P03 I/O port P0 I/O Port P0 serves as a 4-bit I/O port.
The output structure can be switched to N-channel open-drain or CMOS by software.
For input use, set the latch of the specified bit to “1” and select the N-channel open-drain.
Port P0 has a key-on wakeup function and a pull-up function. Both functions can be
switched by software.
Ports P00, P01 and P02 are also used as SIN, SOUT and SCK, respectively.
P10–P13 I/O port P1 I/O Port P1 serves as a 4-bit I/O port.
The output structure can be switched to N-channel open-drain or CMOS by software.
For input use, set the latch of the specified bit to “1” and select the N-channel open-drain.
Port P1 has a key-on wakeup function and a pull-up function. Both functions can be
switched by software.
Ports P11, P12 and P13 are also used as CNTR1, CNTR0 and INT, respectively.
P20, P21 I/O port P2 I/O Port P2 serves as a 2-bit I/O port.
The output structure can be switched to N-channel open-drain or CMOS by software.
For input use, set the latch of the specified bit to “1” and select the N-channel open-drain.
Port P2 has a key-on wakeup function and a pull-up function. Both functions can be
switched by software.
Ports P20 and P21 are also used as AIN0 and AIN1, respectively.
P30, P31 I/O port P3 I/O Port P3 serves as a 2-bit I/O port.
The output structure can be switched to N-channel open-drain or CMOS by software.
For input use, set the latch of the specified bit to “1” and select the N-channel open-drain.
Ports P30 and P31 are also used as AIN2 and AIN3, respectively.
CNTR0 Timer input/output I/O CNTR0 pin has the function to input the clock for the timer 2 event counter, and to
output the PWM signal generated by timer 1.
This pin is also used as port P12.
CNTR1 Timer input/output I/O CNTR1 pin has the function to input the clock for the timer 1 event counter, and to
output the PWM signal generated by timer 2.
This pin is also used as port P11.
INT Interrupt input Input INT pin accepts external interrupts. It has the key-on wakeup function which can be
switched by software.
This pin is also used as port P13.
AIN0–AIN5 Analog input Input A/D converter analog input pins.
AIN0–AIN5 are also used as ports P20, P21, P30, P31, D2 and D3, respectively.
SCK Serial interface clock I/O I/O Serial interface data transfer synchronous clock I/O pin. S CK pin is also used as port P02.
SOUT Serial interface data output Output Serial interface data output pin. SOUT pin is also used as port P01.
SIN Serial interface data input Input Serial interface data input pin. SIN pin is also used as port P00.
MULTIFUNCTION
Pin Multifunction Pin Multifunction Pin Multifunction Pin Multifunction
P00 SIN SIN P00 P20 AIN0 AIN0 P20
P01 SOUT SOUT P01 P21 AIN1 AIN1 P21
P02 SCK SCK P02 P30 AIN2 AIN2 P30
P11 CNTR1 CNTR1 P11 P31 AIN3 AIN3 P31
P12 CNTR0 CNTR0 P12 D2 AIN4 AIN4 D2
P13 INT INT P13 D3 AIN5 AIN5 D3
Notes 1: Pins except above have just single function.
2: The input/output of P00 can be used even when SIN is used. Be careful when using inputs of both SIN and P00 since the input threshold value of SIN pin
is different from that of port P00.
3: The input of P01 can be used even when SOUT is used.
4: The input of P02 can be used even when SCK is used. Be careful when using inputs of both SCK and P02 since the input threshold value of SCK pin is
different from that of port P02.
5: The input of P11 can be used even when CNTR1 (output) is selected.
The input/output of P11 can be used even when CNTR1 (input) is selected. Be careful when using inputs of both CNTR1 and P1 1 since the input thresh-
old value of CNTR1 pin is different from that of port P11.
6: The input of P12 can be used even when CNTR0 (output) is selected.
The input/output of P12 can be used even when CNTR0 (input) is selected. Be careful when using inputs of both CNTR0 and P1 2 since the input thresh-
old value of CNTR0 pin is different from that of port P12.
7: The input/output of P13 can be used even when INT is used. Be careful when using inputs of both INT and P13 since the input threshold value of INT
pin is different from that of port P13.
8: The input/output of P20, P21, P30, P31, D2, D3 can be used even when AIN0–AIN5 are used.
PORT FUNCTION
Port Pin Input Output structure I/O Control Control Remark
Output unit instructions registers
Port D D 0 , D1 , D 4, D 5 I/O N-channel open-drain/ 1 SD, RD FR3, C1 Programmable output structure selection
(6) CMOS SZD, CLD function
D2/AIN4 FR3, PU2 Programmable pull-up function
D3/AIN5 K2 Programmable key-on wakeup function
Q1 Programmable output structure selection
function
Port P0 P00/SIN, P01/SOUT, I/O N-channel open-drain/ 4 OP0A FR0, PU0 Programmable pull-up function
P02/SCK, P03 (4) CMOS IAP0 K0 Programmable key-on wakeup function
J1 Programmable output structure selection
function
Port P1 P10, P11/CNTR1, I/O N-channel open-drain/ 4 OP1A FR1, PU1 Programmable pull-up function
P12/CNT0, (4) CMOS IAP1 K1, L1, I1 Programmable key-on wakeup function
P13/INT W1, W2 Programmable output structure selection
W5, W6 function
Port P2 P20/AIN0 I/O N-channel open-drain/ 2 OP2A FR2, PU2 Programmable pull-up function
P21/AIN1 (2) CMOS IAP2 Q1 Programmable key-on wakeup function
K2 Programmable output structure selection
function
Port P3 P30/AIN2 I/O N-channel open-drain/ 2 OP3A C1 Programmable output structure selection
P31/AIN3 (2) CMOS IAP3 Q1 functions
Skip decision
Register Y Decoder
SZD instruction
(Note 3) FR3j
CLD (Note 1)
instruction
S D0, D1 (Note 2)
SD instruction
(Note 1)
RD instruction R Q
(Note 4)
K2k Pull-up transistor
“L” level
Key-on wakeup input PU2k (Note 4)
detection circuit
Skip decision
Register Y Decoder
SZD instruction
Q1
Decoder
Analog input
Skip decision
Register Y Decoder
SZD instruction
(Note 4) C1k
CLD (Note 1)
instruction
S D4, D5 (Notes 2)
SD instruction
(Note 1)
RD instruction R Q
K00
Level
Key-on wakeup input PU00
detection circuit
IAP0 instruction
Register A
A0
FR 0 0 (Note 1)
A0 D P00/SIN (Note 2)
(Note 1)
OP0A instruction T Q
K01
Level
Key-on wakeup input PU01
detection circuit
IAP0 instruction
Register A
A1
FR01 (Note 1)
A1 D
J10 P01/SOUT (Note 2)
OP0A instruction T Q 0
(Note 1)
1
Serial interface data output
K02
Level
Key-on wakeup input PU02
detection circuit
IAP0 instruction
Register A
A2
FR02 (Note 1)
A2 D
P02/SCK (Note 2)
(Note 1)
OP0A instruction T Q
K03
Level
Key-on wakeup input PU03
detection circuit
IAP0 instruction
Register A
A3
FR03 (Note 1)
A3 D P03 (Note 2)
(Note 1)
OP0A instruction T Q
K10
L13 L12
Key-on 0 Level detection circuit 0
wakeup Edge detection circuit PU10
1 1
input
IAP1 instruction
Register A
A0
FR10 (Note 1)
A0 D P10 (Note 2)
(Note 1)
OP1A instruction T Q
K11
L13 L12
Key-on 0 Level detection circuit 0
wakeup Edge detection circuit PU11
1 1
input
IAP1 instruction
Register A
A1
FR11 (Note 1)
A1 D
W63 P11/CNTR1 (Note 2)
OP1A instruction T Q 0 (Note 1)
PWMOD2 1
W60
0
Clock (input) for
timer 1 event count 1 W10
W11
K12
L13 L12
Key-on 0 0
Level detection circuit
wakeup Edge detection circuit PU12
1 1
input
IAP1 instruction
Register A
A2
FR12 (Note 1)
A2 D
W53 P12/CNTR0 (Note 2)
OP1A instruction T Q 0 (Note 1)
PWM1 1
W50
0
Clock (input) for
timer 2 event count 1 W20
W21
K13
L13 L12
Key-on 0 Level detection circuit 0
wakeup Edge detection circuit PU13
1 1
input
IAP1 instruction
Register A
A3
FR13
(Note 1)
A3 D P13/INT (Note 2)
(Note 1)
OP1A instruction T Q
(Notes 3, 4)
External 0 interrupt External 0 interrupt circuit
Key-on wakeup input
Timer 1 count start synchronous circuit input
(Note 3)
K2j
Level
Key-on wakeup input detection circuit (Note 3)
(Note 3)
IAP2 instruction PU2j
Register A
Aj
FR2j (Note 1)
Aj D P20/AIN0, (Note 2)
P21/AIN1
OP2A instruction T Q (Note 1)
Q1
Decoder
Analog input
(Note 3)
IAP3 instruction
Register A
Aj
C1j (Note 1)
Aj D P30/AIN2,(Notes 2)
P31/AIN3
OP3A instruction T Q (Note 1)
Q1
Decoder
Analog input
I12
Falling One-sided edge I11
(Note 1) detection circuit
0 0
P13/INT External 0
EXF0
interrupt
1 1
Both edges
Rising detection circuit Timer 1 count start
I13 SNZI0 instruction synchronization
circuit input
Skip L11
(Note 2)
0
Level detection circuit
L10 Edge detection circuit Key-on wakeup input
1
(Note 3)
Specifying address 8 4 0
Low-order 4bits
PCH PCL
Register A (4)
p6 p5 p4 p3 p2 p1 p0 DR2DR1DR0 A3 A2 A1 A0 Middle-order 4 bits
Register B (4)
High-order 2 bits
Immediate field The contents of The contents of Register D (3)
value p register D register A
* Flag UPTF = 1;
High-order 2 bits of reference data is
transferred to the low-order 2 bits of register D.
“0” is stored to the high-order 1 bit of register D.
Flag UPTF = 0;
Data is not transferred to register D.
Fig. 4 TABP p instruction execution example
(5) Stack registers (SKS) and stack pointer (SP) Program counter (PC)
Stack registers (SKs) are used to temporarily store the contents of
program counter (PC) just before branching until returning to the Executing BM Executing RT
original routine when; instruction instruction
• branching to an interrupt service routine (referred to as an interrupt SK0 (SP) = 0
service routine),
SK1 (SP) = 1
• performing a subroutine call, or
• executing the table reference instruction (TABP p). SK2 (SP) = 2
Stack registers (SKs) are eight identical registers, so that subrou- SK3 (SP) = 3
tines can be nested up to 8 levels. However, one of stack registers is SK4 (SP) = 4
used respectively when using an interrupt service routine and when
SK5 (SP) = 5
executing a table reference instruction. Accordingly, be careful not to
over the stack when performing these operations together. The con-
SK6 (SP) = 6
tents of registers SKs are destroyed when 8 levels are exceeded. SK7 (SP) = 7
The register SK nesting level is pointed automatically by 3-bit stack Stack pointer (SP) points “7” at reset or
pointer (SP). The contents of the stack pointer (SP) can be trans- returning from RAM back-up mode. It points “0”
ferred to register A with the TASP instruction. by executing the first BM instruction, and the
Figure 5 shows the stack registers (SKs) structure. contents of program counter is stored in SK0.
Figure 6 shows the example of operation at subroutine call.
When the BM instruction is executed after eight
stack registers are used ((SP) = 7), (SP) = 0
and the contents of SK0 is destroyed.
(6) Interrupt stack register (SDP)
Interrupt stack register (SDP) is a 1-stage register. When an interrupt Fig. 5 Stack registers (SKs) structure
occurs, this register (SDP) is used to temporarily store the contents
of data pointer, carry flag, skip flag, register A, and register B just be-
(SP) ← 0
fore an interrupt until returning to the original routine.
(SK0) ← 000116
Unlike the stack registers (SKs), this register (SDP) is not used when (PC) ← SUB1
executing the subroutine call instruction and the table reference in-
struction. Main program Subroutine
(PC) ← (SK0)
(SP) ← 7
• Note
Register Z of data pointer is undefined after system is released Fig. 8 Data pointer (DP) structure
from reset.
Also, registers Z, X and Y are undefined in the RAM back-up. After
system is returned from the RAM back-up, set these registers. Specifying bit position
Set
D3 D2 D1 D0
0 0 0 1 1
Register Y (4) Port D output latch
00FF16
• Note
Register Z of data pointer is undefined after system is released
from reset.
Also, registers Z, X and Y are undefined in the RAM back-up. After
system is returned from the RAM back-up, set these registers.
7
8
9
10
11
12
13
14
15
Main
routine Completion of Address C
A/D conversion in page 1
ADF V22
Interrupt
service routine Serial interface Address E
transmit/receive
SIOF V23 INTE
in page 1
completed
Interrupt
occurs Activated Request flag Enable Enable
• condition (state retained) bit flag
•
• Fig. 15 Interrupt system diagram
•
EI
R TI
Interrupt is
enabled
R/W
Interrupt control register V2 at reset : 00002 at RAM back-up : 00002
TAV2/TV2A
0 Interrupt disabled (SNZSI instruction is valid)
V23 Serial interface interrupt enable bit
1 Interrupt enabled (SNZSI instruction is invalid)
0 Interrupt disabled (SNZAD instruction is valid)
V22 A/D interrupt enable bit
1 Interrupt enabled (SNZAD instruction is invalid)
0
V21 Not used This bit has no function, but read/write is enabled.
1
0
V20 Not used This bit has no function, but read/write is enabled.
1
Note: “R” represents read enabled, and “W” represents write enabled.
REJ03B0147-0103
Rev.1.03 2009.07.27
Fig. 16 Interrupt sequence
● When an interrupt request flag is set after its interrupt is enabled
1 machine cycle
T1 T2 T3 T1 T2 T3 T1 T2 T3 T1 T2 T3 T1 T2
page 22 of 140
System clock
EXTERNAL INTERRUPTS
The 4509 Group has the external 0 interrupt. An external interrupt
request occurs when a valid waveform is input to an interrupt input
pin (edge detection).
The external interrupt can be controlled with the interrupt control
register I1.
I12
Falling One-sided edge I11
(Note 1) detection circuit
0 0
P13/INT External 0
EXF0
interrupt
1 1
Both edges
Rising detection circuit Timer 1 count start
I13 SNZI0 instruction synchronization
circuit input
Skip L11
(Note 2)
0
Level detection circuit
L10 Edge detection circuit Key-on wakeup input
1
(Note 3)
• Depending on the input state of the P13/INT pin, the external 0 in- • Depending on the input state of the P13/INT pin, the external 0 in-
terrupt request flag (EXF0) may be set when the bit 3 of register I1 terrupt request flag (EXF0) may be set when the bit 2 of register I1
is changed. In order to avoid the occurrence of an unexpected in- is changed. In order to avoid the occurrence of an unexpected in-
terrupt, clear the bit 0 of register V1 to “0” (refer to Figure 18➀) and terrupt, clear the bit 0 of register V1 to “0” (refer to Figure 20➀) and
then, change the bit 3 of register I1. then, change the bit 2 of register I1 is changed.
In addition, execute the SNZ0 instruction to clear the EXF0 flag to “0” In addition, execute the SNZ0 instruction to clear the EXF0 flag to “0”
after executing at least one instruction (refer to Figure 18➁). after executing at least one instruction (refer to Figure 20➁).
Also, set the NOP instruction for the case when a skip is performed Also, set the NOP instruction for the case when a skip is performed
with the SNZ0 instruction (refer to Figure 18➂). with the SNZ0 instruction (refer to Figure 20➂).
•••
•••
LA 4 ; (✕✕✕02) LA 4 ; (✕✕✕02)
TV1A ; The SNZ0 instruction is valid ........... ➀ TV1A ; The SNZ0 instruction is valid ........... ➀
LA 8 ; (1✕✕✕2) LA 12 ; (1✕✕✕2)
TI1A ; Control of INT pin input is changed TI1A ; Interrupt valid waveform is changed
NOP ........................................................... ➁ NOP ........................................................... ➁
SNZ0 ; The SNZ0 instruction is executed SNZ0 ; The SNZ0 instruction is executed
(EXF0 flag cleared) (EXF0 flag cleared)
NOP ........................................................... ➂ NOP ........................................................... ➂
•••
•••
✕ : these bits are not used here. ✕ : these bits are not used here.
Fig. 18 External 0 interrupt program example-1 Fig. 20 External 0 interrupt program example-3
• When the INT pin input is disabled (register I13 = “0”), set the key-
on wakeup of INT pin to be invalid (register L1 0 = “0”) before
system enters to the RAM back-up mode. (refer to Figure 19➀).
•••
LA 0 ; (✕✕✕02)
TI1A ; INT key-on wakeup disabled ........... ➀
DI
EPOF
POF ; RAM back-up
•••
FF16
n : Counter initial value
Count starts Reload Reload
n
The contents of counter
0016
Time
n+1 count n+1 count
An interrupt occurs or
a skip instruction is executed.
The 4509 Group timer consists of the following circuits. Prescaler and timers 1 and 2 can be controlled with the timer control
• Prescaler : 8-bit programmable timer registers PA, W1, W2 , W5 and W6. The 16-bit timer is a free counter
• Timer 1 : 8-bit programmable timer which is not controlled with the control register.
• Timer 2 : 8-bit programmable timer Each function is described below.
(Timers 1 and 2 have the interrupt function, respectively)
• 16-bit timer
WDF1
WRST instruction R
RESET signal S Q
(Note 4)
WEF
DWDT instruction R D Q Watchdog reset signal
+
WRST instruction (Note 3)
T R RESET signal
P11/CNTR1 W60
0
1
Register B Register A
W11, W10 (T1HAB)
00
PWM2 Reload register R1H (8) (Note 3)
01 W51 Reload control circuit
ORCLK
10 0
Timer 1 (8) T Q PWM1
11
f(RING) 1
(T1R1L)
W12 R W13
Reload register R1L (8)
(Note 1) (T1AB) (T1AB) Timer 1
(T1AB)
INTSNC (TAB1) (TAB1) T1F
S Q
Register B Register A interrupt
I10
Timer 1 underflow signal
W52 R (T1UDF)
T1UDF
P12/CNTR0 W50
0
1
Register B Register A
W21, W20 (T2HAB)
00
T1UDF Reload register R2H (8) (Note 4)
01 W61 Reload control circuit
ORCLK
10 0
Timer 2 (8) T Q PWM2
11
STCK 1
(T2R2L)
W22 R W23
Reload register R2L (8)
(T2AB) (T2AB)
(Note 2) (T2AB) Timer 2
INTSNC (TAB2) (TAB2) T2F
D Q Register B Register A interrupt
W61
T R I13
W53
0 Port P12 output
P12/CNTR0
PWM1
1
W63
0 Port P11 output
P11/CNTR1
PWM2
1
PWMOD2 Notes 1: Timer 1 count start synchronous circuit is synchronized
T1UDF with the valid edge of INT pin selected by bits 1 (I11) and
Q D
2 (I12) of register I1.
W62
2: Timer 2 INT input period count circuit is used to count
W12 R T the valid edge period of INT pin selected by bits 1 (I11)
and 2 (I12) of register I1.
3: When the PWM1 function is valid (W13=“1”), the value is
auto-reloaded alternately from reload register R1L and
T1R1L: This instruction is used to transfer the contents of
R1H every timer 1 underflow.
reload register R1L to timer 1.
When the PWM1 function is invalid (W13=“0”), the value
T2R2L: This instruction is used to transfer the contents of
is auto-reloaded from reload register R1L only.
reload register R2L to timer 2.
4: When the PWM2 function is valid (W23=“1”), the value is
STCK: System clock
auto-reloaded alternately from reload register R2L and
ORCLK: Prescaler output
R2H every timer 2 underflow.
Data is set automatically from each reload When the PWM2 function is invalid (W23=“0”), the value
register when timer underflows is auto-reloaded from reload register R2L only.
(auto-reload function).
R/W
Timer control register W1 at reset : 00002 at RAM back-up : 00002
TAW1/TW1A
0 PWM1 function invalid
W13 PWM1 function control bit
1 PWM1 function valid
0 Stop (state retained)
W12 Timer 1 control bit
1 Operating
W11 W10 Count source
W11
0 0 PWM2 signal
Timer 1 count source selection bits 0 1 Prescaler output (ORCLK)
W10 1 0 CNTR1 input
1 1 On-chip oscillator clock (f(RING))
R/W
Timer control register W2 at reset : 00002 at RAM back-up : 00002
TAW2/TW2A
0 PWM2 function invalid
W23 PWM2 function control bit
1 PWM2 function valid
0 Stop (state retained)
W22 Timer 2 control bit
1 Operating
W21 W20 Count source
W21
0 0 Timer 1 underflow signal (T1UDF)
Timer 2 count source selection bits 0 1 Prescaler output (ORCLK)
W20 1 0 CNTR0 input
1 1 System clock (STCK)
R/W
Timer control register W5 at reset : 00002 at RAM back-up : state retained
TAW5/TW5A
0 P12 (I/O) / CNTR0 (input)
W53 P12/CNTR0 pin function selection bit
1 P12 (input) /CNTR0 (I/O)
Timer 1 count auto-stop circuit 0 Count auto-stop circuit not selected
W52
selection bit (Note 2) 1 Count auto-stop circuit selected
Timer 1 count start synchronous circuit 0 Count start synchronous circuit not selected
W51
selection bit (Note 3) 1 Count start synchronous circuit selected
0 Falling edge
W50 CNTR0 pin input count edge selection bit
1 Rising edge
R/W
Timer control register W6 at reset : 00002 at RAM back-up : state retained
TAW6/TW6A
0 P11 (I/O) / CNTR1 (input)
W63 P11/CNTR1 pin function selection bit
1 P11 (input) /CNTR1 (I/O)
CNTR 1 pin output auto-control circuit 0 Output auto-control circuit not selected
W62
selection bit 1 Output auto-control circuit selected
Timer 2 0 INT pin input period count circuit not selected
W61
INT pin input period count circuit selection bit 1 INT pin input period count circuit selected
0 Falling edge
W60 CNTR1 pin input count edge selection bit
1 Rising edge
Notes 1: “R” represents read enabled, and “W” represents write enabled.
2: This function is valid only when the INT pin/timer 1 control is enabled (I10=“1”) and the timer 1 count start synchronous circuit is selected (W51=“1”).
3: This function is valid only when the INT pin/timer 1 control is enabled (I10=“1”).
(4) Timer 2 (interrupt function) (5) Count start synchronization circuit (timer 1)
Timer 2 is an 8-bit binary down counter with two timer 2 reload regis- Timer 1 has the count start synchronous circuit which synchronizes
ters (R2L, R2H). Data can be set simultaneously in timer 2 and the the input of INT pin, and can start the timer count operation.
reload register R2L with the T2AB instruction. Data can be set in the Timer 1 count start synchronous circuit function can be selected af-
reload register R2H with the T2HAB instruction. The contents of re- ter timer 1 control by INT pin is enabled by setting the bit 0 of
load register R2L set with the T2AB instruction can be set to timer 2 register I1 to “1” and its function is selected by setting the bit 1 of
again with the T2R2L instruction. Data can be read from timer 2 with register W5 to “1”.
the TAB2 instruction. When timer 1 count start synchronous circuit is used, the count start
Stop counting and then execute the T2AB or TAB2 instruction to read synchronous circuit is set, the count source is input to timer by input-
or set timer 2 data. ting valid waveform to INT pin.
When executing the T2HAB instruction to set data to reload register The valid waveform of INT pin to set the count start synchronous cir-
R2H while timer 2 is operating, avoid a timing when timer 2 cuit is the same as the external interrupt activated condition.
underflows. Once set, the count start synchronous circuit is cleared by clearing
Timer 2 starts counting after the following process; the bit I10 to “0” or system reset.
➀ set data in timer 2 However, when the count auto-stop circuit is selected (W22 = “1”),
➁ set count source by bits 0 and 1 of register W2, and the count start synchronous circuit is cleared (auto-stop) at the timer
➂ set the bit 2 of register W2 to “1.” 1 underflow.
When a value set in reload register R2L is n and a value set in re- (6) Count auto-stop circuit (timer 1)
load register R2H is m, timer 2 divides the count source signal by n + Timer 1 has the count auto-stop circuit which is used to stop timer 1
1 or m + 1 (n = 0 to 255, m = 0 to 255). automatically by the timer 1 underflow when the count start synchro-
nous circuit is used.
Once count is started, when timer 2 underflows (the next count pulse The count auto-stop circuit is valid by setting the bit 2 of register W5
is input after the contents of timer 2 becomes “0”), the timer 2 inter- to “1”. It is cleared by the timer 1 underflow and the count source to
rupt request flag (T2F) is set to “1,” new data is loaded from reload timer 1 is stopped.
register R2L, and count continues (auto-reload function). This function is valid only when the timer 1 count start synchronous
circuit is selected.
<Bit 3 of register W2 = “0” (PWM2 function invalid)>
Once count is started, when timer 2 underflows (the next count pulse (7) INT pin input period count circuit (timer 2)
is input after the contents of timer 2 becomes “0”), the timer 2 inter- Timer 2 has the INT pin input period count circuit to count the valid
rupt request flag (T2F) is set to “1,” new data is loaded from reload waveform input interval of the INT pin.
register R2L, and count continues (auto-reload function). When bit 1 of register W6 is set to “1”, the INT pin input period count
<Bit 3 of register W2 = “1” (PWM2 function valid)> circuit of timer 2 becomes valid, and the count source is input. The
Timer 2 generates the PWM2 signal of the “L” interval set as reload count source input is stopped by the next input of valid waveform to
register R2L, and the “H” interval set as reload register R2H. The the INT pin.
PWM2 signal generated by timer 2 is output from CNTR1 pin by set- Then, every a valid waveform is input to the INT pin, start/stop of the
ting “1” to bit 3 of register W6. count source input is alternately repeated.
PWM2 output to CNTR1 pin combined with timer 1 can be controlled A valid waveform of the INT pin input is the same as the activated
by setting the bit 2 of register W6 to “1.” condition of an external interrupt.
Input period of INT pin by timer 2 can be counted by setting the bit 1 The INT pin input period count circuit set once is cleared by setting
of register W6 to “1.” the INT pin input to be disabled state. The INT pin input can be dis-
abled by clearing bit 3 of register I1 to “0”.
(10) PWM2 output function (P11/CNTR1, timer - Reading the count value
1, timer 2) Stop timer 1 or 2 counting and then execute the TAB1 or TAB2 in-
When bit 3 of register W2 is set to “1”, the data is reloaded alter- struction to read its data.
nately from reload register R2L and R2H every timer 2 underflow.
Timer 2 generates the PWM2 signal of the “L” interval set as reload - Writing to the timer
register R2L, and the “H” interval set as reload register R2H. Stop timer 1 or 2 counting and then execute the T1AB, T1R1L,
In this time, the PWM2 signal generated by timer 2 is output from T2AB or T2R2L instruction to write data to timer.
CNTR1 pin by setting “1” to bit 3 of register W6.
When bit 2 of register W6 is set to “1”, the PWM2 signal output to - Writing to reload register
CNTR1 pin is switched to valid/invalid alternately each timer 1 un- In order to write a data to the reload register R1H while the timer 1
derflow. However, when timer 1 is stopped (bit 2 of register W1 is is operating, execute the T1HAB instruction except a timing of the
cleared to “0”), this function is canceled. timer 1 underflow.
When the TW2A instruction is executed while the PWM2 signal is In order to write a data to the reload register R2H while the timer 2
“H”, the contents of register W2 is changed after the “H” interval of is operating, execute the T2HAB instruction except a timing of the
the PWM2 signal is ended. timer 2 underflow.
(11) Timer interrupt request flags (T1F, T2F) - PWM signal (PWM1, PWM2)
Each timer interrupt request flag is set to “1” when each timer If the timer 1 count stop timing and the timer 1 underflow timing
underflows. The state of these flags can be examined with the skip overlap during output of the PWM1 signal, a hazard may occur in
instructions (SNZT1, SNZT2). the PWM1 output waveform.
Use the interrupt control register V1, V2 to select an interrupt or a If the timer 2 count stop timing and the timer 2 underflow timing
skip instruction. overlap during output of the PWM2 signal, a hazard may occur in
An interrupt request flag is cleared to “0” when an interrupt occurs or the PWM2 output waveform.
when the next instruction is skipped with a skip instruction.
- Prescaler, timer 1 and timer 2 count start timing and count time
when operation starts
Count starts from the first rising edge of the count source (2) after
prescaler and timer operations start (1).
Time to first underflow (3) is shorter (for up to 1 period of the count
source) than time among next underflow (4) by the timing to start
the timer and count source operations after count starts.
When selecting CNTR input as the count source of timer, timer
operates synchronizing with the count edge (falling edge or rising
edge) of CNTR input selected by software.
Count source
➁
Count source
(When falling edge of
CNTR input is selected)
Timer value 3 2 1 0 3 2 1 0 3 2
➂ ➃
→
➀ Timer start
Fig. 24 Timer count start timing and count time when operation starts
Timer 1 count value 0316 0216 0116 0016 0316 0216 0116 0016 0316 0216 0116 0016 0316 0216 0116 0016 0316 0216 0116 0016
→
→
→
(Reload register) (R1L)
(R1L) (R1L) (R1L) (R1L)
Timer 1 underflow signal
PWM1 signal
→
Timer 1 count value 0316 0216 0116 0016 0216 0116 0016 0316 0216 0116 0016 0216 0116 0016 0316 0216 0116 0016 0216 0116
→
→
→
→
→
(Reload register) (R1L)
(R1H) (R1L) (R1H) (R1L) (R1H)
Timer 1 underflow signal
* : “0316” is set to reload register R1L and “0216” is set to reload register R1H.
● CNTR1 output auto-control circuit operation example 1 (W23 = “1”, W63 = “1”, W62 = “1”)
PWM2 signal
→
Timer 1 start
CNTR1 output
→
CNTR1 output start
* When the CNTR1 output auto-control circuit is selected, valid/invalid of CNTR1 output is repeated every timer 1 underflows.
● CNTR1 output auto-control circuit operation example 2 (W23 = “1”, W63 = “1”)
PWM2 signal
→
Timer 1 start Timer 1 stop
➀ ➁
Register W62
➂
CNTR1 output
→
→
➀ When the CNTR1 output auto-control function is not selected while the CNTR output is invalid, CNTR1 output invalid state is retained.
➁ When the CNTR1 output auto-control function is not selected while the CNTR output is valid, CNTR1 output valid state is retained.
➂ When the timer 1 is stopped, the CNTR1 output auto-control function becomes invalid.
● Timer 2 count start timing (R2L = “0216”, R2H = ”0216”, W23 = “1”)
Machine cycle Mi Mi + 1 Mi + 2 Mi + 3
TW2A instruction execution (W22←“1”)
Timer 2 count source
(System clock (STCK))
Register W22
→
(R2L) (R2H) (R2L)
Timer 2 undeflow signal
PWM2 signal
● Timer 2 count stop timing (R2L = “0216”, R2H = ”0216”, W23 = “1”)
Machine cycle Mi Mi + 1 Mi + 2 Mi + 3
TW2A instruction execution (W22←“0”)
Timer 2 count source
(System clock (STCK))
Register W22
Notes 1: If the timer count stop timing and the timer underflow timing overlap while the PWM function is valid (W13=“1” or W23=“1”),
a hazard may occur in the PWM signal waveform.
2: When timer count is stopped during “H” duration of the PWM signal, timer is stopped after the end of the “H” output duration.
WATCHDOG TIMER
Watchdog timer provides a method to reset the system when a pro- When the WEF flag is set to “1” after system is released from reset,
gram run-away occurs. Watchdog timer consists of timer the watchdog timer function is valid.
WDT(16-bit binary counter), watchdog timer enable flag (WEF), When the DWDT instruction and the WRST instruction are ex-
and watchdog timer flags (WDF1, WDF2). ecuted continuously, the WEF flag is cleared to “0” and the
The timer WDT downcounts the instruction clocks as the count watchdog timer function is invalid.
source from “FFFF16” after system is released from reset. The WEF flag is set to "1" at system reset or RAM back-up mode.
After the count is started, when the timer WDT underflow occurs The WRST instruction has the skip function. When the WRST in-
(after the count value of timer WDT reaches “FFFF16,” the next struction is executed while the WDF1 flag is “1”, the WDF1 flag is
count pulse is input), the WDF1 flag is set to “1.” cleared to “0” and the next instruction is skipped.
If the WRST instruction is never executed until the timer WDT un- When the WRST instruction is executed while the WDF1 flag is “0”,
derflow occurs (until timer WDT counts 65534), WDF2 flag is set to the next instruction is not skipped.
“1,” and the RESET pin outputs “L” level to reset the microcom- The skip function of the WRST instruction can be used even when
puter. the watchdog timer function is invalid.
Execute the WRST instruction at each period of 65534 machine
cycle or less by software when using watchdog timer to keep the
microcomputer operating normally.
FFFF16
Value of 16-bit timer (WDT)
000016
➁ ➁
WDF1 flag
65534 count
(Note)
➃
WDF2 flag
➀ After system is released from reset (= after program is started), timer WDT starts count down.
➁ When timer WDT underflow occurs, WDF1 flag is set to “1.”
➂ When the WRST instruction is executed while the WDF1 flag is “1”, WDF1 flag is cleared to “0,”
the next instruction is skipped.
➃ When timer WDT underflow occurs while WDF1 flag is “1,” WDF2 flag is set to “1” and the
watchdog reset signal is output.
➄ The output transistor of RESET pin is turned “ON” by the watchdog reset signal and system reset is
executed.
Note: The number of count is equal to the number of machine cycle because the count source of watchdog timer
is the instruction clock.
When the watchdog timer is used, clear the WDF1 flag at the period
•••
of 65534 machine cycles or less with the WRST instruction.
When the watchdog timer is not used, execute the DWDT instruction WRST ; WDF1 flag cleared
and the WRST instruction continuously (refer to Figure 29).
•••
The watchdog timer is not stopped with only the DWDT instruction.
The contents of WDF1 flag and timer WDT are initialized at the RAM DI
back-up mode. DWDT ; Watchdog timer function enabled/disabled
When using the watchdog timer and the RAM back-up mode, initial- WRST ; WEF and WDF1 flags cleared
•••
ize the WDF1 flag with the WRST instruction just before the
microcomputer enters the RAM back-up state (refer to Figure 30)
Also, set the NOP instruction after the WRST instruction, for the Fig. 29 Program example to start/stop watchdog timer
case when a skip is performed with the WRST instruction.
•••
WRST ; WDF1 flag cleared
NOP
DI ; Interrupt disabled
EPOF ; POF instruction enabled
POF ; RAM back-up mode
↓
Oscillation stop
•••
Fig. 30 Program example to enter the RAM back-up mode
when using the watchdog timer
Register B (4)
Register A (4)
4 4
4 4
TAQ1
TQ1A
2 8 8
Q13 Q12 Q11 Q10 TALA TABAD TADAB
Instruction clock
1/6
2
Q13
0
A/D control circuit ADF A/D
6-channel multi-plexed analog switch
1 (1) interrupt
P20/AIN0
1
Comparator Successive comparison
P21/AIN1 0
register (AD) (10) Q13
Q13
P30/AIN2
10 10 8
0 1 1
P31/AIN3 DAC 0 1
operation Q13
D2/AIN4 signal
D3/AIN5 8
DA converter 8 8
(Note 1) VDD
VSS
Comparator register (8)
(Note 2)
Notes 1: This switch is turned ON only when A/D converter is operating and generates the comparison voltage.
2: Writing/reading data to the comparator register is possible only in the comparator mode (Q13=1).
The value of the comparator register is retained even when the mode is switched to the A/D conversion
mode (Q13=0) because it is separated from the successive comparison register (AD). Also, the resolution
in the comparator mode is 8 bits because the comparator register consists of 8 bits.
V DD
Vref = ✕n
1024
±
completes ✼1 ✼2 ✼3 ----- ✼8 ✼9 ✼A 2 1024
-------------
ADST instruction
62 machine cycles
A/D conversion
completion flag (ADF)
ADST instruction
8 machine cycles
Comparison result
store flag(ADF)
(14) Definition of A/D converter accuracy Vn: Analog input voltage when the output data changes from “n” to
The A/D conversion accuracy is defined below (refer to Figure 35). “n+1” (n = 0 to 1022)
• Absolute accuracy
This means a deviation from the ideal characteristics between 0
to VDD of actual A/D conversion characteristics.
Output data
Full-scale transition voltage (VFST)
1023
1022
Differential non-linearity error = b–a [LSB]
a
Linearity error = c [LSB]
a b
a
n+1
n
Actual A/D conversion
characteristics
c
a: 1LSB by relative accuracy
b: Vn+1–Vn
c: Difference between ideal Vn
and actual Vn
0
V0 V1 Vn Vn+1 V1022 VDD
Zero transition voltage (V0T) Analog voltage
J13J12
1/8 00
01
1/4 Synchronous Serial
circuit Serial interface counter (3) SIOF
INSTCK 1/2 10 interface
11 interrupt
SCK
P02/SCK Q S SST
instruction
R Internal reset signal
SOUT
P01/SOUT
SIN
P00/SIN MSB Serial interface register (8) LSB
Serial interface register (SI) SOUT pin SIN pin Serial interface register (SI)
D7 D6 D5 D4 D3 D2 D1 D0
* ** * * ** *
(1) Serial interface register SI (3) Serial interface start instruction (SST)
Serial interface register SI is the 8-bit data transfer serial/parallel When the SST instruction is executed, the SIOF flag is cleared to
conversion register. Data can be set to register SI through registers “0” and then serial interface transmission/reception is started.
A and B with the TSIAB instruction. The contents of register A is
transmitted to the low-order 4 bits of register SI, and the contents (4) Serial interface control register J1
of register B is transmitted to the high-order 4 bits of register SI. Register J1 controls the synchronous clock, P0 2/S CK, P01/SOUT
During transmission, each bit data is transmitted LSB first from the and P00/SIN pin function. Set the contents of this register through
lowermost bit (bit 0) of register SI, and during reception, each bit register A with the TJ1A instruction. The TAJ1 instruction can be
data is received LSB first to register SI starting from the topmost bit used to transfer the contents of register J1 to register A.
(bit 7).
When register SI is used as a work register without using serial in-
terface, do not select the SCK pin.
(5) How to use serial interface up the wiring between each pin with a resistor. Figure 38 shows the
Figure 38 shows the serial interface connection example. Serial in- data transfer timing and Table 16 shows the data transfer sequence.
terface interrupt is not used in this example. In the actual wiring, pull
SRDY signal
D3 D3
SCK SCK
SOUT SIN
SIN SOUT
Master
SOUT M7’ M0 M1 M2 M3 M4 M5 M6 M7
SIN S7’ S0 S1 S2 S3 S4 S5 S6 S7
SST instruction
SCK
Slave
SST instruction
SRDY signal
SOUT S7’ S0 S1 S2 S3 S4 S5 S6 S7
SIN M7’ M0 M1 M2 M3 M4 M5 M6 M7
1-byte data is serially transferred on this process. Subsequently, data SIOF flag is set to “1” when the clock is counted 8 times after ex-
can be transferred continuously by repeating the process from *. ecuting the SST instruction. Be sure to set the initial level of the
When an external clock is selected as a synchronous clock, control external clock to “H.”
the clock externally because serial transfer is performed as long as
clock is externally input. (Unlike an internal clock, an external clock
is not stopped when serial transfer is completed.) However, the
Pull-up transistor
Reset input
=
0.85VDD
Program starts
RESET (address 0 in page 0)
0.3VDD
(Note 1)
f(RING)
Q S SVDE instruction
VDD
+
VRST (reset release voltage)
VRST -(reset occurrence voltage)
Note: Detection voltage hysteresis of voltage drop detection circuit is 0.1 V (Typ).
RAM BACK-UP MODE Table 19 Functions and states retained at RAM back-up
The 4509 Group has the RAM back-up mode. Function RAM back-up
When the POF instruction is executed continuously after the EPOF
Program counter (PC), registers A, B,
instruction, system enters the RAM back-up state. ✕
carry flag (CY), stack pointer (SP) (Note 2)
The POF instruction is equal to the NOP instruction when the EPOF
Contents of RAM O
instruction is not executed before the POF instruction.
Interrupt control registers V1, V2 ✕
As oscillation stops retaining RAM, the function of reset circuit and
Interrupt control register I1 O
states at RAM back-up mode, current dissipation can be reduced
Selected oscillation circuit (execution of CRCK) O
without losing the contents of RAM.
Table 19 shows the function and states retained at RAM back-up.
Clock control register MR ✕
Figure 46 shows the state transition. Clock control register RG ✕
Timer 1, Timer 2 function (Note 3)
(1) Identification of the start condition Watchdog timer function ✕ (Note 4)
Warm start (return from the RAM back-up state) or cold start (return Timer control register PA ✕
from the normal reset state) can be identified by examining the state Timer control registers W1, W2 ✕
of the power down flag (P) with the SNZP instruction. Timer control registers W5, W6 O
Serial interface function ✕
(2) Warm start condition Serial interface control register J1 O
When the external wakeup signal is input after the system enters the A/D conversion function ✕
RAM back-up state by executing the EPOF instruction and POF in- A/D control register Q1 O
struction continuously, the CPU starts executing the program from Voltage drop detection circuit (Note 5)
address 0 in page 0. In this case, the P flag is “1.”
Port level O
Key-on wakeup control registers K0 to K2, L1 O
(3) Cold start condition
Pull-up control registers PU0 to PU2 O
The CPU starts executing the program from address 0 in page 0
Port output structure control registers FR0 to FR3, C1 O
when;
External interrupt request flag (EXF0) ✕
• “L” level is applied to RESET pin,
• system reset (SRST) is performed, Timer interrupt request flags (T1F, T2F) (Note 3)
• reset by watchdog timer is performed, A/D conversion completion flag (ADF) ✕
• reset by the built-in power-on reset circuit is performed (only for H Serial interface transmit/receive completion flag ✕
(SIOF)
version), or
Interrupt enable flag (INTE) ✕
• reset by the voltage drop detection circuit is performed (only for H
version). Watchdog timer flags (WDF1, WDF2) ✕ (Note 4)
In this case, the P flag is “0.” Watchdog timer enable flag (WEF) ✕ (Note 4)
Notes 1:“O” represents that the function can be retained, and “✕” represents
that the function is initialized.
Registers and flags other than the above are undefined at RAM
back-up, and set an initial value after returning.
2: The stack pointer (SP) points the level of the stack register and is
initialized to “7” at RAM back-up.
3: The state of the timer is undefined.
4: Initialize the watchdog timer flag WDF1 with the WRST instruction,
and then set the system to be in the RAM back-up mode.
5: The voltage drop detection circuit is equipped with only H version.
In the RAM back-up mode, when the SVDE instruction is not ex-
ecuted, the voltage drop detection circuit is invalid, and when the
SVDE instruction is executed, the voltage drop detection circuit is
valid.
P o r t P 1 0 – P 1 3 Return by an external “H” level or The key-on wakeup function can be selected by one port unit. Select the
“L” level input, or falling edge return level (“L” level or “H” level) and return condition (level or edge) with
(“H”→“L”) or rising edge (“L”→“H”). the register L1 according to the external state before going into the RAM
back-up state.
Before going into the RAM backup state, set an opposite level of the
selected return level (edge) to the port using the key-on wakeup function.
INT pin Return by an external “H” level or The key-on wakeup function can be selected by one port unit. Select the
“L” level input, or falling edge return level (“L” level or “H” level) with the register I1 and return condition
(“H”→“L”) or rising edge (“L”→“H”). (level or edge) with the register L1 according to the external state before
When the return level is input, the going into the RAM back-up state.
EXF0 flag is not set.
Internal mode
D
A Operating state
POF instruction execution
Operating state (Note 5) RAM back-up
(Note 1) Operation source clock:
Reset
f(RING)
(MR0)←1 (MR0)←0
(Note 3) (Note 2)
Notes 1: Microcomputer starts its operation after counting f(RING) 120 to 144 times from system is released from reset.
2: When changing the operation source clock from f(RING) to f(XIN), first make the setting to enable f(XIN) oscillation (set MR1 to “0”),
allow the oscillation stabilization time to elapse using software, and then set the operation source clock to f(XIN) (set MR0 to “0”).
After this, stop f(RING) (set RG0 to “1”). (Do not start f(XIN) oscillation and change the operation source clock at the same time.)
3: When changing the operation source clock from f(XIN) to f(RING), first make the setting to enable f(RING) oscillation (set RG0 to “0”),
allow the oscillation stabilization time to elapse using software, and then set the operation source clock to f(RING) (set MR0 to “1”).
After this, stop f(XIN) (set MR1 to “1”). (Do not change the operation source clock and stop f(XIN) at the same time.)
4: After system is released from reset, the ceramic oscillation circuit is selected for the main clock f(XIN).
When the RC oscillation circuit is used, execute the CRCK instruction.
5: Continuous execution of the EPOF instruction and the POF instruction is required to go into the RAM back-up state.
6: Microcomputer starts its operation after counting f(RING) 120 to 144 times.
System returns to state A certainly when returning from the RAM back-up mode. The operation mode (system clock frequency divided)
also returns to the initial state (internal frequency divided by 8 mode) (registers RG and MR initialized).
However, the selected contents (CRCK instruction execution state) of f(XIN) oscillation circuit is retained.
Fig. 47 Set source and clear source of the P flag Fig. 48 Start condition identified example using the SNZP in-
struction
R/W
Key-on wakeup control register K1 at reset : 00002 at RAM back-up : state retained
TAK1/TK1A
Port P13 key-on wakeup 0 Key-on wakeup not used
K13
control bit 1 Key-on wakeup used
Port P12 key-on wakeup 0 Key-on wakeup not used
K12
control bit 1 Key-on wakeup used
Port P11 key-on wakeup 0 Key-on wakeup not used
K11
control bit 1 Key-on wakeup used
Port P10 key-on wakeup 0 Key-on wakeup not used
K10
control bit 1 Key-on wakeup used
R/W
Key-on wakeup control register K2 at reset : 00002 at RAM back-up : state retained
TAK2/TK2A
Port D3 key-on wakeup 0 Key-on wakeup not used
K23
control bit 1 Key-on wakeup used
Port D2 key-on wakeup 0 Key-on wakeup not used
K22
control bit 1 Key-on wakeup used
Port P21 key-on wakeup 0 Key-on wakeup not used
K21
control bit 1 Key-on wakeup used
Port P20 key-on wakeup 0 Key-on wakeup not used
K20
control bit 1 Key-on wakeup used
R/W
Key-on wakeup control register L1 at reset : 00002 at RAM back-up : state retained
TAL1/TL1A
Ports P10–P13 return condition selection 0 Return by level
L13
bit 1 Return by edge
Ports P10–P13 valid waveform/ 0 Falling waveform/“L” level
L12
level selection bit 1 Rising waveform/“H” level
INT pin 0 Return by level
L11
return condition selection bit 1 Return by edge
INT pin 0 Key-on wakeup not used
L10
key-on wakeup control bit 1 Key-on wakeup used
Notes 1: “R” represents read enabled, and “W” represents write enabled.
R/W
Pull-up control register PU1 at reset : 00002 at RAM back-up : state retained
TAPU1/TPU1A
Port P13 pull-up transistor 0 Pull-up transistor OFF
PU13
control bit 1 Pull-up transistor ON
Port P12 pull-up transistor 0 Pull-up transistor OFF
PU12
control bit 1 Pull-up transistor ON
Port P11 pull-up transistor 0 Pull-up transistor OFF
PU11
control bit 1 Pull-up transistor ON
Port P10 pull-up transistor 0 Pull-up transistor OFF
PU10
control bit 1 Pull-up transistor ON
R/W
Pull-up control register PU2 at reset : 00002 at RAM back-up : state retained
TAPU2/TPU2A
Port D3 pull-up transistor 0 Pull-up transistor OFF
PU23
control bit 1 Pull-up transistor ON
Port D2 pull-up transistor 0 Pull-up transistor OFF
PU22
control bit 1 Pull-up transistor ON
Port P21 pull-up transistor 0 Pull-up transistor OFF
PU21
control bit 1 Pull-up transistor ON
Port P20 pull-up transistor 0 Pull-up transistor OFF
PU20
control bit 1 Pull-up transistor ON
Notes 1: “R” represents read enabled, and “W” represents write enabled.
CLOCK CONTROL The system clock and the instruction clock are generated as the
The clock control circuit consists of the following circuits. source clock for operation by these circuits.
• On-chip oscillator (internal oscillator) Figure 49 shows the structure of the clock control circuit.
• Ceramic oscillation circuit The 4509 Group operates by the on-chip oscillator clock (f(RING))
• RC oscillation circuit which is the internal oscillator after system is released from reset.
• Multi-plexer (clock selection circuit) Also, the ceramic resonator or the RC oscillation can be used for the
• Frequency divider source oscillation (f(XIN)) of the 4509 Group.
• Internal clock generating circuit
f(XIN) 0
RG0
Q S CRCK instruction
Q S
Key-on wakeup signal
R EPOF instruction + POF instruction
W
Clock control register RG at reset : 02 at RAM back-up : 02
TRGA
On-chip oscillator (f(RING)) control bit 0 On-chip oscillator (f(RING)) oscillation enabled
RG0
(Note 4) 1 On-chip oscillator (f(RING)) oscillation stop
Notes 1: “R” represents read enabled, and “W” represents write enabled.
2: Main clock cannot be stopped when the main clock is selected for the operation source clock.
3: The stopped clock cannot be selected for the operation source clock. In order to switch the operation source clock, generate the oscillation stabiliz-
ing wait time by software first and set the oscillation of the destination clock to be enabled.
4: On-chip oscillator cannot be stopped when the on-chip oscillator is selected for the operation source clock.
5: When changing the setting of MR1 and MR0 from “00” to “11”, make settings in the sequence “00” → “01” → “11”.
When changing the setting of MR1 and MR0 from “11” to “0”, make settings in the sequence “11” → “01” → “00”.
M34509G4HFP
M34509G4H-XXXFP
M34509G4FP
M34509G4-XXXFP
XIN 3 22 P00/SIN
(Note 1)
XOUT 4 21 P01/SOUT
VPP CNVSS (Note 2) 5 20 P02/SCK
D2/AIN4 12 13 D1
Note 1: Either connect an oscillation circuit or connect XIN pin to VSS and leave the XOUT
pin open.
2: VPP input is possible with VSS connected via a resistor of about 5 kΩ.
: QzROM pin
4509 Group
T_VDD VDD
T_VPP CNVSS
1 kΩ
T_T XD
T_RXD P20/AIN0 (SDA)
T_BUSY N.C.
T_PGM/OE/MD D3/AIN5 (PGM)
RESET circuit
T_RESET RESET
GND Vss
XIN XOUT
Note: For the programming circuit, the wiring capacity of each signal pin must not exceed 47 pF.
Fig. 56 When using programmer of Suisei Electronics System Co., LTD, connection example
• Depending on the input state of the P13/INT pin, the external 0 in- • Depending on the input state of the P13/INT pin, the external 0 in-
terrupt request flag (EXF0) may be set when the bit 3 of register terrupt request flag (EXF0) may be set when the bit 2 of register
I1 is changed. In order to avoid the occurrence of an unexpected I1 is changed. In order to avoid the occurrence of an unexpected
interrupt, clear the bit 0 of register V1 to “0” (refer to Figure 57➀) interrupt, clear the bit 0 of register V1 to “0” (refer to Figure 59➀)
and then, change the bit 3 of register I1. and then, change the bit 2 of register I1.
In addition, execute the SNZ0 instruction to clear the EXF0 flag to In addition, execute the SNZ0 instruction to clear the EXF0 flag to
“0” after executing at least one instruction (refer to Figure 57➁). “0” after executing at least one instruction (refer to Figure 59➁).
Also, set the NOP instruction for the case when a skip is per- Also, set the NOP instruction for the case when a skip is per-
formed with the SNZ0 instruction (refer to Figure 57➂). formed with the SNZ0 instruction (refer to Figure 59➂).
•••
•••
LA 4 ; (✕✕✕02)
TV1A ; The SNZ0 instruction is valid ........... ➀ LA 4 ; (✕✕✕02)
LA 8 ; (1✕✕✕2) TV1A ; The SNZ0 instruction is valid ........... ➀
TI1A ; Control of INT pin input is changed LA 12 ; (1✕✕✕2)
NOP ........................................................... ➁ TI1A ; Interrupt valid waveform is changed
SNZ0 ; The SNZ0 instruction is executed NOP ........................................................... ➁
(EXF0 flag cleared) SNZ0 ; The SNZ0 instruction is executed
NOP ........................................................... ➂ (EXF0 flag cleared)
........................................................... ➂
•••
NOP
✕ : these bits are not used here.
•••
• When the INT pin input is disabled (register I13 = “0”), set the key-
on wakeup of INT pin to be invalid (register L10 = “0”) before
system enters to the RAM back-up mode. (refer to Figure 58➀).
•••
LA 0 ; (✕✕✕02)
TI1A ; INT key-on wakeup disabled ........... ➀
DI
EPOF
POF2 ; RAM back-up
•••
Count source
➁
Also, when considering the oscillation stabilize wait time for switch-
ing clock, be careful that the variable frequency of the on-chip
oscillator clock.
Count source
(When falling edge of 21
External clock
CNTR input is selected)
Timer value 3 2 1 0 3 2 1 0 3 2 When the external clock is used for the main clock (f(XIN)), con-
nect the XIN pin to the clock source and leave XOUT pin open. Do
Timer underflow signal not execute the CRCK instruction in program.
Be careful that the maximum value of the oscillation frequency
➂ ➃ when using the external clock differs from the value when using
→
23
22
Notes for the use of A/D conversion 1 Notes for the use of A/D conversion 2
• TALA instruction Each analog input pin is equipped with a capacitor which is used to
When the TALA instruction is executed, the low-order 2 bits of reg- compare the analog voltage. Accordingly, when the analog voltage
ister AD is transferred to the high-order 2 bits of register A, is input from the circuit with high-impedance and, charge/dis-
simultaneously, the low-order 2 bits of register A is “0.” charge noise is generated and the sufficient A/D accuracy may not
• Do not change the operating mode (both A/D conversion mode and be obtained. Therefore, reduce the impedance or, connect a ca-
comparator mode) of A/D converter with the bit 3 of register Q1 pacitor (0.01 µF to 1 µF) to analog input pins (Figure 60).
while the A/D converter is operating. When the overvoltage applied to the A/D conversion circuit may
• Clear the bit 2 of register V2 to “0” to change the operating mode occur, connect an external circuit in order to keep the voltage
from the comparator mode to A/D conversion mode. within the rated range as shown the Figure 61. In addition, test the
• The A/D conversion completion flag (ADF) may be set when the application products sufficiently.
operating mode of the A/D converter is changed from the compara-
tor mode to the A/D conversion mode. Accordingly, set a value to
the bit 3 of register Q1, and execute the SNZAD instruction to clear
the ADF flag.
Sensor AIN
•••
LA 8 ; (✕0✕✕2)
TV2A ; The SNZAD instruction is valid ........ ➀
LA 0 ; (0✕✕✕2) Apply the voltage withiin the specifications
TQ1A ; Operation mode of A/D converter is to an analog input pin.
changed from comparator mode to A/D
conversion mode. Fig. 62 Analog input external circuit example-1
SNZAD
NOP
•••
24
QzROM
(1) Be careful not to apply overvoltage to MCU. The contents of
QzROM may be overwritten because of overvoltage. Take care
especially at turning on the power.
(2) As for the product shipped in blank, Renesas does not perform
the writing test to user ROM area after the assembly process
though the QzROM writing test is performed enough before the
assembly process. Therefore, a writing error of approx.0.1 %
may occur. Moreover, please note the contact of cables and for-
eign bodies on a socket, etc. because a writing environment may
cause some writing errors.
XIN XIN
XOUT XOUT
Noise VSS VSS
N.G. O.K.
Reset
circuit RESET
Fig. 65 Wiring for clock I/O pins
About 5kΩ
VSS
(Note) The shortest
2. Connection of bypass capacitor across VSS line and VDD line 3. Wiring to analog input pins
Connect an approximately 0.1 µF bypass capacitor across the VSS • Connect an approximately 100 Ω to 1 kΩ resistor to an analog sig-
line and the VDD line as follows: nal line which is connected to an analog input pin in series.
• Connect a bypass capacitor across the VSS pin and the VDD pin at Besides, connect the resistor to the microcomputer as close as
equal length. possible.
• Connect a bypass capacitor across the VSS pin and the VDD pin • Connect an approximately 1000 pF capacitor across the Vss pin
with the shortest possible wiring. and the analog input pin. Besides, connect the capacitor to the Vss
• Use lines with a larger diameter than other signal lines for VSS line pin as close as possible. Also, connect the capacitor across the
and VDD line. analog input pin and the Vss pin at equal length.
• Connect the power source wiring via a bypass capacitor to the VSS
pin and the VDD pin. <Reason>
Signals which is input in an analog input pin (such as an A/D con-
verter/comparator input pin) are usually output signals from sensor.
The sensor which detects a change of event is installed far from the
VDD VDD
printed circuit board with a microcomputer, the wiring to an analog
input pin is longer necessarily. This long wiring functions as an an-
tenna which feeds noise into the microcomputer, which causes noise
to an analog input pin.
VSS
N.G.
VSS
O.K.
Noise
(Note)
Fig. 67 Bypass capacitor across the VSS line and the VDD line Microcomputer
Analog
Thermistor input pin
N.G. O.K.
VSS
<Reason>
In the system using a microcomputer, there are signal lines for con-
trolling motors, LEDs, and thermal heads or others. When a large An example of VSS patterns on the
current flows through those signal lines, strong noise occurs be- underside of a printed circuit board
cause of mutual inductance.
Oscillator wiring
pattern example
(2) Installing oscillator away from signal lines where potential levels
change frequently XIN
Install an oscillator and a connecting pattern of an oscillator away XOUT
from signal lines where potential levels change frequently. Also, do
VSS
not cross such signal lines over the clock lines or the signal lines
which are sensitive to noise.
<Reason> Separate the VSS line for oscillation from other VSS lines
Signal lines where potential levels change frequently (such as the
CNTR pin signal line) may affect other lines at signal rising edge or
falling edge. If such lines cross over a clock line, clock waveforms
may be deformed, which causes a microcomputer failure or a pro- Fig. 71 Vss pattern on the underside of an oscillator
gram runaway.
EI Interrupt processing
CONTROL REGISTERS
R/W
Interrupt control register V1 at reset : 00002 at RAM back-up : 00002
TAV1/TV1A
0 Interrupt disabled (SNZT2 instruction is valid)
V13 Timer 2 interrupt enable bit
1 Interrupt enabled (SNZT2 instruction is invalid)
0 Interrupt disabled (SNZT1 instruction is valid)
V12 Timer 1 interrupt enable bit
1 Interrupt enabled (SNZT1 instruction is invalid)
0
V11 Not used This bit has no function, but read/write is enabled.
1
0 Interrupt disabled (SNZ0 instruction is valid)
V10 External 0 interrupt enable bit
1 Interrupt enabled (SNZ0 instruction is invalid)
R/W
Interrupt control register V2 at reset : 00002 at RAM back-up : 00002
TAV2/TV2A
0 Interrupt disabled (SNZSI instruction is valid)
V23 Serial interface interrupt enable bit
1 Interrupt enabled (SNZSI instruction is invalid)
0 Interrupt disabled (SNZAD instruction is valid)
V22 A/D interrupt enable bit
1 Interrupt enabled (SNZAD instruction is invalid)
0
V21 Not used This bit has no function, but read/write is enabled.
1
0
V20 Not used This bit has no function, but read/write is enabled.
1
R/W
Interrupt control register I1 at reset : 00002 at RAM back-up : state retained
TAI1/TI1A
0 INT pin input disabled
I13 INT pin input control bit (Note 2)
1 INT pin input enabled
Falling waveform (“L” level of INT pin is recognized with the SNZI0
0
Interrupt valid waveform for INT pin/ instruction)/“L” level
I12
return level selection bit (Note 2) Rising waveform (“H” level of INT pin is recognized with the SNZI0
1
instruction)/“H” level
0 One-sided edge detected
I11 INT pin edge detection circuit control bit
1 Both edges detected
INT pin 0 Disabled
I10
timer 1 control enable bit 1 Enabled
R/W
Clock control register MR at reset : 11012 at RAM back-up : 11012
TAMR/TMRA
MR3 MR2 Operation mode
MR3 0 0 Through mode (frequency not divided)
Operation mode selection bits 0 1 Frequency divided by 2 mode
MR2 1 0 Frequency divided by 4 mode
1 1 Frequency divided by 8 mode
0 Main clock (f(XIN)) oscillation enabled
MR1 Main clock f(XIN) control bit (Note 3)
1 Main clock (f(XIN)) oscillation stop
0 Main clock (f(XIN))
MR0 Operation source clock selection bit (Note 4)
1 On-chip oscillator clock (f(RING))
W
Clock control register RG at reset : 02 at RAM back-up : 02
TRGA
On-chip oscillator (f(RING)) control bit 0 On-chip oscillator (f(RING)) oscillation enabled
RG0 (Note 5) 1 On-chip oscillator (f(RING)) oscillation stop
Notes 1: “R” represents read enabled, and “W” represents write enabled.
2: When the contents of I12 and I13 are changed, the external interrupt request flag EXF0 may be set.
3: Main clock cannot be stopped when the main clock is selected for the operation source clock.
4: The stopped clock cannot be selected for the operation source clock. In order to switch the operation source clock, generate the oscillation stabiliz-
ing wait time by software first and set the oscillation of the destination clock to be enabled.
5: On-chip oscillator cannot be stopped when the on-chip oscillator is selected for the operation source clock.
W
Timer control register PA at reset : 02 at RAM back-up : 02
TPAA
0 Stop (state initialized)
PA0 Prescaler control bit
1 Operating
R/W
Timer control register W1 at reset : 00002 at RAM back-up : 00002
TAW1/TW1A
0 PWM1 function invalid
W13 PWM1 function control bit
1 PWM1 function valid
0 Stop (state retained)
W12 Timer 1 control bit
1 Operating
W11 W10 Count source
W11
0 0 PWM2 signal
Timer 1 count source selection bits 0 1 Prescaler output (ORCLK)
W10 1 0 CNTR1 input
1 1 On-chip oscillator clock (f(RING))
R/W
Timer control register W2 at reset : 00002 at RAM back-up : 00002
TAW2/TW2A
0 PWM2 function invalid
W23 PWM2 function control bit
1 PWM2 function valid
0 Stop (state retained)
W22 Timer 2 control bit
1 Operating
W21 W20 Count source
W21
0 0 Timer 1 underflow signal (T1UDF)
Timer 2 count source selection bits 0 1 Prescaler output (ORCLK)
W20 1 0 CNTR0 input
1 1 System clock (STCK)
R/W
Timer control register W5 at reset : 00002 at RAM back-up : state retained
TAW5/TW5A
0 P12 (I/O) / CNTR0 (input)
W53 P12/CNTR0 pin function selection bit
1 P12 (input) /CNTR0 (I/O)
Timer 1 count auto-stop circuit 0 Count auto-stop circuit not selected
W52
selection bit (Note 2) 1 Count auto-stop circuit selected
Timer 1 count start synchronous circuit 0 Count start synchronous circuit not selected
W51
selection bit (Note 3) 1 Count start synchronous circuit selected
0 Falling edge
W50 CNTR0 pin input count edge selection bit
1 Rising edge
R/W
Timer control register W6 at reset : 00002 at RAM back-up : state retained
TAW6/TW6A
0 P11 (I/O) / CNTR1 (input)
W63 P11/CNTR1 pin function selection bit
1 P11 (input) /CNTR1 (I/O)
CNTR 1 pin output auto-control circuit 0 Output auto-control circuit not selected
W62
selection bit 1 Output auto-control circuit selected
Timer 2 0 INT pin input period count circuit not selected
W61
INT pin input period count circuit selection bit 1 INT pin input period count circuit selected
0 Falling edge
W60 CNTR1 pin input count edge selection bit
1 Rising edge
Notes 1: “R” represents read enabled, and “W” represents write enabled.
2: This function is valid only when the INT pin/timer 1 control is enabled (I10=“1”) and the timer 1 count start synchronous circuit is selected (W51=“1”).
3: This function is valid only when the INT pin/timer 1 control is enabled (I10=“1”).
R/W
A/D control register Q1 at reset : 00002 at RAM back-up : state retained
TAQ1/TQ1A
0 A/D conversion mode
Q13 A/D operation mode selection bit
1 Comparator mode
Q12 Q11 Q10 Selected pins
Q12 0 0 0 AIN0
0 0 1 AIN1
0 1 0 AIN2
Q11 Analog input pin selection bits 0 1 1 AIN3
1 0 0 AIN4
1 0 1 AIN5
Q10 1 1 0 Not available
1 1 1 Not available
R/W
Serial interface control register J1 at reset : 00002 at RAM back-up : state retained
TAJ1/TJ1A
J13 J12 Synchronous clock
J13 0 0 Instruction clock (INSTCK) divided by 8
Serial interface synchronous clock 0 1 Instruction clock (INSTCK) divided by 4
selection bits
J12 1 0 Instruction clock (INSTCK) divided by 2
1 1 External clock (SCK input)
J11 J1 0 Port function
J11 0 0 P00, P01, P02 selected/SIN, SOUT, SCK not selected
Serial interface port function selection bits 0 1 P00, SOUT, SCK selected/SIN, P01, P02 not selected
J10 1 0 SIN, P01, SCK selected/P00, SOUT, P02 not selected
1 1 SIN, SOUT, SCK selected/P00, P01, P02 not selected
Notes 1: “R” represents read enabled, and “W” represents write enabled.
R/W
Key-on wakeup control register K0 at reset : 00002 at RAM back-up : state retained
TAK0/TK0A
Port P03 key-on wakeup 0 Key-on wakeup not used
K03
control bit 1 Key-on wakeup used
Port P02 key-on wakeup 0 Key-on wakeup not used
K02
control bit 1 Key-on wakeup used
Port P01 key-on wakeup 0 Key-on wakeup not used
K01
control bit 1 Key-on wakeup used
Port P00 key-on wakeup 0 Key-on wakeup not used
K00
control bit 1 Key-on wakeup used
R/W
Key-on wakeup control register K1 at reset : 00002 at RAM back-up : state retained
TAK1/TK1A
Port P13 key-on wakeup 0 Key-on wakeup not used
K13
control bit 1 Key-on wakeup used
Port P12 key-on wakeup 0 Key-on wakeup not used
K12
control bit 1 Key-on wakeup used
Port P11 key-on wakeup 0 Key-on wakeup not used
K11
control bit 1 Key-on wakeup used
Port P10 key-on wakeup 0 Key-on wakeup not used
K10
control bit 1 Key-on wakeup used
R/W
Key-on wakeup control register K2 at reset : 00002 at RAM back-up : state retained
TAK2/TK2A
Port D3 key-on wakeup 0 Key-on wakeup not used
K23
control bit 1 Key-on wakeup used
Port D2 key-on wakeup 0 Key-on wakeup not used
K22
control bit 1 Key-on wakeup used
Port P21 key-on wakeup 0 Key-on wakeup not used
K21
control bit 1 Key-on wakeup used
Port P20 key-on wakeup 0 Key-on wakeup not used
K20
control bit 1 Key-on wakeup used
R/W
Key-on wakeup control register L1 at reset : 00002 at RAM back-up : state retained
TAL1/TL1A
Ports P10–P13 return condition selection 0 Return by level
L13
bit 1 Return by edge
Ports P10–P13 valid waveform/ 0 Falling waveform/“L” level
L12
level selection bit 1 Rising waveform/“H” level
INT pin 0 Return by level
L11
return condition selection bit 1 Return by edge
INT pin 0 Key-on wakeup not used
L10
key-on wakeup control bit 1 Key-on wakeup used
Notes 1: “R” represents read enabled, and “W” represents write enabled.
R/W
Pull-up control register PU0 at reset : 00002 at RAM back-up : state retained
TAPU0/TPU0A
Port P03 pull-up transistor 0 Pull-up transistor OFF
PU03
control bit 1 Pull-up transistor ON
Port P02 pull-up transistor 0 Pull-up transistor OFF
PU02
control bit 1 Pull-up transistor ON
Port P01 pull-up transistor 0 Pull-up transistor OFF
PU01
control bit 1 Pull-up transistor ON
Port P00 pull-up transistor 0 Pull-up transistor OFF
PU00
control bit 1 Pull-up transistor ON
R/W
Pull-up control register PU1 at reset : 00002 at RAM back-up : state retained
TAPU1/TPU1A
Port P13 pull-up transistor 0 Pull-up transistor OFF
PU13
control bit 1 Pull-up transistor ON
Port P12 pull-up transistor 0 Pull-up transistor OFF
PU12
control bit 1 Pull-up transistor ON
Port P11 pull-up transistor 0 Pull-up transistor OFF
PU11
control bit 1 Pull-up transistor ON
Port P10 pull-up transistor 0 Pull-up transistor OFF
PU10
control bit 1 Pull-up transistor ON
R/W
Pull-up control register PU2 at reset : 00002 at RAM back-up : state retained
TAPU2/TPU2A
Port D3 pull-up transistor 0 Pull-up transistor OFF
PU23
control bit 1 Pull-up transistor ON
Port D2 pull-up transistor 0 Pull-up transistor OFF
PU22
control bit 1 Pull-up transistor ON
Port P21 pull-up transistor 0 Pull-up transistor OFF
PU21
control bit 1 Pull-up transistor ON
Port P20 pull-up transistor 0 Pull-up transistor OFF
PU20
control bit 1 Pull-up transistor ON
Notes 1: “R” represents read enabled, and “W” represents write enabled.
W
Port output structure control register FR0 at reset : 00002 at RAM back-up : state retained
TFR0A
0 N-channel open-drain output
FR03 Port P03 output structure selection bit
1 CMOS output
0 N-channel open-drain output
FR02 Port P02 output structure selection bit
1 CMOS output
0 N-channel open-drain output
FR01 Port P01 output structure selection bit
1 CMOS output
0 N-channel open-drain output
FR00 Port P00 output structure selection bit
1 CMOS output
W
Port output structure control register FR1 at reset : 00002 at RAM back-up : state retained
TFR1A
0 N-channel open-drain output
FR13 Port P13 output structure selection bit
1 CMOS output
0 N-channel open-drain output
FR12 Port P12 output structure selection bit
1 CMOS output
0 N-channel open-drain output
FR11 Port P11 output structure selection bit
1 CMOS output
0 N-channel open-drain output
FR10 Port P10 output structure selection bit
1 CMOS output
W
Port output structure control register FR2 at reset : 00002 at RAM back-up : state retained
TFR2A
0
FR23 Not used This bit has no function, but read/write is enabled.
1
0
FR22 Not used This bit has no function, but read/write is enabled.
1
0 N-channel open-drain output
FR21 Port P21 output structure selection bit
1 CMOS output
0 N-channel open-drain output
FR20 Port P20 output structure selection bit
1 CMOS output
W
Port output structure control register FR3 at reset : 00002 at RAM back-up : state retained
TFR3A
0 N-channel open-drain output
FR33 Port D3 output structure selection bit
1 CMOS output
0 N-channel open-drain output
FR32 Port D2 output structure selection bit
1 CMOS output
0 N-channel open-drain output
FR31 Port D1 output structure selection bit
1 CMOS output
0 N-channel open-drain output
FR30 Port D0 output structure selection bit
1 CMOS output
W
Port output structure control register C1 at reset : 00002 at power down : state retained
TC1A
0 N-channel open-drain output
C13 Port D5 output structure selection bit
1 CMOS output
0 N-channel open-drain output
C12 Port D4 output structure selection bit
1 CMOS output
0 N-channel open-drain output
C11 Port P31 output structure selection bit
1 CMOS output
0 N-channel open-drain output
C10 Port P30 output structure selection bit
1 CMOS output
Notes 1: “R” represents read enabled, and “W” represents write enabled.
INSTRUCTIONS SYMBOL
Each instruction is described as follows; The symbols shown below are used in the following list of instruction
(1) Index list of instruction function function and the machine instructions.
(2) Machine instructions (index by alphabet)
(3) Machine instructions (index by function)
(4) Instruction code table
An (A) ← (A) + n
LZ z (Z) ← z z = 0 to 3 n = 0 to 15
Note: p is 0 to 31.
RB j (Mj(DP)) ← 0
j = 0 to 3 SNZ0 V10 = 0: (EXF0) = 1 ?
(EXF0) ← 0
SZB j (Mj(DP)) = 0 ? V10 = 1: SNZ0 = NOP
j = 0 to 3
SNZI0 I12 = 0 : (INT) = “L” ?
Interrupt operation
SEAM (A) = (M(DP)) ? I12 = 1 : (INT) = “H” ?
Comparison
operation
BL p, a (PCH) ← p (Note)
TV2A (V2) ← (A)
(PCL) ← a6–a0
BM a (SP) ← (SP) + 1
TPAA (PA) ← (A)
(SK(SP)) ← (PC)
(PCH) ← 2
TAW1 (A) ← (W1)
(PCL) ← a6–a0
Subroutine operation
Other operation
V23 = 1: SNZSI = NOP
TMRA (MR) ← (A) SVDE** Voltage drop detection circuit valid at RAM back-
up
TABAD Q13 = 0,
(B) ← (AD9–AD6)
(A) ← (AD5–AD2)
Q13 = 1,
(B) ← (AD7–AD4)
(A) ← (AD3–AD0)
ADST (ADF) ← 0
Q13 = 0 : A/D conversion starting
Q13 = 1 : Comparator operation starting
B a (Branch to address a)
Instruction D9 D0 Number of Number of Flag CY Skip condition
code 8 words cycles
0 1 1 a6 a5 a4 a3 a2 a1 a0 1 +a a
2 16
1 1 – –
DI (Disable Interrupt)
Instruction D9 D0 Number of Number of Flag CY Skip condition
code words cycles
0 0 0 0 0 0 0 1 0 0 0 0 4
2 16
1 1 – –
EI (Enable Interrupt)
Instruction D9 D0 Number of Number of Flag CY Skip condition
code words cycles
0 0 0 0 0 0 0 1 0 1 0 0 5
2 16
1 1 – –
RB j (Reset Bit)
Instruction D9 D0 Number of Number of Flag CY Skip condition
code C words cycles
0 0 0 1 0 0 1 1 j j 0 4 +j 16
2
1 1 – –
SB j (Set Bit)
Instruction D9 D0 Number of Number of Flag CY Skip condition
code C words cycles
0 0 0 1 0 1 1 1 j j 0 5 +j 16
2
1 1 – –
SNZSI (Skip if Non Zero condition of Serial Interface interrupt request flag)
Instruction D9 D0 Number of Number of Flag CY Skip condition
code words cycles
1 0 1 0 0 0 1 0 0 0 2 8 8
2 16
1 1 – V23 = 0: (SIOF) =1
Operation: Voltage drop detection circuit valid at RAM back-up Grouping: Other operation
Description: Validates the voltage drop detection circuit
at RAM back-up.
Note: This instruction can be executed only for
the H version.
T1AB (Transfer data to timer 1 and register R1L from Accumulator and register B)
Instruction D9 D0 Number of Number of Flag CY Skip condition
code words cycles
1 0 0 0 1 1 0 0 0 0 2 3 0 16
2
1 1 – –
Operation: In A/D conversion mode (Q13 = 0), Grouping: A/D conversion operation
(B) ← (AD9–AD6) Description: In the A/D conversion mode (Q13 = 0), trans-
(A) ← (AD5–AD2) fers the high-order 4 bits (AD9–AD6) of register
In comparator mode (Q13 = 1), AD to register B, and the middle-order 4 bits
(B) ← (AD7–AD4) (AD5–AD2) of register AD to register A. In the
(A) ← (AD3–AD0) comparator mode (Q13 = 1), transfers the high-
order 4 bits (AD7–AD4) of comparator register
(Q13 : bit 3 of A/D control register Q1)
to register B, and the low-order 4 bits (AD3–
AD0) of comparator register to register A.
TABE (Transfer data to Accumulator and register B from register E)
Instruction D9 D0 Number of Number of Flag CY Skip condition
code words cycles
0 0 0 0 1 0 1 0 1 0 0 2 A
2 16
1 1 – –
TPSAB (Transfer data to Pre-Scaler and register RPS from Accumulator and register B)
Instruction D9 D0 Number of Number of Flag CY Skip condition
code words cycles
1 0 0 0 1 1 0 1 0 1 2 3 5
2 16
1 1 – –
XAMD j (eXchange Accumulator and Memory data and Decrement register Y and skip)
Instruction D9 D0 Number of Number of Flag CY Skip condition
code words cycles
1 0 1 1 1 1 j j j j 2 F j
2 16
1 1 – (Y) = 15
Number of
Number of
Parameter
cycles
words
Mnemonic Function
Type of Hexadecimal
D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
instructions notation
LXY x, y 1 1 x3 x2 x1 x0 y3 y2 y1 y0 3 x y 1 1 (X) ← x x = 0 to 15
(Y) ← y y = 0 to 15
RAM addresses
LZ z 0 0 0 1 0 0 1 0 z1 z0 0 4 8 1 1 (Z) ← z z = 0 to 3
+z
Carry flag CY
– – Transfers the contents of register B to the high-order 4 bits (E7–E4) of register E, and the contents of regis-
ter A to the low-order 4 bits (E3–E0) of register E.
– – Transfers the high-order 4 bits (E7–E4) of register E to register B, and low-order 4 bits of register E to regis-
ter A.
– – Transfers the contents of register Z to the low-order 2 bits (A1, A0) of register A.
“0” is stored to the high-order 2 bits (A3, A2) of register A.
– – Transfers the contents of stack pointer (SP) to the low-order 3 bits (A2–A0) of register A.
“0” is stored to the bit 3 (A3) of register A.
Continuous – Loads the value x in the immediate field to register X, and the value y in the immediate field to register Y.
description When the LXY instructions are continuously coded and executed, only the first LXY instruction is executed
and other LXY instructions coded continuously are skipped.
(Y) = 0 – Adds 1 to the contents of register Y. As a result of addition, when the contents of register Y is 0, the next in-
struction is skipped. When the contents of register Y is not 0, the next instruction is executed.
(Y) = 15 – Subtracts 1 from the contents of register Y. As a result of subtraction, when the contents of register Y is 15,
the next instruction is skipped. When the contents of register Y is not 15, the next instruction is executed.
– – After transferring the contents of M(DP) to register A, an exclusive OR operation is performed between reg-
ister X and the value j in the immediate field, and stores the result in register X.
– – After exchanging the contents of M(DP) with the contents of register A, an exclusive OR operation is per-
formed between register X and the value j in the immediate field, and stores the result in register X.
(Y) = 15 – After exchanging the contents of M(DP) with the contents of register A, an exclusive OR operation is per-
formed between register X and the value j in the immediate field, and stores the result in register X.
Subtracts 1 from the contents of register Y. As a result of subtraction, when the contents of register Y is 15,
the next instruction is skipped. When the contents of register Y is not 15, the next instruction is executed.
(Y) = 0 – After exchanging the contents of M(DP) with the contents of register A, an exclusive OR operation is per-
formed between register X and the value j in the immediate field, and stores the result in register X.
Adds 1 to the contents of register Y. As a result of addition, when the contents of register Y is 0, the next in-
struction is skipped. when the contents of register Y is not 0, the next instruction is executed.
– – After transferring the contents of register A to M(DP), an exclusive OR operation is performed between reg-
ister X and the value j in the immediate field, and stores the result in register X.
Number of
Number of
Parameter
cycles
words
Mnemonic Function
Type of Hexadecimal
D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
instructions notation
LA n 0 0 0 1 1 1 n n n n 0 7 n 1 1 (A) ← n
n = 0 to 15
An 0 0 0 1 1 0 n n n n 0 6 n 1 1 (A) ← (A) + n
n = 0 to 15
SC 0 0 0 0 0 0 0 1 1 1 0 0 7 1 1 (CY) ← 1
RC 0 0 0 0 0 0 0 1 1 0 0 0 6 1 1 (CY) ← 0
SZC 0 0 0 0 1 0 1 1 1 1 0 2 F 1 1 (CY) = 0 ?
RAR 0 0 0 0 0 1 1 1 0 1 0 1 D 1 1 → CY → A3A2A1A0
SB j 0 0 0 1 0 1 1 1 j j 0 5 C 1 1 (Mj(DP)) ← 1
+j j = 0 to 3
Bit operation
RB j 0 0 0 1 0 0 1 1 j j 0 4 C 1 1 (Mj(DP)) ← 0
+j j = 0 to 3
SZB j 0 0 0 0 1 0 0 0 j j 0 2 j 1 1 (Mj(DP)) = 0 ?
j = 0 to 3
SEA n 0 0 0 0 1 0 0 1 0 1 0 2 5 2 2 (A) = n ?
n = 0 to 15
0 0 0 1 1 1 n n n n 0 7 n
Note : p is 0 to 31.
Carry flag CY
– – Transfers bits 7 to 4 to register B and bits 3 to 0 to register A. These bits 7 to 0 are the ROM pattern in ad-
dress (DR2 DR1 DR0 A3 A2 A1 A0)2 specified by registers A and D in page p. When UPTF is 1, Transfers bits
9, 8 to the low-order 2 bits (DR1, DR0) of register D, and “0” is stored to the least significant bit (DR2) of reg-
ister D.
When this instruction is executed, 1 stage of stack register (SK) is used.
– – Adds the contents of M(DP) to register A. Stores the result in register A. The contents of carry flag CY re-
mains unchanged.
– 0/1 Adds the contents of M(DP) and carry flag CY to register A. Stores the result in register A and carry flag CY.
Overflow = 0 – Adds the value n in the immediate field to register A, and stores a result in register A.
The contents of carry flag CY remains unchanged.
Skips the next instruction when there is no overflow as the result of operation.
Executes the next instruction when there is overflow as the result of operation.
– – Takes the AND operation between the contents of register A and the contents of M(DP), and stores the re-
sult in register A.
– – Takes the OR operation between the contents of register A and the contents of M(DP), and stores the result
in register A.
(CY) = 0 – Skips the next instruction when the contents of carry flag CY is “0.”
– 0/1 Rotates 1 bit of the contents of register A including the contents of carry flag CY to the right.
– – Sets (1) the contents of bit j (bit specified by the value j in the immediate field) of M(DP).
– – Clears (0) the contents of bit j (bit specified by the value j in the immediate field) of M(DP).
(Mj(DP)) = 0 – Skips the next instruction when the contents of bit j (bit specified by the value j in the immediate field) of
j = 0 to 3 M(DP) is “0.”
Executes the next instruction when the contents of bit j of M(DP) is “1.”
(A) = (M(DP)) – Skips the next instruction when the contents of register A is equal to the contents of M(DP).
Executes the next instruction when the contents of register A is not equal to the contents of M(DP).
(A) = n – Skips the next instruction when the contents of register A is equal to the value n in the immediate field.
n = 0 to 15 Executes the next instruction when the contents of register A is not equal to the value n in the immediate
field.
Number of
Number of
Parameter
cycles
words
Mnemonic Function
Type of Hexadecimal
D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
instructions notation
Ba 0 1 1 a6 a5 a4 a3 a2 a1 a0 1 8 a 1 1 (PCL) ← a6–a0
+a
BL p, a 0 0 1 1 1 p4 p3 p2 p1 p0 0 E p 2 2 (PCH) ← p (Note)
Branch operation
+p (PCL) ← a6–a0
1 0 0 a6 a5 a4 a3 a2 a1 a0 2 a a
BM a 0 1 0 a6 a5 a4 a3 a2 a1 a0 1 a a 1 1 (SP) ← (SP) + 1
(SK(SP)) ← (PC)
(PCH) ← 2
(PCL) ← a6–a0
Subroutine operation
RT 0 0 0 1 0 0 0 1 0 0 0 4 4 1 2 (PC) ← (SK(SP))
(SP) ← (SP) – 1
Note : p is 0 to 31.
Carry flag CY
– – Branch out of a page : Branches to address (DR2 DR1 DR0 A3 A2 A1 A0)2 specified by registers D and A in
page p.
– – Call the subroutine : Calls the subroutine at address (DR2 DR1 DR0 A3 A2 A1 A0)2 specified by registers D
and A in page p.
Skip at uncondition – Returns from subroutine to the routine called the subroutine, and skips the next instruction at uncondition.
Number of
Number of
Parameter
cycles
words
Mnemonic Function
Type of Hexadecimal
D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
instructions notation
DI 0 0 0 0 0 0 0 1 0 0 0 0 4 1 1 (INTE) ← 0
EI 0 0 0 0 0 0 0 1 0 1 0 0 5 1 1 (INTE) ← 1
Carry flag CY
– – Clears (0) to interrupt enable flag INTE, and disables the interrupt.
– – Sets (1) to interrupt enable flag INTE, and enables the interrupt.
V10 = 0: (EXF0) = 1 – When V10 = 0 : Clears (0) to the EXF0 flag and skips the next instruction when external 0 interrupt request
flag EXF0 is “1.” When the EXF0 flag is “0,” executes the next instruction.
When V10 = 1 : This instruction is equivalent to the NOP instruction. (V10: bit 0 of interrupt control register
V1)
(INT) = “L” – When I12 = 0 : Skips the next instruction when the level of INT pin is “L.” Executes the next instruction when
However, I12 = 0 the level of INT pin is “H.”
(INT) = “H” When I12 = 1 : Skips the next instruction when the level of INT pin is “H.” Executes the next instruction when
However, I12 = 1 the level of INT pin is “L.” (I12: bit 2 of interrupt control register I1)
– – Transfers the contents of register B to the high-order 4 bits of prescaler and prescaler reload register RPS.
Transfers the contents of register A to the low-order 4 bits of prescaler and prescaler reload register RPS.
– – Transfers the contents of register B to the high-order 4 bits of timer 1 and timer 1 reload register R1L.
Transfers the contents of register A to the low-order 4 bits of timer 1 and timer 1 reload register R1L.
– – Transfers the contents of register B to the high-order 4 bits of timer 1 reload register R1H. Transfers the
contents of register A to the low-order 4 bits of timer 1 reload register R1H.
Instruction code
Number of
Number of
Parameter
cycles
words
Mnemonic Function
Type of Hexadecimal
D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
instructions notation
(R2H3–R2H0) ← (A)
(A3, A2) ← 0
CLD 0 0 0 0 0 1 0 0 0 1 0 1 1 1 1 (D) ← 1
RD 0 0 0 0 0 1 0 1 0 0 0 1 4 1 1 (D(Y)) ← 0
(Y) = 0 to 5
SD 0 0 0 0 0 1 0 1 0 1 0 1 5 1 1 (D(Y)) ← 1
(Y) = 0 to 5
SZD 0 0 0 0 1 0 0 1 0 0 0 2 4 2 2 (D(Y)) = 0 ?
(Y) = 0 to 5
0 0 0 0 1 0 1 0 1 1 0 2 B
Carry flag CY
– – Transfers the contents of register B to the high-order 4 bits of timer 2 and timer 2 reload register R2L. Trans-
fers the contents of register A to the low-order 4 bits of timer 2 and timer 2 reload register R2L.
– – Transfers the contents of register B to the high-order 4 bits of timer 2 reload register R2H. Transfers the con-
tents of register A to the low-order 4 bits of timer 2 reload register R2H.
V12 = 0: (T1F) = 1 – When V12 = 0 : Clears (0) to the T1F flag and skips the next instruction when timer 1 interrupt request flag
T1F is “1.” . When the T1F flag is “0,” executes the next instruction.
When V12 = 1 : This instruction is equivalent to the NOP instruction. (V12: bit 2 of interrupt control register V1)
V13 = 0: (T2F) =1 – When V13 = 0 : Clears (0) to the T2F flag and skips the next instruction when timer 2 interrupt request flag
T2F is “1.” When the T2F flag is “0,” executes the next instruction.
When V13 = 1 : This instruction is equivalent to the NOP instruction. (V13: bit 3 of interrupt control register V1)
– – Transfers the input of port P2 to the low-order 2 bits (A1, A0) of register A.
“0” is stored to the bit 3 (A3) of register A.
– – Outputs the contents of the low-order 2 bits (A1, A0) of register A to port P2.
– – Transfers the input of port P3 to the low-order 2 bits (A1, A0) of register A.
“0” is stored to the bit 3 (A3) of register A.
– – Outputs the contents of the low-order 2 bits (A1, A0) of register A to port P3.
(D(Y)) = 0 ? – Skips the next instruction when a bit of port D specified by register Y is “0.” Executes the next instruction
when a bit of port D specified by register Y is “1.”
Number of
Number of
Parameter
cycles
words
Mnemonic Function
Type of Hexadecimal
D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
instructions notation
SST 1 0 1 0 0 1 1 1 1 0 2 9 E 1 1 (SIOF) ← 0
Serial interface transmit/receive starting
Carry flag CY
– – Transfers the contents of register A to port output structure control register FR0.
– – Transfers the contents of register A to port output structure control register FR1.
– – Transfers the contents of register A to port output structure control register FR2.
– – Transfers the contents of register A to port output structure control register FR3.
– – Transfers the contents of register A to port output structure control register C1.
– – Transfers the high-order 4 bits of serial interface register SI to register B, and transfers the low-order 4 bits
of serial interface register SI to register A.
– – Transfers the contents of register B to the high-order 4 bits of serial interface register SI, and transfers the
contents of register A to the low-order 4 bits of serial interface register SI.
V23 = 0: (SIOF) =1 – Clears (0) to SIOF flag and skips the next instruction when the contents of bit 3 (V23) of interrupt control reg-
ister V2 is “0” and contents of SIOF flag is “1.” When V2 3 = 1: This instruction is equivalent to the NOP
instruction.
– – Transfers the least significant bit (A0) of register A to clock control regiser RG.
Number of
Number of
Parameter
cycles
words
Mnemonic Function
Type of Hexadecimal
D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
instructions notation
TABAD 1 0 0 1 1 1 1 0 0 1 2 7 9 1 1 Q13 = 0:
(B) ← (AD9–AD6)
(A) ← (AD5–AD2)
Q13 = 1:
(B) ← (AD7–AD4)
(A) ← (AD3–AD0)
(A1, A0) ← 0
TADAB 1 0 0 0 1 1 1 0 0 1 2 3 9 1 1 Q13 = 0:
(AD7–AD4) ← (B)
(AD3–AD0) ← (A)
Q13 = 1: TADAB = NOP
ADST 1 0 1 0 0 1 1 1 1 1 2 9 F 1 1 (ADF) ← 0
Q13 = 0: A/D conversion starting
Q13 = 1: Comparator operation starting
SNZP 0 0 0 0 0 0 0 0 1 1 0 0 3 1 1 (P) = 1 ?
Other operation
WRST 1 0 1 0 1 0 0 0 0 0 2 A 0 1 1 (WDF1) = 1 ?,
(WDF1) ← 0
RUPT 0 0 0 1 0 1 1 0 0 0 0 5 8 1 1 (UPTF) ← 0
SUPT 0 0 0 1 0 1 1 0 0 1 0 5 9 1 1 (UPTF) ← 1
Carry flag CY
– – In the A/D conversion mode (Q13 = 0), transfers the high-order 4 bits (AD9–AD6) of register AD to register
B, and the middle-order 4 bits (AD5–AD2) of register AD to register A.
In the comparator mode (Q13 = 1), transfers the high-order 4 bits (AD7–AD4) of comparator register to reg-
ister B, and the low-order 4 bits (AD3–AD0) of comparator register to register A.
(Q13: bit 3 of A/D control register Q1)
– – Transfers the low-order 2 bits (AD1, AD0) of register AD to the high-order 2 bits (A3, A2) of register A.
“0” is stored to the least significant bit (A0) of register A.
– – In the comparator mode (Q13 = 1), transfers the contents of register B to the high-order 4 bits (AD7–AD4) of
comparator register, and the contents of register A to the low-order 4 bits (AD3–AD0) of comparator register.
In the A/D conversion mode (Q13 = 0), this instruction is equivalent to the NOP instruction.
(Q13 = bit 3 of A/D control register Q1)
– – Clears (0) to A/D conversion completion flag ADF, and the A/D conversion at the A/D conversion mode (Q13
= 0) or the comparator operation at the comparator mode (Q13 = 1) is started.
(Q13 = bit 3 of A/D control register Q1)
V22 = 0: (ADF) = 1 – When V22 = 0 : Clears (0) to the ADF flag and skips the next instruction when A/D conversion completion
flag ADF is “1.” When the ADF flag is “0,” executes the next instruction.
When V22 = 1 : This instruction is equivalent to the NOP instruction. (V22: bit 2 of interrupt control register V2)
– – Puts the system in RAM back-up state by executing the POF instruction after executing the EPOF instruction.
Operations of all functions are stopped.
– – Makes the immediate after POF instruction valid by executing the EPOF instruction.
– – Stops the watchdog timer function by the WRST instruction after executing the DWDT instruction.
(WDF1) = 1 – Clears (0) to the WDF1 flag and skips the next instruction when watchdog timer flag WDF1 is “1.” When the
WDF1 flag is “0,” executes the next instruction. Also, stops the watchdog timer function when executing the
WRST instruction immediately after the DWDT instruction.
– – Validates the voltage drop detection circuit at RAM back-up (only for the H version).
The codes for the second word of a two-word instruction are described below.
The codes for the second word of a two-word instruction are described below.
Electrical characteristics
Limits
Symbol Parameter Conditions Unit
Min. Typ. Max.
VDD Supply voltage f(STCK) ≤ 6 MHz 4 5.5 V
(with a ceramic resonator) f(STCK) ≤ 4.4 MHz 2.7 5.5
f(STCK) ≤ 2.2 MHz 2.0 5.5
f(STCK) ≤ 1.1 MHz 1.8 5.5
VDD Supply voltage f(STCK) ≤ 4.4 MHz 2.7 5.5 V
(with RC oscillation)
VDD Supply voltage 1.8 5.5 V
(with an on-chip oscillator)
VRAM RAM back-up voltage (at RAM back-up) 1.6 5.5 V
VSS Supply voltage 0 V
VIH “H” level input voltage P0, P1, P2, P3, D0–D5 0.8VDD VDD V
XIN 0.7VDD VDD
RESET 0.85VDD VDD
INT, CNTR0, CNTR1, SIN, SCK 0.85VDD VDD
VIL “L” level input voltage P0, P1, P2, P3, D0–D5 0 0.2VDD V
XIN 0 0.3VDD
RESET 0 0.3VDD
INT, CNTR0, CNTR1, SIN, SCK 0 0.15VDD
IOH(peak) “H” level peak output current P0, P1, P2, P3, D0–D5 VDD = 5.0 V –20 mA
CNTR0, CNTR1, SOUT, SCK VDD = 3.0 V –10
IOH(avg) “H” level average output current P0, P1, P2, P3, D0–D5 VDD = 5.0 V –10 mA
(Note) CNTR0, CNTR1, SOUT, SCK VDD = 3.0 V –5
IOL(peak) “L” level peak output current P0, P1 VDD = 5.0 V 24 mA
CNTR0, CNTR1, SOUT, SCK VDD = 3.0 V 12
P2, P3, RESET VDD = 5.0 V 10
VDD = 3.0 V 4.0
D 0 , D1 , D 4, D 5 VDD = 5.0 V 40
VDD = 3.0 V 30
D2, D3 VDD = 5.0 V 24
VDD = 3.0 V 12
IOL(avg) “L” level average output current P0, P1 VDD = 5.0 V 12 mA
CNTR0, CNTR1, SOUT, SCK VDD = 3.0 V 6.0
P2, P3, RESET VDD = 5.0 V 5.0
VDD = 3.0 V 2.0
D 0 , D1 , D 4, D 5 VDD = 5.0 V 30
VDD = 3.0 V 15
D2, D3 VDD = 5.0 V 15
VDD = 3.0 V 7.0
ΣIOH(avg) “H” level total average current P0, P1, P3, CNTR0, CNTR1, SOUT, SCK –40 mA
P2, D0–D5 –40
ΣIOL(avg) “L” level total average current P0, P1, P3, CNTR0, CNTR1, SOUT, SCK 60 mA
P2, D0–D5, RESET 60
Notes 1: The average output current (IOH, IOL) is the average value during 100 ms.
When ceramic resonator is used When RC oscillation is used When external clock is used
4.4 4.4
3.2
2.2
1.6
Recommended
operating condition Recommended
1.1 Recommended 0.8
operating condition operating condition
1.8 2 2.7 4 5.5 VDD 2.7 5.5 VDD 1.8 2 2.7 4 5.5 VDD
[V] [V] [V]
Electrical characteristics 1 (Ta = –20 °C to 85 °C, V DD = 1.8 to 5.5 V, unless otherwise noted)
Limits
Symbol Parameter Test conditions Unit
Min. Typ. Max.
VOH “H” level output voltage VDD = 5.0 V IOH = –10 mA 3.0 V
P0, P1, P2, P3, D0–D5 IOH = –3.0 mA 4.1
CNTR0, CNTR1, SOUT, SCK VDD = 3.0 V IOH = –5.0 mA 2.1
IOH = –1.0 mA 2.4
VOL “L” level output voltage VDD = 5.0 V IOL = 12 mA 2.0 V
P0, P1 IOL = 4.0 mA 0.9
CNTR0, CNTR1, SOUT, SCK VDD = 3.0 V IOL = 6.0 mA 0.9
IOL = 2.0 mA 0.6
VOL “L” level output voltage VDD = 5.0 V IOL = 5.0 mA 2.0 V
P2, P3, RESET IOL = 1.0 mA 0.6
VDD = 3.0 V IOL = 2.0 mA 0.9
VOL “L” level output voltage VDD = 5.0 V IOL = 30 mA 2.0 V
D0 , D1 , D 4, D 5 IOL = 10 mA 0.9
VDD = 3.0 V IOL = 15 mA 2.0
IOL = 5.0 mA 0.9
VOL “L” level output voltage VDD = 5.0 V IOL = 15 mA 2.0 V
D2 , D 3 IOL = 5.0 mA 0.9
VDD = 3.0 V IOL = 9.0 mA 1.4
IOL = 3.0 mA 0.9
IIH “H” level input current VI = VDD 2.0 µA
P0, P1, P2, P3, D0–D5
RESET, INT
CNTR0, CNTR1, SIN, SCK
IIL “L” level input current VI = 0 V P0, P1, P2, D2, D3 No pull-up –2.0 µA
P0, P1, P2, P3, D0–D5
RESET, INT
CNTR0, CNTR1, SIN, SCK
RPU Pull-up resistor value VI = 0 V VDD = 5.0 V 30 60 125 kΩ
P0, P1, P2, D2, D3, RESET VDD = 3.0 V 50 120 250
VT+ – VT– Hysteresis RESET VDD = 5.0 V 1.0 V
VDD = 3.0 V 0.4
VT+ – VT– Hysteresis INT, CNTR0, CNTR1 VDD = 5.0 V 0.2 V
SIN, SCK VDD = 3.0 V 0.2
f(RING) On-chip oscillator clock frequency VDD = 5.0 V 200 500 700 kHz
VDD = 3.0 V 100 250 400
VDD = 1.8 V 30 120 200
∆ f(XIN) Oscillation frequency error (Note 1) VDD = 5.0 V ± 10 %, Ta = center 25 °C ±17 %
(at RC oscillation, error value of external VDD = 3.0 V ± 10 %, Ta = center 25 °C ±17
R, C not included)
Notes 1: When the RC oscillation is used, use a 33 pF capacitor externally.
Electrical characteristics 2 (Ta = –20 °C to 85 °C, V DD = 1.8 to 5.5 V, unless otherwise noted)
Limits
Symbol Parameter Test conditions Unit
Min. Typ. Max.
IDD Supply current at active mode VDD = 5.0 V f(STCK) = f(XIN)/8 1.2 2.4 mA
(with a ceramic resonator) f(XIN) = 6.0 MHz f(STCK) = f(XIN)/4 1.3 2.6
(Notes 1, 2) f(RING) = stop f(STCK) = f(XIN)/2 1.6 3.2
f(STCK) = f(XIN) 2.2 4.4
VDD = 5.0 V f(STCK) = f(XIN)/8 0.9 1.8 mA
f(XIN) = 4.0 MHz f(STCK) = f(XIN)/4 1 2
f(RING) = stop f(STCK) = f(XIN)/2 1.2 2.4
f(STCK) = f(XIN) 1.6 3.2
VDD = 3.0 V f(STCK) = f(XIN)/8 0.2 0.4 mA
f(XIN) = 2.0 MHz f(STCK) = f(XIN)/4 0.25 0.5
f(RING) = stop f(STCK) = f(XIN)/2 0.3 0.6
f(STCK) = f(XIN) 0.4 0.8
at active mode VDD = 5.0 V f(STCK) = f(RING)/8 50 100 µA
(with an on-chip oscillator) f(XIN) = stop f(STCK) = f(RING)/4 60 120
(Notes 1, 2) f(RING) = operating f(STCK) = f(RING)/2 80 160
f(STCK) = f(RING) 120 240
VDD = 3.0 V f(STCK) = f(RING)/8 10 20 µA
f(XIN) = stop f(STCK) = f(RING)/4 13 26
f(RING) = opertaing f(STCK) = f(RING)/2 19 38
f(STCK) = f(RING) 31 62
at RAM back-up mode Ta = 25 °C 0.1 3 µA
(POF instruction execution) VDD = 5.0 V 10
(Note 3) VDD = 3.0 V 6
Notes 1: When the A/D converter is used, the A/D operation current (IADD) is added.
2: In the M34509G4H, the voltage drop detection circuit operation current (IRST) is added.
3: In the M34509G4H, when the SVDE instruction is executed, the voltage drop detection circuit operation current (IRST) is added.
Limits
Symbol Parameter Conditions Unit
Min. Typ. Max.
VDD Supply voltage Ta = 0 °C to 50 °C 2.0 5.5 V
Ta = –20 °C to 85 °C 2.7 5.5
VIA Analog input voltage 0 VDD V
f(ADCK) A/D clock frequency (Note) VDD = 4.0 V to 5.5 V 0.8 334 kHz
VDD = 2.7 V to 5.5 V 0.8 123
VDD = 2.2 V to 5.5 V 0.8 61.2
VDD = 2.0 V to 5.5 V 0.8 15.3
Note: Definition of A/D conversion clock (ADCK)
f(ADCK)
[kHz]
334
123
61.2
A/D clock
recommended
operating condition
15.3
0.8
2 2.2 2.7 4 5.5 VDD
[V]
VDD
Vref = ✕n
256
Limits
Symbol Parameter Test conditions Unit
Min. Typ. Max.
VRST– Detection voltage Ta = 25 °C 2.6 V
(reset occurs) (Note 2) -20 °C ≤ Ta < 0 °C 2.5 3.1
0 °C ≤ Ta < 50 °C 2.2 3
50 °C ≤ Ta ≤ 85 °C 2 2.7
VRST+ Detection voltage Ta = 25 °C 2.7 V
(reset release) (Note 3) -20 °C ≤ Ta < 0 °C 2.6 3.2
0 °C ≤ Ta < 50 °C 2.3 3.1
50 °C ≤ Ta ≤ 85 °C 2.1 2.8
VRST+ – Detection voltage hysteresis 0.1 V
VRST–
IRST Operation current (Note 4) VDD = 5 V 50 100 µA
VDD = 3 V 30 60
TRST Detection time (Note 5) VDD → (VRST– – 0.1 V) 0.2 1.2 ms
Notes 1: The voltage drop detection circuit is equipped with only the M34509G4H.
2: The detection voltage (VRST–) is defined as the voltage when reset occurs when the supply voltage (VDD) is falling.
3: The detection voltage (VRST+) is defined as the voltage when reset is released when the supply voltage (VDD) is rising from reset occurs.
4: In the M34509G4H, IRST is added to IDD (supply current).
5: The detection time (TRST) is defined as the time until reset occurs when the supply voltage (VDD) is falling to [VRST– – 0.1 V].
Machine cycle
Mi Mi+1
Parameter Pin name
Package outline
JEITA Package Code RENESAS Code Previous Code MASS[Typ.]
P-SSOP24-5.3x10.1-0.80 PRSP0024GA-A 24P2Q-A 0.2g
24 13
HE
E
*1
NOTE)
F 1. DIMENSIONS "*1" AND "*2"
DO NOT INCLUDE MOLD FLASH.
2. DIMENSION "*3" DOES NOT
INCLUDE TRIM OFFSET.
1 12
Index mark
c Reference Dimension in Millimeters
*2 A2 A1
Symbol
D Min Nom Max
D 10.0 10.1 10.2
E 5.2 5.3 5.4
A2 1.8
A 2.1
A
A1 0 0.1 0.2
bp 0.3 0.35 0.45
L
*3 c 0.18 0.2 0.25
e bp
y
0° 8°
HE 7.5 7.8 8.1
Detail F
e 0.65 0.8 0.95
y 0.10
L 0.4 0.6 0.8
(1/2)
Rev. Date Description
Page Summary
138 Linearity error: Ta = 0 ˚C to 50 ˚C, 2.2 V ≤ VDD 0 ˚C 2.7 V →
Ta = 0 ˚C to 50 ˚C, 2.2 V ≤ VDD < 2.7 V
Note 1: ...., the IADD is included to IDD. → ...., the IADD is added to IDD.
(2/2)
Sales Strategic Planning Div. Nippon Bldg., 2-6-2, Ohte-machi, Chiyoda-ku, Tokyo 100-0004, Japan
Notes:
1. This document is provided for reference purposes only so that Renesas customers may select the appropriate Renesas products for their use. Renesas neither makes
warranties or representations with respect to the accuracy or completeness of the information contained in this document nor grants any license to any intellectual property
rights or any other rights of Renesas or any third party with respect to the information in this document.
2. Renesas shall have no liability for damages or infringement of any intellectual property or other rights arising out of the use of any information in this document, including,
but not limited to, product data, diagrams, charts, programs, algorithms, and application circuit examples.
3. You should not use the products or the technology described in this document for the purpose of military applications such as the development of weapons of mass
destruction or for the purpose of any other military use. When exporting the products or technology described herein, you should follow the applicable export control laws
and regulations, and procedures required by such laws and regulations.
4. All information included in this document such as product data, diagrams, charts, programs, algorithms, and application circuit examples, is current as of the date this
document is issued. Such information, however, is subject to change without any prior notice. Before purchasing or using any Renesas products listed in this document,
please confirm the latest product information with a Renesas sales office. Also, please pay regular and careful attention to additional and different information to be
disclosed by Renesas such as that disclosed through our website. (http://www.renesas.com )
5. Renesas has used reasonable care in compiling the information included in this document, but Renesas assumes no liability whatsoever for any damages incurred as a
result of errors or omissions in the information included in this document.
6. When using or otherwise relying on the information in this document, you should evaluate the information in light of the total system before deciding about the applicability
of such information to the intended application. Renesas makes no representations, warranties or guaranties regarding the suitability of its products for any particular
application and specifically disclaims any liability arising out of the application and use of the information in this document or Renesas products.
7. With the exception of products specified by Renesas as suitable for automobile applications, Renesas products are not designed, manufactured or tested for applications
or otherwise in systems the failure or malfunction of which may cause a direct threat to human life or create a risk of human injury or which require especially high quality
and reliability such as safety systems, or equipment or systems for transportation and traffic, healthcare, combustion control, aerospace and aeronautics, nuclear power, or
undersea communication transmission. If you are considering the use of our products for such purposes, please contact a Renesas sales office beforehand. Renesas shall
have no liability for damages arising out of the uses set forth above.
8. Notwithstanding the preceding paragraph, you should not use Renesas products for the purposes listed below:
(1) artificial life support devices or systems
(2) surgical implantations
(3) healthcare intervention (e.g., excision, administration of medication, etc.)
(4) any other purposes that pose a direct threat to human life
Renesas shall have no liability for damages arising out of the uses set forth in the above and purchasers who elect to use Renesas products in any of the foregoing
applications shall indemnify and hold harmless Renesas Technology Corp., its affiliated companies and their officers, directors, and employees against any and all
damages arising out of such applications.
9. You should use the products described herein within the range specified by Renesas, especially with respect to the maximum rating, operating supply voltage range,
movement power voltage range, heat radiation characteristics, installation and other product characteristics. Renesas shall have no liability for malfunctions or damages
arising out of the use of Renesas products beyond such specified ranges.
10. Although Renesas endeavors to improve the quality and reliability of its products, IC products have specific characteristics such as the occurrence of failure at a certain
rate and malfunctions under certain use conditions. Please be sure to implement safety measures to guard against the possibility of physical injury, and injury or damage
caused by fire in the event of the failure of a Renesas product, such as safety design for hardware and software including but not limited to redundancy, fire control and
malfunction prevention, appropriate treatment for aging degradation or any other applicable measures. Among others, since the evaluation of microcomputer software
alone is very difficult, please evaluate the safety of the final products or system manufactured by you.
11. In case Renesas products listed in this document are detached from the products to which the Renesas products are attached or affixed, the risk of accident such as
swallowing by infants and small children is very high. You should implement safety measures so that Renesas products may not be easily detached from your products.
Renesas shall have no liability for damages arising out of such detachment.
12. This document may not be reproduced or duplicated, in any form, in whole or in part, without prior written approval from Renesas.
13. Please contact a Renesas sales office if you have any questions regarding the information contained in this document, Renesas semiconductor products, or if you have
any other inquiries.