To our custo mers,
Old Company Name in Catalogs and Other Documents
On April 1st, 2010, NEC Electronics Corporation merged with Renesas Technology
Corporation, and Renesas Electronics Corpor ation took over all the business of both
companies. Therefore, althoug h the old com pany name remains in this docum ent, it is a valid
Renesas Electronics document. W e appreciate your understanding.
Renesas Electronics website: http://www.renesas.com
April 1st, 2010
Renesas Electronics Corporation
Issued by: Renesas Electronics Corporation (http://www.renesas.com)
Send any inquiries to http://www.renesas.com/inquiry.
Notice
1. All information included in this document 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 Electronics products listed herein, please
confirm the latest product information with a Renesas Electronics sales office. Also, please pay regular and careful attention to
additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website.
2. Renesas Electronics does not assume any liability for infringement of patents, copyrights, or other intellectual property rights
of third parties by or arising from the use of Renesas Electronics products or technical information described in this document.
No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights
of Renesas Electronics or others.
3. You should not alter, modify, copy, or otherwise misappropriate any Renesas Electronics product, whether in whole or in part.
4. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of
semiconductor products and application examples. You are fully responsible for the incorporation of these circuits, software,
and information in the design of your equipment. Renesas Electronics assumes no responsibility for any losses incurred by
you or third parties arising from the use of these circuits, software, or information.
5. When exporting the products or technology described in this document, you should comply with the applicable export control
laws and regulations and follow the procedures required by such laws and regulations. You should not use Renesas
Electronics products or the technology described in this document for any purpose relating to military applications or use by
the military, including but not limited to the development of weapons of mass destruction. Renesas Electronics products and
technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited
under any applicable domestic or foreign laws or regulations.
6. Renesas Electronics has used reasonable care in preparing the information included in this document, but Renesas Electronics
does not warrant that such information is error free. Ren esas E lectronics assumes no liability whatsoever for any da mages
incurred by you resulting from errors in or omissions from the information included herein.
7. Renesas Electronics products are classified acco rding to the following three quality grades: “Standard”, “High Quality”, and
“Specific”. The recommended applications for each Renesas Electronics product depends on the product’s quality grade, as
indicated below. You must check the quality grade of each Renesas Electronics product before using it in a particular
application. You may not use any Renesas Electronics product for any application categorized as “Specific” without the prior
written consent of Renesas Electronics. Further, you may not use any Renesas Electronics product for any application for
which it is not intended without the prior written consent of Renesas Electronics. Renesas Electronics shall not be in any way
liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an
application categorized as “Specific” or for which the product is not intended where you have failed to obtain the prior written
consent of Renesas Electronics. The quality grade of each Renesas Electronics product is “Standard” unless otherwise
expressly specified in a Renesas Electronics data sheets or data books, et c.
“Standard”: Computers; office equipment; communications equipment; test and measurement equipment; audio and visual
equipment; home electro nic app liances; machine tool s; p ersonal electron ic equipment; and indu strial robots .
“High Quality”: Transportation equipment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster systems; anti-
crime systems; safety equipment; and medical equipment not specifically designed for life support.
“Specific”: Aircraft; aerospace equ i pment; submersible repeaters; nu clear reactor control systems; medical equipment or
systems for life support (e.g. artificial life support devices or systems), surgical implantations, or healthcare
interven tion (e.g. excision, et c.), and any oth er applications or purposes that pose a direct th reat to human life.
8. You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics,
especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation
characteristics, installation and other product characteristics. Renesas Electronics shall have no liability for malfunctions or
damages arising out of the use of Renesas Electronics products beyond such specified ranges.
9. Although Renesas Electronics endeavors to improve the quality and reliability of its products, semiconductor products have
specific chara cterist ics such as the o ccurren ce of failure at a certai n rate an d malfunct ion s under certai n u se cond ition s. Further,
Renesas Electronics pr oducts are not subject to radiation resi stance design. Please be sure to implement safety measures to
guard them against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a
Renesas Electronics 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 appropriate measures. Because
the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or system
manufactured by you.
10. Please contact a Renesas Electronics sales office for det ai ls as to enviro nmental matters such as the en vi ronmental
compatibility of each Renesas Electronics product. Please use Renesas Electronics products in compliance with all applicable
laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS
Directive. Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with
applicable laws and regulations.
11. This document may not be reproduced or duplicated, in any form, in whole or in part, without prior written consent of Renesas
Electronics.
12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this
document or Renesas Electronics products, or if you have any other inquiries.
(Note 1) “Renesas Electronics” as us ed in this document means Renesas Electronics Corporation and also includes its majo ri ty-
owned subsidiaries.
(Note 2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 1 of 100
DESCRIPTION
The 3803 group (Spec.H QzROM version) is the 8-bit
microcomputer based on the 740 family core technology.
The 3803 group (Spec.H QzROM version) is designed for
household products, office automation equipment, and
controlling systems that require analog signal processing,
including the serial interface functions, 8/16-bit timer, A/D
converter and D/A converter.
FEATURES
Basic machine-language instructions ................................. 71
Minimum instruction execution time .......................... 0.24 µs
(at 16.8 MHz oscillation frequency)
Memory size
QzROM .................................................... 16 K to 48 K bytes
RAM ..................................................................... 2048 bytes
Programmable input /output ports ........................... ............ 56
Software pull-up resistors........... ................................. Built-in
Interrupts ............ .................................. 21 sources, 16 vectors
(external 8, internal 12, software 1)
Timers ........................... ............. ............. .............. ... 16-bit × 1
8-bit × 4
(with 8-bit prescaler)
Serial interfa ce.........8-bit × 2 (UART or Clock-synchronized)
8-bit × 1 (Clock-synchronized)
PWM ...................... ................. 8-bit × 1 (with 8-bit pres ca ler)
A/D converter ........................................ 10-bit × 16 channels
(8-bit reading enabled)
D/A converter ............................................ 8-bit × 2 channels
Watchdog timer ......................................... 16-bit × 1 channel
LED direct drive port..............................................................8
Clock generating circuit ............................. Built-in 2 circuits
(connect to external ceramic resonator or quartz-crystal oscillator)
Power source voltage
[In high-speed mode]
At 16.8 MHz oscillation frequency............ ........4.5 to 5.5 V
At 12.5 MHz oscillation frequency............ .. ......4.0 to 5.5 V
At 8.4 MHz oscillation frequency............ ..........2.7 to 5.5 V
At 4.2 MHz oscillation frequency............ ..........2.2 to 5.5 V
At 2.1 MHz oscillation frequency............ ..........2.0 to 5.5 V
[In middle-speed mode]
At 16.8 MHz oscillation frequency............ ........4.5 to 5.5 V
At 12.5 MHz oscillation frequency............ .. ......2.7 to 5.5 V
At 8.4 MHz oscillation frequency............ ..........2.2 to 5.5 V
At 6.3 MHz oscillation frequency.......... .. ..........1.8 to 5. 5 V
[In low-speed mode]
At 32 kHz oscillation frequency.........................1.8 to 5.5 V
Power dissipation
In high-speed mode ........................................... 40 mW (typ.)
(at 16.8 MHz oscillation frequency, at 5 V power source voltage)
In low-speed mode .... ............. ............. .............. 45 µW (typ.)
(at 32 kHz oscillation frequency, at 3 V power s o urce voltag e)
Operating temperature range ............................. 20 to 85 °C
Packages
SP..............PRDP0064BA-A (64P4B) <64-pin 750mil SDIP>
HP...PLQP0064KB-A (64P6Q-A)<64-pin 10 × 10mm LQFP>
KP...PLQP0064GA-A (64P6U-A)<64-pin 14 × 14mm LQFP>
WG ........ PTLG0064JA-A (64F0G)<
64-pin
6
×
6mm FLGA>
APPLICATION
Household products, Consumer el ec tronics, etc.
3803 Group (Spec.H QzROM version)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER REJ03B0166-0113
Rev.1.13
Aug 21, 2009
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 2 of 100
3803 Group (Spec.H QzROM version)
Fig 1. 3803 group (Spec.H QzROM version) pin configuration (PLQP0064KB-A/PLQP0064GA-A)
31
30
21
49
50
51
52
53
54
55
56
57
58
59
60
48
1
2
3
4
5
6
7
8
9
10
11
12
32
29
28
27
26
25
24
23
22
47
46
45
44
43
42
41
40
39
38
37
Package type: PLQP0064KB-A (64P6Q-A)
PLQP0064GA-A (64P6U-A)
PIN CONFIGURATION ( T OP VIEW)
M38039GXH-XXXHP/KP
M38039GXHHP/KP
P36/SCLK3
P33
P32
P31/DA2
VCC
VREF
AVSS
P35/TXD3
P34/RXD3
P30/DA1
P67/AN7
P00/AN8
P01/AN9
P02/AN10
P03/AN11
P04/AN12
P05/AN13
P06/AN14
P07/AN15
P10/INT41
P13
P11/INT01
P12
P60/AN0
P57/INT3
P56/PWM
P55/CNTR1
P54/CNTR0
P51/SOUT2
P50/SIN2
P62/AN2
P52/SCLK2
P61/AN1
P25(LED5)
P20(LED0)
P21(LED1)
P22(LED2)
P23(LED3)
P24(LED4)
P26(LED6)
P27(LED7)
VSS
XOUT
XIN
P40/INT40/XCOUT
13
14
15
16
36
35
34
33
P14
P17
P15
P16
P45/TXD1
P44/RXD1
P43/INT2
P46/SCLK1
17
61
62
63
64
20
19
18
P66/AN6
P65/AN5
P64/AN4
P63/AN3
P41/INT00/XCIN
RESET
CNVSS
P42/INT1
P53/SRDY2
P37/SRDY3
P47/SRDY1/CNTR2
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 3 of 100
3803 Group (Spec.H QzROM version)
Fig 2. 3803 group (Spec.H QzROM version) pin configuration (PRDP0064BA-A)
PIN CONFIGURATION ( TOP VIEW)
Package type: PRDP0064BA-A (64P4B)
32
VSS 33 P27(LED7)
31
XOUT 34 P26(LED6)
30
XIN 35 P25(LED5)
29
P40/INT40/XCOUT 36 P24(LED4)
28
P41/INT00/XCIN 37 P23(LED3)
27
RESET 38 P22(LED2)
26
CNVSS 39 P21(LED1)
25
P42/INT140 P20(LED0)
24
P43/INT241 P17
23
P44/RXD142 P16
22
P45/TXD143 P15
21
P46/SCLK1 44 P14
20 45 P13
19
P50/SIN2 46 P12
18
P51/SOUT2 47 P11/INT01
17
P52/SCLK2 P10/INT41
16 49 P07/AN15
15
P54/CNTR050 P06/AN14
14
P55/CNTR151 P05/AN13
13
P56/PWM 52 P04/AN12
12
P57/INT353 P03/AN11
11
P60/AN054 P02/AN10
10
P61/AN155 P01/AN9
9
P62/AN256 P00/AN8
8
P63/AN357
7
P64/AN458 P36/SCLK3
6
P65/AN559 P35/TXD3
5
P66/AN660 P34/RXD3
4
P67/AN761 P33
3
AVSS 62 P32
2
VREF 63 P31/DA2
1
VCC 64 P30/DA1
M38039GXHSP
48
P53/SRDY2
P47/SRDY1/CNTR2
P37/SRDY3
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 4 of 100
3803 Group (Spec.H QzROM version)
Fig 3. Pin configuration (Top view) (PTLG0064JA-A (64F0G))
3
2
1
8
7
6
5
4
P61/AN1P60/AN0P55/CNTR1P52/SCLK2 P50/SIN2 P44/RXD1P43/INT2CNVSS
P65/AN5P64/AN4P56/PWM P53/SRDY2 P51/SOUT2 P46/SCLK1 P42/INT1RESET
P67/AN7P66/AN6P57/INT3P54/CNTR0P47/SRDY1/CNTR2P45/TXD1P40/INT40/XCOUT P41/INT00/XCIN
P30/DA1P31/DA2P32P37/SRDY3 P17P14P15P16
P33P34/RXD3P00/AN8P05/AN13 P12P13P26(LED6)P27(LED7)
P35/TXD3P01/AN9P03/AN11 P06/AN14 P11/INT01 P25(LED5)P23(LED3)P24(LED4)
P36/SCLK3 P02/AN10 P04/AN12 P07/AN15 P10/INT41 P20(LED0)P21(LED1)P22(LED2)
P62/AN2P63/AN3VREF AVSS VCC VSS XIN XOUT
ABCDEFGH
3
2
1
8
7
6
5
4
ABCDEFGH
Package (TOP VIEW)
50 46 44 41 40 32 31 30
51 47 45 42 39 27 29 28
53 52 48 43 38 37 26 25
56 55 54 49 33 36 35 34
164 58 59 57 24 22 23
60 61 4 7 12 14 21 20
62 63 5 8 10 13 17 19
236911 15 16 18
PIN CONFIGURATION (TOP VIEW)
Package code : PTLG0064JA-A (64F0G)
Note : The numbers in circles corresponds with the number on the packages HP/KP. M38039GCH
-XXXWG
M38039
GCHWG
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 5 of 100
3803 Group (Spec.H QzROM version)
Table 1 Performance overview
Parameter Function
Number of basic instructions 71
Minimum instruction execution time 0.24 µs (Oscillation frequency 16.8 MHz)
Oscillation frequency 16.8 MHz (Maximum)
Memory sizes ROM 16 to 48 Kbytes
RAM 2048 Kbytes
I/O port P0, P1, P2, P3, P4, P5, P6 56 pins
Software pull-up resistors Built-in
Interrupt 21 sources, 16 vectors (8 external, 12 internal, 1 software)
Timer 8-bit × 4 (with 8-bit prescaler)
16-bit × 1
Serial interface 8-bit × 2 (UART or Clock-synchronized)
8-bit × 1 (Clock-synchronized)
PWM 8-bit × 1 (with 8-bit prescaler)
A/D converter 10-bit × 16 channels (8-bit reading enabled)
D/A converter 8-bit × 2 channels
Watchdog timer 16-bit × 1
LED direct drive port
8 (average current: 10 mA, peak current: 20 mA, total current: 80 mA)
Clock generating circuits Built-in 2 circuits
(connect to external ceramic resonator or quartz-crystal oscillator)
Power source
voltage In high-speed mode At 16.8 MHz 4.5 to 5.5 V
At 12.5 MHz 4.0 to 5.5 V
At 8.4 MHz 2.7 to 5.5 V
At 4.2 MHz 2.2 to 5.5 V
At 2.1 MHz 2.0 to 5.5 V
In middle-speed mode At 16.8 MHz 4.5 to 5.5 V
At 12.5 MHz 2.7 to 5.5 V
At 8.4 MHz 2.2 to 5.5 V
At 6.3 MHz 1.8 to 5.5 V
In low-speed mode At 32 kHz 1.8 to 5.5 V
Power dissipation In high-speed mode Std. 40 mW (VCC=5.0V, f(XIN)=16.8 MHz, Ta=25 °C)
In low-speed mode Std. 45 µW (VCC=3.0V, f(XIN)=Stop, f(XCIN)=32kHz, Ta=25 °C)
Input/Output
characteristics Input/Output withstand voltage VCC
Output current 10 mA
Operating temperature range -20 to 85 °C
Device structure CMOS silicon gate
Package 64-pin plastic molded SDIP/LQFP/FLGA
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 6 of 100
3803 Group (Spec.H QzROM version)
Fig 4. Functional block diagram
Prescaler X (8)
Timer 1 (8)
Prescaler 12 (8)
Timer X (8)
Timer 2 (8)
RESET
27 26
CNVSS
CNTR0
Reset input
P1 (8)
41 43 45 47
42 44 46 48
I/O port P 1
Prescaler Y (8) Timer Y (8)
CNTR1
P2 (8)
33 35 37 3934 36 38 40
I/O port P 2
(LED drive)
P0 (8)
49 50 51 52 53 54 55 56
I/O port P 0
D/A
converter
1 (8)
R A M R O M A
X
Y
S
PCLPCH
PS
C P U
VSS
32 VCC
1
D/A
converter
2 (8)
0
P5 (8)
13 1714 16 1815
Clock generating circuit
XIN XOUT
Main
clock
input
Main
clock
output
FUNCTIONAL BLOCK DIAGRAM (Package: PRDP0064BA-A)
30 31
A/D
converter
(10)
VREF
PWM (8)
23
AVss
XCIN XCOUT
Sub-clock
input Sub-clock
output
28 29
Data bus
Timer Z (16)
CNTR2
P6 (8)
4681057911
I/O port P6
1912
I/O port P5
INT3
Serial
interface
2 (8)
Serial
interface
1 (8)
P4 (8)
21 2522 24 2823 2920
I/O port P4
INT00
INT1
INT2
INT40 P3 (8)
58 6259 61 6360 6457
I/O port P3
Serial
interface
3 (8)
INT01
INT41
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 7 of 100
3803 Group (Spec.H QzROM version)
PIN DESCRIPTION
Table 2 Pin description
Pin Name Functions Function except a port function
VCC, VSS Power source Apply voltage of 1.8 V 5.5 V to VCC, and 0 V to VSS.
CNVSS CNVSS This pin controls the operation mode of the chip and VPP power source input pin in the QzROM
writing mode.
Normally connected to VSS.
VREF Reference
voltage Reference voltage input pin for A/D and D/A converters.
AVSS Analog power
source Analog power source input pin for A/D and D/A converters.
Connect to VSS.
RESET Reset input Reset input pin for active “L”.
XIN Clock input Input and output pins for the clock generating circuit.
Connect a ceramic resonator or quartz-crystal oscillator between the XIN and XOUT pins to set
the oscillation frequency.
When an external clock is used, connect the clock source to the XIN pin and leave the XOUT pin
open.
XOUT Clock output
P00/AN8
P07/AN15 I/O port P0 8-bit CMOS I/O port.
I/O direction register allows each pin to be individually
programmed as either input or output.
CMOS compatible input level.
CMOS 3-state output structure.
Pull-up control is enabled in a bit unit.
•P2
0 P27 (8 bits) are enabled to output large current for
LED drive.
A/D converter input pin
P10/INT41
P11/INT01 I/O port P1 Interrupt input pin
P12P17
P20 (LED0)
P27 (LED7)I/O port P2
P30/DA1
P31/DA2I/O port P3 8-bit CMOS I/O port.
I/O direction register allows each pin to be individually
programmed as either input or output.
CMOS compatible input level.
•P3
0, P31, P34 P37 are CMOS 3-state output structure.
•P3
2, P33 are N-channel open-drain output structure.
Pull-up control of P30, P31, P34 P37 is enabled in a bit unit.
D/A converter input pin
P32, P33
P34/RXD3
P35/TXD3
P36/SCLK3
P37/SRDY3
Serial I/O3 function pin
P40/INT40/XCOUT
P41/INT00/XCIN I/O port P4 8-bit CMOS I/O port.
I/O direction register allows each pin to be individually
programmed as either input or output.
CMOS compatible input level.
CMOS 3-state output structure.
Pull-up control is enabled in a bit unit.
Interrupt input pin
Sub-clock generating I/O pin
(resonator connected)
P42/INT1
P43/INT2 Interrupt input pin
P44/RXD1
P45/TXD1
P46/SCLK1
Serial I/O1 function pin
P47/SRDY1/CNTR2 Serial I/O1, timer Z function pin
P50/SIN2
P51/SOUT2
P52/SCLK2
P53/SRDY2
I/O port P5 Serial I/O2 function pin
P54/CNTR0 Timer X function pin
P55/CNTR1 Timer Y function pin
P56/PWM PWM output pin
P57/INT3 Interrupt input pin
P60/AN0
P67/AN7I/O port P6 A/D converter input pin
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 8 of 100
3803 Group (Spec.H QzROM version)
PART NUMBERING
Fig 5. Part numbering
M3803 9 G C H XXX SP
Product name
Packag e t ype
SP : PR DP 0064BA-A (64P4B)
HP : PLQP0064KB-A (64P6Q-A)
KP : PLQP0064GA-A (64P6U-A)
WG : PTLG0064JA- A (6 4F0 G)
ROM number
Omitted in blank version.
QzROM size
1: 4096 byt es
2: 8192 byt es
3: 12288 byte s
4: 16384 byte s
5: 20480 byte s
6: 24576 byte s
7: 28672 byte s
8: 32768 byte s
The first 1 28 b yt es a nd t he last 2 bytes of ROM are re ser v ed a re as ;
they canno t b e used as a user’s ROM ar e a.
Memory type
G: QzROM version
RAM size
0: 192 byt es
1: 256 byt es
2: 384 byt es
3: 512 byt es
4: 640 byt es
: standard
” is omitted in th e sh ip ped in b lank ve r s io n.
H: P art ial sp ecif ica t ion cha ng ed ve r sion.
9: 36864 bytes
A: 40960 by te s
B: 45056 by te s
C: 49152 by t es
D: 53248 by t es
E: 57344 by te s
F: 61440 byt e s
5: 768 bytes
6: 896 bytes
7: 1024 byte s
8: 1536 byte s
9: 2048 byte s
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 9 of 100
3803 Group (Spec.H QzROM version)
GROUP EXPANSION
Renesas Technology expands the 3803 group (Spec.H QzROM
version) as follows.
Memory Type
Support for QzROM version.
Memory Size
QzROM size................... ............. .............. ..16 K to 48 K bytes
RAM size..................................................................2048 bytes
Packages
PRDP0064BA-A............... 64-pin shrink plastic-molded SDIP
PLQP0064KB-A ...............0.5 mm-pitch plastic molded LQFP
PLQP0064GA-A...............0.8 mm-pitch plastic molded LQFP
PTLG0064JA-A..............0.65 mm-pitch plastic molded FLGA
Fig 6. Memory expansion plan
As of Jan. 2009
16K
Memory Expansion Plan
640 1024 1536 2048
RAM size (bytes)
ROM size (bytes)
24K
32K
48K
M38039G6H
M38039G4H
M38039G8H
M38039GCH
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 10 of 100
3803 Group (Spec.H QzROM version)
NOTES:
1. This means a shipment of which User ROM has been programmed.
2. The user ROM area of a blank product is blank.
3. ROM size includes the ID code protect area.
Ta ble 3 S upport products
Product name QzROM size (bytes)
ROM size for User in ( ) RAM size
(bytes) Package Remarks
M38039G4H-XXXHP 16384
(16254) (3)
2048
PLQP0064KB-A (64P6Q-A)
QzROM version
(Programmed shipment)
(1)
M38039G4H-XXXKP PLQP0064GA-A (64P6U-A)
M38039G6H-XXXHP 24576
(24446) (3) PLQP0064KB-A (64P6 Q-A)
M38039G6H-XXXKP PLQP0064GA-A (64P6U-A)
M38039G8H-XXXHP 32768
(32638) (3) PLQP0064KB-A (64P6 Q-A)
M38039G8H-XXXKP PLQP0064GA-A (64P6U-A)
M38039GCH-XXXHP 49152
(49022) (3)
PLQP0064KB-A (64P6Q-A)
M38039GCH-XXXKP PLQP0064GA-A (64P6U-A)
M38039GCH-XXXWG PTLG0064JA-A (64F0G)
M38039G4HSP 16384
(16254) (3)
PRDP0064BA-A (64F4B)
QzROM version
(blank) (2)
M38039G4HHP PLQP0064KB-A (64P6Q-A)
M38039G4HKP PLQP0064GA-A (64P6U-A)
M38039G6HSP 24576
(24446) (3)
PRDP0064BA-A (64P4B)
M38039G6HHP PLQP0064KB-A (64P6Q-A)
M38039G6HKP PLQP0064GA-A (64P6U-A)
M38039G8HSP 32768
(32638) (3)
PRDP0064BA-A (64P4B)
M38039G8HHP PLQP0064KB-A (64P6Q-A)
M38039G8HKP PLQP0064GA-A (64P6U-A)
M38039GCHSP 49152
(49022) (3)
PRDP0064BA-A (64P4B)
M38039GCHHP PLQP0064KB-A (64P6Q-A)
M38039GCHKP PLQP0064GA-A (64P6U-A)
M38039GCHWG PTLG0064JA-A (64F0G)
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 11 of 100
3803 Group (Spec.H QzROM version)
FUNCTIONAL DESCRIPTION
CENTRAL PROCESSING UNIT (CPU)
The 3803 group (Spec.H QzROM version) uses the standard 740
Family instruction set. Refer to the table of 740 Family
addressing modes and machine instructions or the 740 Family
Software Manual for details on the instruction set.
Machine-resident 740 Family instructions are as follows:
The FST and SLW instructions cannot be used.
The STP, WIT, MUL, and DIV instructions can be used.
[Accumulator (A)]
The accumulator is an 8-bit register. Data operations such as data
transfer, etc. are executed mainly through the accumulator.
[Index Register X (X)]
The index regist er X is an 8-bit register. In the index addressing
modes, the value of the OPERAND is added to the contents of
register X and specifies the real address.
[Index Register Y (Y)]
The index register Y is an 8-bit register. In partial instruction, the
value of the OPERAND is added to the contents of register Y
and specifies the real address.
[Stack Pointer (S)]
The stack pointer is an 8-bit register used during subroutine calls
and interrupts. This register indicates st art address of st ored area
(stack) for storing registers during subroutine calls and
interrupts.
The low-order 8 bits of the stack address are determined by the
contents of the stack pointer. Th e high-order 8 bits of the stack
address are determined by the stack page selection bit. If the
stack page selection bit i s “0”, the high-order 8 bits becomes
“0016”. If the stack page selection bit is “1”, the high-order 8 bits
becomes “0116”.
The operations of pushi ng register contents onto the stack and
popping them from the stack are shown in Figure 8.
Store registers other than those described in Figure 7 with
program when the user needs them during interrupts or
subroutine calls (see Table 4).
[Program Counter (PC)]
The program counter is a 16-bit counter consisting of two 8-bit
registers PCH and PCL. It is used to indicate the address of the
next instruction to be executed.
Fig 7. 740 Family CPU register structure
Processor Status Register (PS)
Carry Flag
Zero Flag
Interrupt Disable Flag
Decimal Mode Flag
Break Flag
Index X Mode Flag
Overflow Flag
Negative Flag
b7 b0
b15 Program Counter
Stack Pointer
Index Register Y
Index Register X
Accumulator
A
X
Y
S
PCLPCH
CZIDBTVN
b7 b0
b7 b0
b7 b0
b7 b0
b7 b0
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 12 of 100
3803 Group (Spec.H QzROM version)
Fig 8. Register push and pop at interrupt generation and subroutine call
Interrupt request
(Note)
M(S)(PCH)
(S)(S) 1
M(S)(PCL)
(S)(S) 1
.....
Execute RTS
Subroutine
(S)(S) + 1
(PCL)M(S)
(S)(S) + 1
(PCH)M(S)
M(S)(PCH)
(S)(S) 1
M(S)(PCL)
(S)(S) 1
M(S)(PS)
(S)(S) 1
Interrupt
Service Routine
(S)(S) + 1
(PS)M(S)
(S)(S) + 1
(PCL)M(S)
(S)(S) + 1
(PCH)M(S)
Execute JSR
.....
Execute RTI
Push Return Address
on Stack
Push Contents of
Processor
Status Register on Stack
I Flag is Set from
“0” to “1”
Fetch the Jump
Vector
POP Contents of
Processor Status Register
from Stack
POP Return
Address from Stack
POP Return
Address from
Stack
Push Return
Address
on Stack
Note : Condition for acceptance of an interrupt Interrupt enable flag is “1”
Interrupt disable flag is “0”
On-going Routine
Ta ble 4 Push and pop instructions of accumulator or processor status register
Push instruction to stack Pop instruction from stack
Accumulator PHA PLA
Processor status register PHP PLP
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 13 of 100
3803 Group (Spec.H QzROM version)
[Processor status register (PS)]
The processor status register is an 8-bit register consisting of 5
flags which indicate the status of the processor after an
arithmetic operation and 3 flags which decide MCU operation.
Branch operations can be performed by testing the Carry (C)
flag, Zero (Z) flag, Overflow (V) flag, or the Negative (N) flag.
In decimal mode, the Z, V, N flags are not valid.
Bit 0: Carry flag (C)
The C flag contains a carry or borrow generated by the
arithmetic logic unit (ALU) immediately after an arithmetic
operation. It can also be changed by a shift or rotate
instruction.
Bit 1: Zero flag (Z)
The Z flag is set if the result of an immediate arithmetic
operation or a data transfer is “0”, and cleared if the result is
anything other than “0”.
Bit 2: Interrupt disable flag (I)
The I flag disables all interrupts except for the interrupt
generated by the BRK instruction.
Interrupts are disabled when the I flag is “1”.
Bit 3: Decimal mode flag (D)
The D flag de termines whether additions and subtractions are
executed in binary or decimal. Binary arithmetic is executed
when this flag is “0”; decimal arithmetic is executed when it
is “1”.
Decimal correction is automatic in decimal mode. Only the
ADC and SBC instructions can execute decimal arithmetic.
Bit 4: Break flag (B)
The B flag is used to indicate that the current interrupt was
generated by the BRK instruction. The BRK flag in the
processor status register is always “0”. When the BRK
instruction is used to generate an interrupt, the processor
status register is pushed onto the stack with the break flag set
to “1”.
Bit 5: Index X mode flag (T)
When the T flag is “0” , arithmetic operations are performed
between accumulator and m emory. When the T flag is “1”,
direct arithmetic operations and direct data transfers are
enabled between memory locations.
Bit 6: Overflow flag (V)
The V flag is used during the addition or subtraction of one
byte of signed data. It is set if the result exceeds +127 to
128. When the BIT instruction is executed, bit 6 of the
memory location operated on by the BIT instructi on is store d
in the overflow flag.
Bit 7: Negative flag (N)
The N flag is set if the result of an arithm etic operation or
data transfer is negative. When the BIT instruction is
executed, bit 7 of the memory locati on operated on by the
BIT instruction is stored in the negative flag.
Ta ble 5 Set and clear instructions of each bit of processor status register
C flag Z flag I flag D flag B flag T flag V flag N flag
Set instruction SEC SEI SED SET −−
Clear instruction CLC CLI CLD CLT CLV
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 14 of 100
3803 Group (Spec.H QzROM version)
[CPU Mode Register (CPUM)] 003B16
The CPU mode regist er contains the stack page selection bit, the
internal system clock control bits, etc.
The CPU mode register is allocated at address 003B16.
Fig 9. Structure of CPU mode register
CPU mode register
(CPUM: address 003B16)
b7 b0
Stack page selection bit
0 : 0 page
1 : 1 page
Processor mode bits
b1 b0
0 0 : Single-chip mode
01:
1 0 : Not available
11:
Main clock division ratio selection bits
b7 b6
00:φ = f(XIN)/2 (high-speed mode)
01:φ = f(XIN)/8 (middle-speed mode)
10:φ = f(XCIN)/2 (low-speed mode)
1 1 : Not available
Fix this bit to “1”.
1
Port XC switch bit
0 : I/O port function (stop oscillating)
1:X
CIN-XCOUT oscillating function
Main clock (XIN-XOUT) stop bit
0 : Oscillating
1 : Stopped
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 15 of 100
3803 Group (Spec.H QzROM version)
MISRG
(1) Bit 0 of addr ess 001016: Oscillation stabilizing time
set after STP instruction released bit
When the MCU stops the clock oscillation by the STP
instruction and the STP instruction has been released by an
external interrupt source, usually, the fixed values of Timer 1
and Prescaler 12 (Timer 1 = 0116, Prescaler 12 = FF16) are
automatically reloaded in order for the oscillation to
stabilize. Th e use r can inhibit the a utomat ic sett ing by setti ng
“1” to bit 0 of MISRG (address 001016).
However, by setting this bit to “1”, the previous values, se t
just before the STP instructio n was executed, will remain in
Timer 1 and Prescaler 12. Therefore, you will need to set an
appropriate value to each regi ster, in ac cordance with the
oscillation stabilizing time, before executing the STP
instruction.
Figure 10 shows the structure of MISRG.
(2) Bits 1, 2, 3 of address 001016: Middle-speed Mode
Automatic Switch Function
In order to switch the clock mode of an MCU which has a
sub-clock, the following procedure is necessary:
set CPU mode register (003B16) --> start main clock
oscillation --> wait for oscillation stabili zation --> switch to
middle-speed mode (or high-speed mode).
However, the 3803 group (Spec.H QzROM version) has the
built-in function which automati cally switches from low to
middle-speed mode by program.
Middle-speed mode automatic switc h by program
The middle-speed mode can also be automatically switched
by program while operating in low-speed mode. By setting
the middle-speed auto ma tic switch start bit (bi t 3) of MISRG
(address 001016) to “1” in the condition that the middle-
speed mode automatic switc h set bit is “1” wh ile operating in
low-speed mode, the MCU will automatically switch to
middle-speed mode. In this case, the oscillation stabilizing
time of the main clock can be selected by the middle-speed
automatic switch wait time set bit (bit 2) of MISRG (address
001016).
Fig 10. Structure of MISRG
MISRG
MISRG: address 001016)
b7 b0
Oscillation stabilizing time set after STP instruction
released bit
0 : Automatically set “0116” to Timer 1, “FF16” to
Prescaler 12
1 : Automatically set disabled
Middle-speed mode automatic switch set bit
0 : Not set automatically
1 : Autom atic s w itching enabled (Note)
Middle-speed mode automatic switch wait time set bit
0 : 4.5 to 5.5 machine cycles
1 : 6.5 to 7.5 machine cycles
Middle-speed mode automatic switch start bit
(Depending on program)
0 : Invalid
1 : Automatic switch start (Note)
Not used (return “0” when read)
(Do not write “1” to this bit)
Note : When automatic switch to middle-speed mode from low-speed mode occurs,
the values of CPU mode register (3B16) change.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 16 of 100
3803 Group (Spec.H QzROM version)
MEMORY
Special Function Register (SFR) Area
The Special Function Register area in the zero page contains
control registers such as I/O p orts and timers.
RAM
The RAM is used for data storage and for stack area of
subroutine calls and interrupts.
•ROM
The first 128 bytes and the last 2 bytes of ROM ar e reserved for
device testing and the rest is a user area for storing programs. In
the QzROM version, 1 byte of address FFDB16 is also a reserved
area.
Interrupt Vector Area
The interrupt vector area contains reset and interrupt vectors.
Zero Page
Access to this area with only 2 bytes is possible in the zero page
addressing mode.
Special Page
Access to this area with only 2 bytes is possible in the special
page addressing mode.
ROM Code Protect Address (address FFDB16)
Address FFDB16, which is the reserved ROM area of QzROM, is
the ROM code protect address. “0016” or “FE16” is written into
this address when selecting the protect bit write by using a serial
programmer or selecting protect enabled for writing shipment by
Renesas Technology corp. When “0016” or “FE16” is set to the
ROM code protect address, the protect function is enabled, so
that reading or writing from/to QzROM is disabled by a serial
programmer.
As for the QzROM product in blank, the ROM code is protected
by selecting the protect bit write at ROM writing with a serial
programmer.
The protect can be performed, dividing twice. The protect area 1
is from the beginning addr ess of ROM to address “EFFF16”. As
for the QzROM product shipped after writing, “0016” (protect
enabled to all ar ea), “ FE16” (pr otect ena bled to t he protect area 1)
or “FF16” (protect disabl ed) is writte n into the ROM code protect
address when Renesas Technology corp. performs writing.
The writing of “0016”, “FE16” or “FF16” can be selected as ROM
option setup (“MASK option” written in the mask file converter)
when ordering.
<Notes>
Since the contents of RAM are undefined at reset, be sure to set
an initial value before use.
Fig 11. Memory map diagram
SFR area
Not used
Interrupt vector area
Zero page
Special page
Reserved ROM area
Reserved ROM area
(128 bytes)
User ROM area
RAM
ROM
010016
000016
004016
0FFF16
FF0016
0FE016
FFFE16
FFFF16
YYYY16
ZZZZ16
FFDB16
SFR area
Reserved ROM area
(ROM code protect address)
FFDC16
ROM area
ROM size
(bytes) Address
YYYY16
4096
8192
12288
16384
20480
24576
28672
32768
36864
40960
45056
49152
53248
57344
61440
F00016
E00016
D00016
C00016
B00016
A00016
900016
800016
700016
600016
500016
400016
300016
200016
100016
Address
ZZZZ16
F08016
E08016
D08016
C08016
B08016
A08016
908016
808016
708016
608016
508016
408016
308016
208016
108016
EFFF16
F00016
Protect area 1
083F16
Not used
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 17 of 100
3803 Group (Spec.H QzROM version)
Fig 12. Memory map of special function register (SFR)
000016
000116
000216
000316
000416
000516
000616
000716
000816
000916
000A16
000B16
000C16
000D16
000E16
000F16
001016
001116
001216
001316
001416
001516
001616
001716
001816
001916
001A16
001B16
001C16
001D16
001E16
001F16
002016
002116
002216
002316
002416
002516
002616
002716
002816
002916
002A16
002B16
002C16
002D16
002E16
002F16
003016
003116
003216
003316
003416
003516
003616
003716
003816
003916
003A16
003B16
003C16
003D16
003E16
003F16
Port P0 (P0)
Port P0 direction regist er (P0D)
Port P1 (P1)
Port P1 direction regist er (P1D)
Port P2 (P2)
Port P2 direction regist er (P2D)
Port P3 (P3)
Port P3 direction regist er (P3D)
Port P4 (P4)
Port P4 direction regist er (P4D)
Port P5 (P5)
Port P5 direction regist er (P5D)
Port P6 (P6)
Port P6 direction regist er (P6D)
Timer 12, X count source selection register (T12XCSS)
Timer Y, Z count source selection register (TYZCSS)
MISRG
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Transmit/Receive buffer regist er 1 (TB1/RB1)
Serial I/O 1 status register (SIO1STS)
Serial I/O1 control register (SIO1CON)
UART1 control register (UART1CON)
Baud rate generator (BRG1)
Serial I/O2 control register (SIO2CON)
Watchdog timer control register (WDTCON)
Serial I/O2 register (SIO2)
Prescaler 12 (PRE12)
Timer 1 (T1)
Timer 2 (T2)
Timer XY mode register (TM)
Prescaler X (PREX)
Timer X (TX)
Prescaler Y (PREY)
Timer Y (TY)
Timer Z low-order (TZL)
Timer Z high-order (TZH)
Timer Z mode register (TZM)
PWM control register (PWMCON)
PWM prescaler (PREPWM)
PWM register (PWM)
Baud rate generator 3 (BRG3)
Transmit/Receive buffer register 3 (TB3/RB3)
Serial I/O3 status register (SIO3STS)
Serial I/O3 control register (SIO3CON)
UART3 control register (UART3CON)
AD/DA control register (ADCON)
AD conversion register 1 (AD1)
DA1 conversion register (DA1)
DA2 conversion register (DA2)
AD conversion register 2 (AD2)
Interrupt source selection register (INTSEL)
Interrupt edge selection register (INTEDGE)
CPU mode register (CPUM)
Interrupt request register 1 (IREQ1)
Interrupt request register 2 (IREQ2)
Interrupt control register 1 (ICON1)
Interrupt control register 2 (ICON2)
Notes 1: Do not write any data to these addresses, because
these areas are reserved.
2: Do not access to the SFR area including nothing.
0FE016
0FE116
0FE216
0FE316
0FE416
0FE516
0FE616
0FE716
0FE816
0FE916
0FEA16
0FEB16
0FEC16
0FED16
0FEE16
0FEF16
0FF016
0FF116
0FF216
0FF316
0FF416
0FF516
0FF616
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Reserved (Note 1)
Port P0 pull-up control register (PULL0)
Port P1 pull-up control register (PULL1)
Port P2 pull-up control register (PULL2)
Port P3 pull-up control register (PULL3)
Port P4 pull-up control register (PULL4)
Port P5 pull-up control register (PULL5)
Port P6 pull-up control register (PULL6)
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 18 of 100
3803 Group (Spec.H QzROM version)
I/O PORTS
The I/O ports have direction registers which determine the
input/output direction of each individual pin. Each bit in a
direction register corresponds to one pin, and each pin can be set
to be input port or output port.
When “0” is written to the bit corresponding to a pin, that pin
becomes an input pin. When “1” is written to that bit, that pin
becomes an output pin.
If data is read from a pi n which is set to output, the value of the
port output latch is read, not the value of the pin itself. Pins set to
input are floating. If a pin set to input is written to, only the port
output latch is written to and the pin remains floating.
By setting the port P0 pull-up control register (address 0FF016)
to the port P6 pull-up control register (address 0FF616) ports can
control pull- up with a program. However, the contents of these
registers do not affect ports programmed as the output ports.
NOTES:
1. Refer to the applicable sections how to use double-function ports as function I/O ports.
2. Make sure that the input level at each pin is either 0 V or VCC during execution of the STP instruction.
When an input level is at an intermediate potential, a current will flow from VCC to VSS through the input-stage gate.
Ta ble 6 I/O port function
Pin Name Input/
Output I/O Structure Non-Port Function Related SFRs Ref.
No.
P00/AN8P07/AN15 Port P0 Input/output,
individual
bits
CMOS compatible
input level
CMOS 3-state
output
A/D converter input AD/DA control register (1)
P1
0
/INT
41
P1
1
/INT
01
Port P1 External interrupt input Interrupt edge selection register (2)
P12P17(3)
P20(LED0)
P27(LED7)Port P2
P30/DA1
P31/DA2Port P3 D/A converter output AD/DA control register (4)
P32, P33CMOS compatible
input level
N-channel
open-drain output
(5)
P34/RXD3
P35/TXD3
P36/SCLK3
P37/SRDY3
CMOS compatible
input level
CMOS 3-state
output
Serial I/O3 function I/O Serial I/O3 control register
UART3 control register (6)
(7)
(8)
(9)
P40/INT40/XCOUT
P41/INT00/XCIN Port P4 External interrupt input
Sub-clock generating circuit Interrupt edge selection register
CPU mode register (10)
(11)
P42/INT1
P43/INT2External interrupt input Interrupt edge selection register (2)
P44/RXD1
P45/TXD1
P46/SCLK1
Serial I/O1 function I/O Serial I/O1 control register
UART1 control register (6)
(7)
(8)
P47/SRDY1/CNTR2Serial I/O1 function I/O
Timer Z function I/O Serial I/O1 control register
Timer Z mode register (12)
P50/SIN2
P51/SOUT2
P52/SCLK2
P53/SRDY2
Port P5 Serial I/O2 function I/O Serial I/O2 control register (13)
(14)
(15)
(16)
P54/CNTR0
P55/CNTR1Timer X, Y function I/O Timer XY mode register (17)
P56/PWM PWM output PWM control register (18)
P57/INT3External interrupt input Interrupt edge selection register (2)
P60/AN0P67/AN7Port P6 A/D converter input AD/DA control register (1)
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 19 of 100
3803 Group (Spec.H QzROM version)
Fig 13. Port blo ck diagram (1)
(5) Ports P32, P33
(7) Ports P35, P45
(4) Ports P30, P31
Data bus
A/D converter input
(1) Ports P0, P6
(6) Ports P34, P44
Serial I/O enable bit
(2) Ports P10, P11, P42, P43, P57
(3) Ports P12 to P17, P2
Serial I/O output
P-channel
output
disable bit
(8) Ports P36, P46
Pull-up control bit
Pull-up control bit
Port latch
Direction
register
Pull-up control bit
Data bus Port latch
Direction
register
Data bus Port latch
Direction
register
Analog input pin
selection bit
Data bus
Interrupt input
Pull-up control bit
Port latch
Direction
register
Data bus
Pull-up control bit
Port latch
Direction
register
Data bus
D/A converter output
Pull-up control bit
Port latch
Direction
register
DA1 output enable bit (P30)
DA2 output enable bit (P31)
Data bus Port latch
Direction
register
Serial I/O input
Receive enable bit
Serial I/O enable bit
Transmit enable bit Serial I/O mode selection bit
Serial I/O clock outputSerial I/O external clock input
Serial I/O enable bit
Pull-up control bit
Data bus Port latch
Direction
register
Serial I/O synchronous cloc k
selection bit
Serial I/O enable bit
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 20 of 100
3803 Group (Spec.H QzROM version)
Fig 14. Port blo ck diagram (2)
(13) Port P50
(12) Port P47
(9) Port P37
(14) Port P51
(10) Port P40
(11) Port P41
INT40 Interrupt input
Serial I/O3 mode selection bit
Serial I/O3 ready output
Serial I/O3 enable bit
Pull-up control bit
Data bus Port latch
Direction
register
Port XC switch bit
Pull-up control bit
Data bus Port latch
Direction
register
Port XC
switch bit
INT00 Interrupt input
Port XC switch bit
Pull-up control bit
Data bus Port latch
Direction
register
Sub-clock generating circuit input
Timer output
CNTR2 interrupt input
Pull-up control bit
Data bus Port latch
Direction
register
Serial I/O2 output
Pull-up control bit
Data bus Por t la tch
Direction
register
Serial I/O2 transmit co mpletion signal
Serial I/O2 port selection bit
Pull-up control bit
Data bus Port latch
Direction
register
Serial I/O2 input
Serial I/O1 mode selection bit
Serial I/O1 enable bit
Bit 2
Bit 1
Bit 0
Timer Z operating
mode bits
Serial I/O1 ready output
P-channel
output
disable bit
Port XC
switch bit
SRDY3 output enable bit
SRDY1 output enable bit
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 21 of 100
3803 Group (Spec.H QzROM version)
Fig 15. Port blo ck diagram (3)
(18) Port P56
(15) Port P52(16) Port P53
(17) Ports P54, P55
CNTR Interrupt input
Pull-up control bit
Data bus Po r t la tc h
Direction
register
PWM output
PWM function enable bit
Pull-up control bit
Data bus Port latch
Direction
register
Serial I/O2 clock output
Pull-up control bit
Data bus Port latc h
Direction
register
Serial I/O2 port selection bit
Serial I/O2 synchronous cl ock
selection bit
Serial I/O2 external clock input
Serial I/O2 ready output
Pull-up control bit
Data bus Por t la tc h
Direction
register
Pulse output mode
Timer output
SRDY2 output enable bit
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 22 of 100
3803 Group (Spec.H QzROM version)
Fig 16. Structure of port pull-up control register (1)
b7 b0
Port P0 pull-up control register
(PULL0: address 0FF016)
P00 pull-up control bit
0: No pull-up
1: Pull-up
P01 pull-up control bit
0: No pull-up
1: Pull-up
P02 pull-up control bit
0: No pull-up
1: Pull-up
P03 pull-up control bit
0: No pull-up
1: Pull-up
P04 pull-up control bit
0: No pull-up
1: Pull-up
P05 pull-up control bit
0: No pull-up
1: Pull-up
P06 pull-up control bit
0: No pull-up
1: Pull-up
P07 pull-up control bit
0: No pull-up
1: Pull-up
Note: Pull-up control is valid when the corresponding
bit of the port direction register is “0” (input).
When that bit is “1” (output), pull-up cannot be
set to the port of which pull-up is selected.
b7 b0
Port P1 pull-up control register
(PULL1: address 0FF116)
P10 pull-up control bit
0: No pull-up
1: Pull-up
P11 pull-up control bit
0: No pull-up
1: Pull-up
P12 pull-up control bit
0: No pull-up
1: Pull-up
P13 pull-up control bit
0: No pull-up
1: Pull-up
P14 pull-up control bit
0: No pull-up
1: Pull-up
P15 pull-up control bit
0: No pull-up
1: Pull-up
P16 pull-up control bit
0: No pull-up
1: Pull-up
P17 pull-up control bit
0: No pull-up
1: Pull-up
Note: Pull-up control is valid when the corresponding
bit of the port direction register is “0” (input).
When that bit is “1” (output), pull-up cannot be
set to the port of which pull-up is selected.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 23 of 100
3803 Group (Spec.H QzROM version)
Fig 17. Structure of port pull-up control register (2)
b7 b0
Port P2 pull-up control register
(PULL2: address 0FF216)
P20 pull-up control bit
0: No pull-up
1: Pull-up
P21 pull-up control bit
0: No pull-up
1: Pull-up
P22 pull-up control bit
0: No pull-up
1: Pull-up
P23 pull-up control bit
0: No pull-up
1: Pull-up
P24 pull-up control bit
0: No pull-up
1: Pull-up
P25 pull-up control bit
0: No pull-up
1: Pull-up
P26 pull-up control bit
0: No pull-up
1: Pull-up
P27 pull-up control bit
0: No pull-up
1: Pull-up
Note: Pull-up control is valid when the corresponding
bit of the port direction register is “0” (input).
When that bit is “1” (output), pull-up cannot be
set to the port of which pull-up is selected.
b7 b0
Port P3 pull-up control register
(PULL3: address 0FF316)
P30 pull-up control bit
0: No pull-up
1: Pull-up
P31 pull-up control bit
0: No pull-up
1: Pull-up
Not used
(return “0” when read)
P34 pull-up control bit
0: No pull-up
1: Pull-up
P35 pull-up control bit
0: No pull-up
1: Pull-up
P36 pull-up control bit
0: No pull-up
1: Pull-up
P37 pull-up control bit
0: No pull-up
1: Pull-up
Note: Pull-up control is valid when the corresponding
bit of the port direction register is “0” (input).
When that bit is “1” (output), pull-up cannot be
set to the port of which pull-up is selected.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 24 of 100
3803 Group (Spec.H QzROM version)
Fig 18. Structure of port pull-up control register (3)
b7 b0
Port P4 pull-up control register
(PULL4: address 0FF416)
P40 pull-up control bit
0: No pull-up
1: Pull-up
P41 pull-up control bit
0: No pull-up
1: Pull-up
P42 pull-up control bit
0: No pull-up
1: Pull-up
P43 pull-up control bit
0: No pull-up
1: Pull-up
P44 pull-up control bit
0: No pull-up
1: Pull-up
P45 pull-up control bit
0: No pull-up
1: Pull-up
P46 pull-up control bit
0: No pull-up
1: Pull-up
P47 pull-up control bit
0: No pull-up
1: Pull-up
Note: Pull-up control is valid when the corresponding
bit of the port direction register is “0” (input).
When that bit is “1” (output), pull-up cannot be
set to the port of which pull-up is selected.
b7 b0
Port P5 pull-up control register
(PULL5: address 0FF516)
P50 pull-up control bit
0: No pull-up
1: Pull-up
P51 pull-up control bit
0: No pull-up
1: Pull-up
P52 pull-up control bit
0: No pull-up
1: Pull-up
P53 pull-up control bit
0: No pull-up
1: Pull-up
P54 pull-up control bit
0: No pull-up
1: Pull-up
P55 pull-up control bit
0: No pull-up
1: Pull-up
P56 pull-up control bit
0: No pull-up
1: Pull-up
P57 pull-up control bit
0: No pull-up
1: Pull-up
Note: Pull-up control is valid when the corresponding
bit of the port direction register is “0” (input).
When that bit is “1” (output), pull-up cannot be
set to the port of which pull-up is selected.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 25 of 100
3803 Group (Spec.H QzROM version)
Fig 19. Structure of port pull-up control register (4)
b7 b0
Port P6 pull-up control register
(PULL6: address 0FF616)
P60 pull-up control bit
0: No pull-up
1: Pull-up
P61 pull-up control bit
0: No pull-up
1: Pull-up
P62 pull-up control bit
0: No pull-up
1: Pull-up
P63 pull-up control bit
0: No pull-up
1: Pull-up
P64 pull-up control bit
0: No pull-up
1: Pull-up
P65 pull-up control bit
0: No pull-up
1: Pull-up
P66 pull-up control bit
0: No pull-up
1: Pull-up
P67 pull-up control bit
0: No pull-up
1: Pull-up
Note: Pull-up control is valid when the corresponding
bit of the port direction register is “0” (input).
When that bit is “1” (output), pull-up cannot be
set to the port of which pull-up is selected.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 26 of 100
3803 Group (Spec.H QzROM version)
Termination of unus e d pin s
Termination of common pins
I/O ports: Select an input port or an output port and follow
each processing method.
In addition, it is recommended that related
registers be overwritten periodically to prevent
malfunctions, etc.
Output ports: Open.
Input ports: If the input level become unstable, through current
flow to an input circuit, and the power supply
current may increase .
Especially, when expecting low consumption
current (at STP or WIT instruction execution etc.),
pull-up or pull-down input ports to prevent
through current (built-in resistor can be used).
We recommend processing unused pins through a
resistor which can secure IOH(avg) or IOL(avg).
Because, when an I/O port or a pin which have an
output function is selected as an input port, it may
operate as an output port by incorrect operation
etc.
Table 7 Termination of unused pins
Pins Termination
P0, P1, P2, P3, P4, P5, P6 Set to the input mode and connect each to VCC or VSS through a resistor of 1 k to 10 k.
Set to the output mode and open at “L” or “H” output state.
VREF Connect to VCC or VSS (GND).
AVSS Connect to VSS (GND).
XOUT Open (only when using external clock)
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 27 of 100
3803 Group (Spec.H QzROM version)
INTERRUPTS
The 3803 group (Spec.H QzROM version) interrupts are vector
interrupts with a fixed priority scheme, and generated by 16
sources among 21 sources: 8 external, 12 internal, and 1
software.
The interrupt sources, vector addresses(1), and interrupt priority
are shown in Table 8.
Each interrupt except the BRK instruction interrupt has the
interrupt request bit and the interrupt enable bit. These bits and
the interrupt disable flag (I flag) control the acceptance of
interrupt requests. Figure 20 shows an interrupt control diagram.
An interrupt requests is accepted when all of the following
conditions are satisfied:
Interrupt disable flag.............. ...................“0”
Interrupt request bit...................................“1”
Interrupt enable bit...................... .. ............“1”
Though the interrupt priority is determined by hardware, priority
processing can be performed by software using the above bits
and flag.
NOTES:
1. Vector addresses contain interrupt jump destination addresses.
2. Reset function in the same way as an interrupt with the highest priority.
Ta ble 8 Interrupt vector addresses and priority
Interrupt Source Priority Vector
Addresses(1) Interrupt Request Generating
Conditions Remarks
High Low
Reset(2) 1FFFD16 FFFC16 At reset Non-maskable
INT02FFFB16 FFFA16 At detection of either rising or falling
edge of INT0 input External interrupt
(active edge selectable)
Timer Z At timer Z underflow
INT13 FFF916 FFF816 At detection of either rising or falling
edge of INT1 input External interrupt
(active edge selectable)
Serial I/O1 reception 4 FFF716 FFF616 At completion of serial I/O1 data
reception Valid when serial I/O1 is selected
Serial I/O1
transmission 5 FFF516 FFF416 At completion of serial I/O1
transmission shift or when
transmission buffer is empty
Valid when serial I/O1 is selected
Timer X 6 FFF316 FFF216 At timer X underflow
Timer Y 7 FFF116 FFF016 At timer Y underflow
Timer 1 8 FFEF16 FFEE16 At timer 1 underflow STP release timer underflow
Timer 2 9 FFED16 FFEC16 At timer 2 underflow
CNTR010 FFEB16 FFEA16 At detection of either rising or falling
edge of CNTR0 input External interrupt
(active edge selectable)
CNTR111 FFE916 FFE816 At detection of either rising or falling
edge of CNTR1 input External interrupt
(active edge selectable)
Serial I/O3 reception At completion of serial I/O3 data
reception Valid when serial I/O3 is selected
Serial I/O2 12 FFE716 FFE616 At completion of serial I/O2 data
transmission or reception Valid when serial I/O2 is selected
Timer Z At timer Z underflow
INT213 FFE516 FFE416 At detection of either rising or falling
edge of INT2 input External interrupt
(active edge selectable)
INT314 FFE316 FFE216 At detection of either rising or falling
edge of INT3 input External interrupt
(active edge selectable)
INT415 FFE116 FFE016 At detection of either rising or falling
edge of INT4 input External interrupt
(active edge selectable)
CNTR2At detection of either rising or falling
edge of CNTR2 input External interrupt
(active edge selectable)
A/D conversion 16 FFDF16 FFDE16 At completion of A/D conversion
Serial I/O3
transmission At completion of serial I/O3
transmission shift or when
transmission buffer is empty
Valid when serial I/O3 is selected
BRK instruction 17 FFDD16 FFDC16 At BRK instruction execution Non-maskable software interrupt
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 28 of 100
3803 Group (Spec.H QzROM version)
Fig 20. Interrupt control diagram
Interrupt Disable Flag
The interrupt disable flag is assigned to bit 2 of the processor
status register. This flag controls the acceptance of all interrupt
requests except for the BRK instruction. When this flag is set to
“1”, the acceptance of interrupt requests is disabled. When it is
set to “0”, acceptance of interrupt requests is enabled. This flag is
set to “1” with the S ET instruction and set to “0” with th e CLI
instruction.
When an interrupt request is accepted, the contents of the
processor status register are pushe d onto the stack while the
interrupt disable flag remains set to “0”. Subsequently, this flag
is automatically set to “1” and multipl e interrupts are disabled.
To use multiple interrupts, set this flag to “0” with the CLI
instruction within the interrupt processing routine.
The contents of the processor status regist er are popped off the
stack with the RTI instruction.
Interrupt Request Bits
Once an interrupt request is generated, the corresponding
interrupt request bit is set to “1” and remains “1 ” until the reque st
is accepted. When the request is accepted, this bit is
automatically set to “0”.
Each interrupt request bit can be set to “0”, but cannot be set to
“1”, by software.
Interrupt Enable Bits
The interrupt enable bits control the acceptance of the
corresponding interrupt requests. When an interrupt enable bit is
set to “0”, the acceptance of the corresponding interrupt request
is disabled. If an interrupt request occurs in this condition, the
corresponding interrupt request bit is set to “1”, but the interrupt
request is not accepted. When an interrupt en able bit is set to “ 1”,
acceptance of the corresponding interrupt request is enabled.
Each interrupt enable bit can be set to “0” or “1” by software.
The interrupt enable bit for an unused interrupt should be set to
“0”.
Interrupt Source Selection
Any of the following combinations can be selected by the
interrupt source selection register (003916).
1. INT0 or timer Z
2. CNTR1 or Serial I/O3 reception
3. Serial I/O2 or timer Z
4. INT4 or CNTR2
5. A/D conversion or serial I/O3 transmission
External Interrupt Pin Selection
For external interrupts INT0 and INT4, the INT0, INT4 interrupt
switch bit in the interr upt edge selection register (bit 6 of address
003A16) can be used to select INT00 and INT40 pin input or
INT01 and INT41 pin input.
Interrupt disable flag (I)
Interrupt request
Interrupt request bit
Interrupt enable bit
BRK instruction
Reset
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 29 of 100
3803 Group (Spec.H QzROM version)
Fig 21. Structure of interrupt-related registers
Interrupt edge selection register
(INTEDGE : address 003A16)
INT0 interrupt edge selection bit
INT1 interrupt edge selection bit
Not used (returns “0” when read)
INT2 interrupt edge selection bit
INT3 interrupt edge selection bit
INT4 interrupt edge selection bit
INT0, INT4 interrupt switch bit
0 : INT00, INT40 interrupt
1 : INT01, INT41 interrupt
Not used (returns “0” when read)
0 : Falling edge active
1 : Rising edge active
Interrupt request register 1
(IREQ1 : address 003C16)
INT0/Timer Z interrupt request bit
INT1 interrupt request bit
Serial I/O1 receive interr upt reques t bit
Serial I/O1 transmit interru pt requ est bit
Timer X interrupt request bit
Timer Y interrupt request bit
Timer 1 interrupt request bit
Timer 2 interrupt request bit
Interrupt request regist er 2
(IREQ2 : address 003D16)
CNTR0 interrupt request bit
CNTR1/Serial I/O3 receive interrupt
request bit
Serial I/O2/Timer Z interrupt request bit
INT2 interrupt request bit
INT3 interrupt request bit
INT4/CNTR2 interrupt request bit
AD converter/Serial I/O3 transmit
interrupt request bit
Not used (returns “0” when read)
0 : No interrupt request issued
1 : Interrupt request issued
Interrupt control register 1
(ICON1 : address 003E16)
INT0/Timer Z interrupt enable bit
INT1 interrupt enable bit
Serial I/O1 receive interrupt enable bit
Serial I/O1 transmit interrupt enable bit
Timer X interrupt enable bit
Timer Y interrupt enable bit
Timer 1 interrupt enable bit
Timer 2 interrupt enable bit
Interrupt control register 2
(ICON2 : address 003F16)
b7 b0
b7 b0
b7 b0
b7 b0
0 : Falling edge active
1 : Rising edge active
CNTR0 interrupt enable bit
CNTR1/Serial I/O3 receive interrupt
enable bit
Serial I/O2/Timer Z interrupt enable bit
INT2 interrupt enable bit
INT3 interrupt enable bit
INT4/CNTR2 interrupt enable bit
AD converter/Serial I/O3 transmit
interrupt enable bit
Not used (returns “0” when read)
(Do not write “1”.)
0 : Interrupts disabled
1 : Interrupts enabled
b7 b0
Interrupt source selection register
(INTSEL : address 003916)
INT0/Timer Z interrupt source selection bit
0 : INT0 interrupt
1 : Timer Z interrupt
Serial I/O2/Timer Z interrupt source selection bit
0 : Serial I/O2 interrupt
1 : Timer Z interrupt
Not used (Do not write “1”.)
INT4/CNTR2 interrupt source selection bit
0 : INT4 interrupt
1 : CNTR2 interrupt
Not used (Do not write “1”.)
CNTR1/Serial I/O3 receive interrupt source selection bit
0 : CNTR1 interrupt
1 : Serial I/O3 receive interrupt
AD converter/Serial I/O3 transmit interrupt source selection bit
0 : A/D converter interrupt
1 : Serial I/O3 transmit interrupt
(Do not write “1” to these bits simultaneously.)
b7 b0
0 : No interrupt request issued
1 : Interrupt request issued
0 : Interrupts disabled
1 : Interrupts enabled
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 30 of 100
3803 Group (Spec.H QzROM version)
Interrupt Request Generation, Acceptance, and Handling
Interrupts have the following three phases.
(i) Interrupt Request Generation
An interrupt request is generated by an interrupt source
(external interrupt signal input, timer underflow, etc.) and
the corresponding request bit is set to “1”.
(ii) Interrupt Request Acceptance
Based on the interrupt acceptance timing in each instruction
cycle, the interrupt control circuit determines acceptance
conditions (interrupt request bit, interrupt enable bit, and
interrupt disable flag) and interrupt priority levels for
accepting interrupt requests. When two or more interrup t
requests are generated simultaneously, the highest priority
interrupt is accepted. The value of interrupt request bi t for
an unaccepted interrupt remains the same and acceptance is
determined at th e next in terrupt acceptance timing point.
(iii) Handling of Accepted Interrupt Request
The accepted in te rrupt request is processed.
Figure 22 shows the time up to execution in the interrupt
processing routine, and Figure 23 shows the interrupt sequence.
Figure 24 shows the timing of interrupt request generation,
interrupt request bit, and interrupt reques t acceptance.
Interrupt Handling Execution
When interrupt handling is executed, the following operations
are performed automatically.
(1) Once the currently executing instruction is completed, an
interrupt request is accept ed.
(2) The contents of the program counters and the processor
status register at this point are pushed onto the stack area in
order from 1 to 3.
1. High-order bits of program counter (PCH)
2. Low-order bits of program counter (PCL)
3. Processor status register (PS)
(3) Concurrently with the push operation, the jump address of
the corresponding interrupt (the start address of the interrupt
processing routine) is transferred from the interrupt vector to
the program counter.
(4) The interrupt request bit for the corresponding interrupt is
set to “0”. Also, the interrupt disable flag is se t to “1” and
multiple interrupts are disabled.
(5) The interrupt routine is executed.
(6) When the RTI instruction is executed, the contents of the
registers pushed onto the stack area are popped off in the
order from 3 to 1. Then, the routine that was before running
interrupt processing resumes.
As described above, it is necessary to set the stack pointer and
the jump address in the vector area corresponding to each
interrupt to execute the interrupt processing routine.
Fig 22. Time up to execution in interrupt routine
7 cycles
Interrupt request
generated Interrupt re quest
acceptance Interrupt routine
starts
Interrupt sequence
*
0 to 16 cycles
7 to 23 cycles
* When executing DIV instruction
Main routine Stack push and
Vector fetch Interrupt handling
routine
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 31 of 100
3803 Group (Spec.H QzROM version)
Fig 23. Interrupt sequence
Fig 24. Timing of interrupt request generation, interrupt request bit, and interrupt acceptance
φ
SYNC
RD
WR
Push onto stack
Vector fetch
Address bus
Data bus
Execute interrupt
routine
PC S,SPS S-1,SPS S-2,SPS BLBHAL,AH
Not used PCHPCLPS ALAH
SYNC : CPU operation code fetch cycle
(This is an internal signal that cannot be observed from the external unit.)
BL, BH: Vector address of each interrupt
AL, AH: Jump destination address of each interrupt
SPS : “0016” or “0116
([SPS] is a page selected by the stack page selecti on bit of CPU mode register.)
T1
(1) The interrupt request bit for an interrupt request ge nerated during period 1 is set to “1” at timing point IR1.
(2) The interrupt request bit for an interrupt request ge nerated during period 2 is set to “1” at timing point IR1 or I R2.
The timing point at which the bit is set to “1” varies depending on conditions. When two or more interrupt
requests are generated during the period 2, each request bit may be set to “1” at timing point IR1 or IR2
separately.
T1 T2 T3 : Interrupt acceptance timing points
IR1 IR2 : Timings points at which the interrupt request bit is set to “1”.
Note : Period 2 indicates the last φ cycle during one instruction cycle.
IR1T2
SYNC
IR2T3
12
Internal clock φ
Instruction cycle Push onto stac k
Vector fetch Instruction cycle
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 32 of 100
3803 Group (Spec.H QzROM version)
<Notes>
The interrupt request bit ma y be set to “ 1” in the following c ases.
When setting the external interrupt active edge
Related bits:
INT0 interrupt edge selection bit
(bit 0 of interrupt edge selection register (address 003A16))
INT1 interrupt edge selection bit
(bit 1 of interrupt edge selection register (address 003A16))
INT2 interrupt edge selection bit
(bit 3 of interrupt edge selection register (address 003A16))
INT3 interrupt edge selection bit
(bit 4 of interrupt edge selection register (address 003A16))
INT4 interrupt edge selection bit
(bit 5 of interrupt edge selection register (address 003A16))
CNTR0 activate edge switch bit
(bit 2 of timer XY mode register (address 002316))
CNTR1 activate edge switch bit
(bits 6 of timer XY mode register (address 002316))
CNTR2 activate edge switch bit
(bits 5 of timer Z mode register (address 002A16))
When switching the interrupt sources of an interrupt vector
address where two or more interrupt sources are assigned
Related bits:
INT0, INT4 interrupt switch bit
(bit 6 of interrupt edge selection register (address 003A16))
INT0/Timer Z interrupt source selection bit
(bit 0 of interrupt source selection register (address 003916))
Serial I/O2/Timer Z interrupt source selection bit
(bit 1 of interrupt source selection register (address 003916))
INT4/CNTR2 interrupt source selection bit
(bit 4 of interrupt source selection register (address 003916))
CNTR1/Serial I/O3 receive interrupt source selection bit
(bit 6 of interrupt source selection register (address 003916))
AD conversion/Serial I/O3 transmit interrupt source selection bit
(bit 6 of interrupt source selection register (address 003916))
If it is not necessary to generate an interrupt synchronized with
these settings, take the following sequence.
(1) Set the corresponding enable bit to “0” (disabled).
(2) Set the interrupt edge selection bit (the active edge switch
bit) or the interrupt source bit.
(3) Set the corresponding interrupt request bit to “0” after one
or more instructions have been executed.
(4) Set the corresponding interrupt enable bit to “1” (enabled).
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 33 of 100
3803 Group (Spec.H QzROM version)
TIMERS
8-bit Timers
The 3803 group (Spec.H QzROM version) has four 8-bit timers:
timer 1, timer 2, timer X, an d time r Y.
The timer 1 and timer 2 use one prescaler in common, and the
timer X and timer Y use each prescaler. Those are 8-bit
prescalers. Each of the timers and prescalers has a timer latch or
a prescaler latch.
The division ratio of each timer or prescaler is given by 1/(n + 1),
where n is the value in the corresponding timer or prescaler latch.
All timers are down-counters. When the timer reaches “0016”, an
underflow occurs at the next count pulse and the contents of the
corresponding timer latch are reloaded into the timer and the
count is continued. When the timer underflows, the interrupt
request bit corresponding to that timer is set to “1”.
Timer divider
The divider count source is switched by the main clock division
ratio selection bits of CPU mode register (bits 7 and 6 at address
003B16). When these bits are “00” (high-speed mode) or “01”
(middle- speed mode ), XIN is selected. When these bits are “10”
(low-speed mode), XCIN is selected.
Prescaler 12
The prescaler 12 counts the output of the timer divider. The
count source is selected by the timer 12, X count source selection
register among 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256,
1/512, 1/1024 of f(XIN) or f(XCIN).
Timer 1 and Timer 2
The timer 1 and timer 2 counts the output of prescaler 12 and
periodically set the interrupt request bit.
Prescaler X and prescaler Y
The prescaler X and prescaler Y count the output of the timer
divider or f(XCIN). The count source is selected by the timer 12,
X count source selection register (address 000E16) and the timer
Y, Z count source selection register (address 000F16) among 1/2,
1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512, and 1/1024 of
f(XIN) or f(XCIN); and f(XCIN).
•Timer X and Timer Y
The timer X and timer Y can each select one of four operating
modes by setting the timer XY mode register (address 002316).
(1) Timer mode
Mode selection
This mode can be selected by setting “00” to the timer X
operating mode bits (bits 1 and 0) and the timer Y operating
mode bits ( bits 5 and 4) o f the timer XY mode registe r (address
002316).
Explanation of operation
The timer count operation is started by setting “0” to the timer X
count stop bit (bit 3) and the timer Y count stop bit (bit 7) of the
timer XY mode register (address 002316).
When the timer reac hes “0016”, an unde rflow occurs at the next
count pulse and the contents of timer latch are reloaded into the
timer and the count is continued.
(2) Pulse Output Mode
Mode selection
This mode can be selected by setting “01” to the timer X
operating mode bits (bits 1 and 0) and the timer Y operating
mode bits ( bits 5 and 4) o f the timer XY mode registe r (address
002316).
Explanation of operation
The operation is the same as the timer mode’s. Moreover the
pulse which is inverted each time the timer underflows is output
from CNTR0/CNTR1 pin. Regardless of the timer counting or
not the output of CNTR0/CNTR1 pin is initialized to the level of
specified by their active edge switch bits when writing to the
timer. When the CNTR0 active edge switch bit (bit 2) and the
CNTR1 active edge switch bit (bit 6) of the timer XY mode
register (address 002316) is “0”, the output starts with “H” level.
When it is “1”, the output starts with “L” level.
Switching the CNTR0 or CNTR1 active edge switch bit will
reverse the output level of the corresponding CNTR0 or CNTR1
pin.
Precautions
Set the double-function port of CNTR0/CNTR1 pin and port
P54/P55 to output in this mode.
(3) Event Counter Mode
Mode selection
This mode can be selected by setting “10” to the timer X
operating mode bits (bits 1 and 0) and the timer Y operating
mode bits ( bits 5 and 4) o f the timer XY mode registe r (address
002316).
Explanation of operation
The operation is the same as the timer mode’s except that the
timer counts signals input from the CNTR0 or CNTR1 pin. The
valid edge for the count operation depends on the CNTR 0 active
edge switch bit (bit 2) or the CNTR1 active edge switch bit (bit 6)
of the timer XY mode register (address 002316). When it is “0”,
the rising edge is valid. When it is “1”, the falling edge is valid.
Precautions
Set the double-function port of CNTR0/CNTR1 pin and port
P54/P55 to input in this mode.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 34 of 100
3803 Group (Spec.H QzROM version)
(4) Pulse Width Measurement Mode
Mode selection
This mode can be selected by setting “11” to the timer X
operating mode bits (bits 1 and 0) and the timer Y operating
mode bits (bits 5 and 4) of the timer XY mode register (address
002316).
Explanation of operation
When the CNTR0 active edge switch bit (bit 2) or the CNTR1
active edge switch bit (bit 6) of the timer XY mode register
(address 002316) is “1”, the timer counts during the term of one
falling e dge of CNTR0/CNTR1 pin input until the next rising
edge of input (“L” term). When it is “0”, the timer counts during
the term of one rising edge input until the next falling edge input
(“H” term).
Precautions
Set the double-function port of CNTR0/CNTR1 pin and port
P54/P55 to input in this mode.
The count operation can be stopped by setting “1” to the timer X
count stop bit (bit 3) and the timer Y count stop bit (bit 7) of the
timer XY mode register (address 002316). The interrupt request
bit is set to “1” each time the timer underflows.
Precautions when switching count source
When switching the count source by the timer 12, X and Y count
source selection bits, the value of timer count is altered in
inconsiderable amount owing to generating of thin pulses on the
count input signals.
Therefore, select the timer count source before setting the value
to the prescaler and the timer.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 35 of 100
3803 Group (Spec.H QzROM version)
Fig 25. Block diagram of timer X, timer Y, timer 1, and timer 2
Q
Q
“1”
“0”
P54/CNTR0
Q
Q
P55/CNTR1
“0”
“1”
R
R
“1”
“0”
“0”
“1”
T
T
Prescal e r X la tch (8)
Prescaler X (8 )
Timer X latch (8)
Timer X (8) To timer X inte rrupt
request bit
Toggle flip-flop
Timer X count stop bit
Pulse width
measurement
mode
Event
counter
mode To CNTR0 interrupt
request bit
Pulse output mode
Port P54
latch
Port P54
direction register
CNTR0 active
edge switch bit
Timer X latch write pulse
Pulse output mode
Timer mode
Pulse output mode
Prescale r Y la tch (8)
Prescal e r Y (8 )
Timer Y latch (8)
Timer Y (8) To timer Y interrupt
request bit
Toggle flip-flop
Timer Y count stop bit
To CNTR1 interrupt
request bit
Pulse output mode
Port P55
latch
Port P55
direction register
CNTR1 active
edge switch bit
Timer Y latch write pulse
Pulse output mode
Timer mode
Pulse output mode
Prescaler 12 latch (8)
Prescaler 12 (8)
Timer 1 latch (8)
Timer 1 (8)
Timer 2 latch (8)
Timer 2 (8) To timer 2 interrupt
request bit
To timer 1 interrupt
request bit
CNTR0 active
edge switch bit
CNTR1 active
edge switch bit
Pulse width
measurement
mode
Event
counter
mode
Clock for timer 12
Data bus
Data bus
Data bus
Clo c k fo r ti mer 1 2
XIN (1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512, 1/1024)
Divider
Clo c k fo r time r Y
Count source
selection bit
Main clock
division ratio
selection bits
“00”
“11”
“10”
XCIN
Clock fo r time r X
f(XCIN)
Count source selection bit
f(XCIN)
Clock for timer Y
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 36 of 100
3803 Group (Spec.H QzROM version)
Fig 26. Structure of timer XY mode register
b7 Timer XY mode register
(TM : address 002316)
Timer X operating mode bits
b1 b0
0 0: Timer mode
0 1: Pulse output mode
1 0: Event counter mode
1 1: Pulse width measurement mode
CNTR0 active edge switch bit
0: Interrupt at falling edge
Count at rising edge in event counter mode
1: Interrupt at rising edge
Count at falling edge in event counter mode
Timer X count stop bit
0: Count start
1: Count stop
Timer Y operating mode bits
b5 b4
0 0: Timer mode
0 1: Pulse output mode
1 0: Event counter mode
1 1: Pulse width measurement mode
CNTR1 active edge switch bit
0: Interrupt at falling edge
Count at rising edge in event counter mode
1: Interrupt at rising edge
Count at falling edge in event counter mode
Timer Y count stop bit
0: Count start
1: Count stop
b0
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 37 of 100
3803 Group (Spec.H QzROM version)
Fig 27. Structure of timer 12, X and timer Y, Z count source selection registers
b7 b0 Timer 12, X count source selection register
(T12XCSS : address 000E16)
Timer 12 count source selection bits
b3 b2 b1 b0
0000:f(X
IN)/2 or f(XCIN)/2
0001:f(XIN)/4 or f(XCIN)/4
0 0 1 0 : f(XIN)/8 or f(XCIN)/8
0 0 1 1 : f(XIN)/16 or f(XCIN)/16
0 1 0 0 : f(XIN)/32 or f(XCIN)/32
0 1 0 1 : f(XIN)/64 or f(XCIN)/64
0 1 1 0 : f(XIN)/128 or f(XCIN)/128
0 1 1 1 : f(XIN)/256 or f(XCIN)/256
1 0 0 0 : f(XIN)/512 or f(XCIN)/512
1 0 0 1 : f(XIN)/1024 or f(XCIN)/1024
1 0 1 0 :
1 0 1 1 :
1 1 0 0 :
1 1 0 1 :
1 1 1 0 :
1 1 1 1 :
Not used
Timer X count source selection bits
b7 b6 b5 b4
0000:f(X
IN)/2 or f(XCIN)/2
0001:f(XIN)/4 or f(XCIN)/4
0 0 1 0 : f(XIN)/8 or f(XCIN)/8
0 0 1 1 : f(XIN)/16 or f(XCIN)/16
0 1 0 0 : f(XIN)/32 or f(XCIN)/32
0 1 0 1 : f(XIN)/64 or f(XCIN)/64
0 1 1 0 : f(XIN)/128 or f(XCIN)/128
0 1 1 1 : f(XIN)/256 or f(XCIN)/256
1 0 0 0 : f(XIN)/512 or f(XCIN)/512
1 0 0 1 : f(XIN)/1024 or f(XCIN)/1024
1 0 1 0 : f(XCIN)
1 0 1 1 :
1 1 0 0 :
1 1 0 1 :
1 1 1 0 :
1 1 1 1 :
Not used
b7 b0 Timer Y, Z count source selection register
(TYZCSS : address 000F16)
Timer Y count source selection bits
b3 b2 b1 b0
0000:f(X
IN)/2 or f(XCIN)/2
0001:f(X
IN)/4 or f(XCIN)/4
0 0 1 0 : f(XIN)/8 or f(XCIN)/8
0 0 1 1 : f(XIN)/16 or f(XCIN)/16
0 1 0 0 : f(XIN)/32 or f(XCIN)/32
0 1 0 1 : f(XIN)/64 or f(XCIN)/64
0 1 1 0 : f(XIN)/128 or f(XCIN)/128
0 1 1 1 : f(XIN)/256 or f(XCIN)/256
1 0 0 0 : f(XIN)/512 or f(XCIN)/512
1 0 0 1 : f(XIN)/1024 or f(XCIN)/1024
1 0 1 0 : f(XCIN)
Timer Z count source selection bits
b7 b6 b5 b4
0000:f(XIN)/2 or f(XCIN)/2
0001:f(XIN)/4 or f(XCIN)/4
0 0 1 0 : f(XIN)/8 or f(XCIN)/8
0 0 1 1 : f(XIN)/16 or f(XCIN)/16
0 1 0 0 : f(XIN)/32 or f(XCIN)/32
0 1 0 1 : f(XIN)/64 or f(XCIN)/64
0 1 1 0 : f(XIN)/128 or f(XCIN)/128
0 1 1 1 : f(XIN)/256 or f(XCIN)/256
1 0 0 0 : f(XIN)/512 or f(XCIN)/512
1 0 0 1 : f(XIN)/1024 or f(XCIN)/1024
1 0 1 0 : f(XCIN)
1 0 1 1 :
1 1 0 0 :
1 1 0 1 :
1 1 1 0 :
1 1 1 1 :
Not used
1 0 1 1 :
1 1 0 0 :
1 1 0 1 :
1 1 1 0 :
1 1 1 1 :
Not used
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 38 of 100
3803 Group (Spec.H QzROM version)
16-bit Timer
The timer Z is a 16-bit timer. When the timer reaches “000016”,
an underflow occurs at the next count pulse and the
corresponding timer latch is reloaded into the timer and the count
is continued. When the timer un derflows, the interrupt request bit
corresponding to the timer Z is set to “1”.
When reading/writing to the timer Z, perform reading/writing to
both the high-order byte and the low-order byte. When reading
the timer Z, read from the high-order byte first, followed by the
low-order byte. Do not perform the writing to the timer Z
between read operation of the high-order byte and read operation
of the low-order byte. When writing to the timer Z, write to the
low-order byte first, followed by the high-order byte. Do not
perform the reading to the timer Z between write operation of the
low-order byte and write operation of the high-order byte.
The timer Z can select the count source by the timer Z count
source selection bits of timer Y, Z count source selection register
(bits 7 to 4 at address 000F16).
Timer Z can select one of seven operating modes by setting the
timer Z mode register (address 002A16).
(1) Timer mode
Mode selection
This mode can be selected by setting “000” to the timer Z
operating mode bits (bits 2 to 0) and setting “0” to the
timer/event counter mode switch bit (b7) of the timer Z mode
register (address 002A16).
Count source selection
In high- or middle-speed mo de, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64,
1/128, 1/256, 1/512 or 1/1024 of f(XIN); or f(XCIN) can be
selected as th e count source.
In low-speed mode, 1/2, 1/4, 1/8, 1/16, 1/3 2, 1/64, 1/128, 1/256,
1/512 or 1/1024 of f(XCIN); or f(XCIN) can be selected as the
count source.
Interrupt
When an underflow occurs, the INT0/timer Z interrupt request bit
(bit 0) of the interrupt request register 1 (address 003C16) is set to
“1”.
Explanation of operation
During timer stop, usually write data to a latch and a timer at the
same time to set the timer value.
The timer count operation is started by setting “0” to the timer Z
count stop bit (bit 6) of the timer Z mode register (address
002A16).
When the timer reaches “000016”, an underflow occurs at the
next count pulse and the contents of timer latch are reloaded into
the timer and the count is continued.
When writing data to the timer during operation, the data is
written only into the latch. Then the new latch value is reloaded
into the timer at the next underflow.
(2) Event counter mode
Mode selection
This mode can be selected by setting “000” to the timer Z
operating mode bits (bits 2 to 0) and setting “1” to the
timer/event counter mode switch bit (bit 7) of the timer Z mode
register (address 002A16).
The valid edge for the count operation depends on the CNTR2
active edge switch bit (bit 5) of the timer Z mode register
(address 002A16). When it is “0”, the rising edge is valid. When
it is “1”, the falling edge is valid.
Interrupt
The interrupt at an underflow is the same as the timer mode’s.
Explanation of operation
The operation is the same as the timer mode’s.
Set the double-function port of CNTR2 pin and por t P47 to input
in this mode.
Figure 30 shows the timing chart of the timer/event counter
mode.
(3) Pul se output mode
Mode selection
This mode can be selected by setting “001” to the timer Z
operating mode bits (bits 2 to 0) and setting “0” to the
timer/event counter mode switch bit (b7) of the timer Z mode
register (address 002A16).
Count source selection
In high- or middle-speed mo de, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64,
1/128, 1/256, 1/512 or 1/1024 of f(XIN); or f(XCIN) can be
selected as th e count source.
In low-speed mode, 1/2, 1/4, 1/8, 1/16, 1 /32, 1/64, 1/128, 1/256,
1/512 or 1/1024 of f(XCIN); or f(XCIN) can be selected as the
count source.
Interrupt
The interrupt at an underflow is the same as the timer mode’s.
Explanation of operation
The operation is the same as the timer mode’s. Moreover the
pulse which is inverted each time the timer underflows is output
from CNTR2 pin. When the CNTR2 active edge switch bit (bit 5)
of the timer Z mode register (address 002A16) is “0”, the output
starts with “H” level. When it is “1”, the output starts with “L”
level.
Precautions
The double-function port of CNTR2 pin and port P47 is
automatically se t to the timer pulse output port in this mode.
The output from CNTR2 pin is initialized to the level depending
on CNTR2 active edge switch bit by writing to the timer.
When the value of the CNTR2 active edge switch bit is changed,
the output level of CNTR2 pin is inverted.
Figure 31 shows the timing chart of the pulse output mode.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 39 of 100
3803 Group (Spec.H QzROM version)
(4) Pulse pe riod measurement mode
Mode selection
This mode can be selected by setting “010” to the timer Z
operating mode bits (bits 2 to 0) and setting “0” to the
timer/event counter mode switch bit (b7) of the timer Z mode
register (address 002A16).
Count source selection
In high- or middle-speed mo de, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64,
1/128, 1/256, 1/512 or 1/1024 of f(XIN); or f(XCIN) can be
selected as th e count source.
In low-speed mode, 1/2, 1/4, 1/8, 1/16, 1/3 2, 1/64, 1/128, 1/256,
1/512 or 1/1024 of f(XCIN); or f(XCIN) can be selected as the
count source.
Interrupt
The interrupt at an underflow is the same as the timer mode’s.
When the pulse period measurement is completed, the
INT4/CNTR2 interrupt request bit (bit 5) of the interrupt request
register 2 (address 003D16) is set to “1”.
Explanation of operation
The cycle of the pulse which is input from the CNTR2 pin is
measured. When the CNTR2 active edge switch bit (bit 5) of the
timer Z mode register (address 002A16) is “0” , the timer counts
during the term from one falling edge of CNTR2 pin input to the
next falling edge. When it is “1”, the timer counts during the
term from one rising edge input to the next rising edge input.
When the valid edge of measurement completion/start is
detected, the 1’s com plement of the timer value is written to the
timer latch and “FFFF16” is set to the timer.
Furthermore when the timer underflows, the timer Z interrupt
request occurs and “FFFF16” is set to the timer. When reading
the timer Z, the value of the timer latch (measured value) is read.
The measured value is retained until the next measurement
completion.
Precautions
Set the double-function port of CNTR2 pin and port P47 to input
in this mode.
A read-out of timer value is impossible in this mode. The timer
can be written to only during timer stop (no measurement of
pulse period).
Since the timer latch in this mode is specialized for the read-out
of measured values, do not perform any write operation during
measurement.
“FFFF16” is set to the timer when the timer underflows or when
the valid edge of measurement start/completion is detected.
Consequently, the timer value at start of pulse period
measurement depends on the timer value just before
measurement start.
Figure 32 shows the timing chart of the pulse period
measurement mode.
(5) Pulse width measurement mode
Mode selection
This mode can be selected by setting “011” to the timer Z
operating mode bits (bits 2 to 0) and setting “0” to the
timer/event counter mode switch bit (b7) of the timer Z mode
register (address 002A16).
Count source selection
In high- or middle-speed mo de, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64,
1/128, 1/256, 1/512 or 1/1024 of f(XIN); or f(XCIN) can be
selected as th e count source.
In low-speed mode, 1/2, 1/4, 1/8, 1/16, 1 /32, 1/64, 1/128, 1/256,
1/512 or 1/1024 of f(XCIN); or f(XCIN) can be selected as the
count source.
Interrupt
The interrupt at an underflow is the same as the timer mode’s.
When the pulse widths measurement is completed, the
INT4/CNTR2 interrupt request bit (bit 5) of the interrupt request
register 2 (address 003D16) is set to “1”.
Explanation of operation
The pulse width which is input from the CNTR2 pin is measured.
When the CNTR2 active edge switch bit (bit 5) of the timer Z
mode register (address 002A16) is “0”, the timer counts during
the term from one rising edge input to the next falling edge input
(“H” term). When it is “1”, the timer counts during the term from
one falling edge of CNTR2 pin input to the next rising edge of
input (“L” term).
When the valid edge of measurement completion is detected, the
1’s complement of the timer value is written to the timer lat ch.
When the valid edge of measurement completion/start is
detected, “FFF F16” is set to the timer.
When the timer Z underflows, the timer Z interrupt occurs and
“FFFF16” is set to the timer Z. When reading the timer Z, the
value of the timer latch (measured value) is read. The measured
value is retained until the next measurement completion.
Precautions
Set the double-function port of CNTR2 pin and por t P47 to input
in this mode.
A read-out of timer value is impossible in this mode. The timer
can be written to only during timer stop (no measurement of
pulse widths).
Since the timer latch in this mode is specialized for the read-out
of measured values, do not perform any write operation during
measurement.
“FFFF16” is set to the timer when the timer underflows or when
the valid edge of measurement start/completion is detected.
Consequently, the timer value at start of pulse width
measurement depends on the timer value just before
measurement start.
Figure 33 shows the timing chart of the pulse width measurement
mode.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 40 of 100
3803 Group (Spec.H QzROM version)
(6) Programmable waveform generating mode
Mode selection
This mode can be selected by setting “100” to the timer Z
operating mode bits (bits 2 to 0) and setting “0” to the
timer/event counter mode switch bit (b7) of the timer Z mode
register (address 002A16).
Count source selection
In high- or middle-speed mo de, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64,
1/128, 1/256, 1/512 or 1/1024 of f(XIN); or f(XCIN) can be
selected as th e count source.
In low-speed mode, 1/2, 1/4, 1/8, 1/16, 1/3 2, 1/64, 1/128, 1/256,
1/512 or 1/1024 of f(XCIN); or f(XCIN) can be selected as the
count source.
Interrupt
The interrupt at an underflow is the same as the timer mode’s.
Explanation of operation
The operation is the same as the timer mode’s. Moreover the
timer outputs the data set in the output level latch (bit 4) of the
timer Z mode register (address 002A16) from the CNTR2 pin
each time the timer underflows.
Changing the value of the output level latch and the timer latch
after an underflow makes it possible to output an optional
waveform from the CNTR2 pin.
Precautions
The double-function port of CNTR2 pin and port P47 is
automatically se t to the p rogra mmable waveform generating port
in this mode.
Figure 34 shows the timing chart of the programmable waveform
generating mode.
(7) Programmable one-shot ge ne ra ting mode
Mode selection
This mode can be selected by setting “101” to the timer Z
operating mode bits (bits 2 to 0) and setting “0” to the
timer/event counter mode switch bit (b7) of the timer Z mode
register (address 002A16).
Count source selection
In high- or middle-speed mo de, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64,
1/128, 1/256, 1/512 or 1/1024 of f(XIN); or f(XCIN) can be
selected as th e count source.
Interrupt
The interrupt at an underflow is the same as the timer mode’s.
The trigger to generate one-shot pulse can be selected by the INT1
active edge selection bit (bit 1) of the interrupt edge selection
register (address 003A16). When it is “0”, the falling edge active is
selected; when it is “1”, the rising edge active is selected.
When the valid edge of the INT1 pin is detected, the INT1
interrupt request bit (bit 1) of the interrupt request register 1
(address 003C16) is set to “1”.
Explanation of operation
1. “H” one-shot pulse; Bit 5 of timer Z mode register = “0”
The output level of the CNTR2 pin is initialized to “L” at
mode selection. When trigger generation (input signal to
INT1 pin) is detected, “H” is output from the CNTR 2 pin.
When an underflow occurs, “L” is output. The “H” one-shot
pulse width is set by the setting value to the timer Z register
low-order and high-order. When trigger generating is
detected during timer count stop, although “H” is output
from the CNTR2 pin, “H” output state continues because an
underflow does not occur.
2. “L” one-shot pulse; Bit 5 of timer Z mode regist er = “1”
The output level of the CNTR2 pin is initialized to “H” at
mode selection. When trigger generation (input signal to
INT1 pin) is detected, “L” is output from the CNTR2 pin.
When an underflow occurs, “H” is output. The “L” one-shot
pulse width is set by the setting value to the timer Z low-
order and high-order. When trigger generating is detected
during timer count stop, although “L” is output fr om the
CNTR2 pin, “L” output state continues because an under-
flow does not occu r.
Precautions
Set the double-function port of INT1 pin and port P42 to input in
this mode.
The double-function port of CNTR2 pin and port P47 is
automatically set to the programmable one-shot generating port
in this mode.
This mode cannot be used in low-speed mode.
If the value of the CNTR2 active edge switch bit is changed
during one-shot generating enabled or generating one-shot pulse,
then the output level from CNTR2 pin changes.
Figure 35 shows the timing chart of the programmable one-shot
generating mode.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 41 of 100
3803 Group (Spec.H QzROM version)
<Notes regarding all mo de s>
Timer Z write control
Which write control can be selected by the timer Z write control
bit (bit 3) of the timer Z mode register (address 002A16), writing
data to both the latch and the timer at the same time or writing
data only to the latch.
When the operation “writi ng data only to the latch” is selected,
the value is set to the timer latch by writing data to the address of
timer Z and the timer is updated at next underflow. After reset
release, the operation “writing data to both the latch and th e timer
at the same time” is select ed, and the value is set to both the latch
and the timer at the same time by writing data to the address of
timer Z.
In the case of writing data only to the latch, if writing data to the
latch and an underflow are performed almost at the same time,
the timer value may become undefined.
Timer Z read control
A read-out of timer value is impossible in pulse period
measurement mode and pulse width measurement mode. In the
other modes, a read-out of timer value is possible regardless of
count operating or stopped. However, a read-out of timer latch
value is impossible.
Switch of interrupt active edge of CNTR2 and INT1
Each interrupt active edge depends on setting of the CNTR2
active edge switch bit and the INT1 active edge selection bit.
Switch of count source
When switching the count source by the timer Z count source
selection bits, the value of timer count is altered in
inconsiderable amount owing to generating of thin p ulses on the
count input signals.
Therefore, select the timer count source before setting the value
to the prescaler and the timer.
Usage of CNTR2 pin as normal I/O port P47
To use the CNTR2 pin as normal I/O port P47, set timer Z
operating mode bits (b2, b1, b0) of timer Z mode register
(address 002A16) to “000”.
Fig 28. Block diagram of timer Z
P47/CNTR2
“001”
XIN
Output level latch
Programmable one-shot
generating mode
CNTR2 active edge
switch bit Programmable one-shot
generating mode
Data bus
To timer Z interrupt
request bit
To INT1 interrupt
request bit
Programmable waveform
generating mode
Pulse output mode
CNTR2 active edge switch bit
Pulse output mode
Timer Z operating
mode bits
Port P47
direction register
Port P47
latch
Pulse period measurement mode
Pulse width measurement mode
Timer Z count stop bit
Count source
selection bit
(1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512, 1/1024)
Divider
Clock for timer z
CNTR2 active edge
switch bit
DQ
T
“1”
Timer/Event
counter mode
switch bit
“0”
“1”
“1”
“0”
P42/INT1Programmable one-shot
generating circuit
T
Q
S
Q
“100”
“101”
To CNTR2 interrupt
request bit
“0”
f(XCIN)
Edge detection circuit
“1”
“0”
Timer Z low-order latch
Timer Z low-order Timer Z high-order latch
Timer Z high-order
XCIN
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 42 of 100
3803 Group (Spec.H QzROM version)
Fig 29. Structure of timer Z mode register
b7 b0
Timer Z mode register
(TZM : address 002A16)
Timer Z operating mode bits
b2 b1 b0
0 0 0 : Timer/Event counter mode
0 0 1 : Pulse output mode
0 1 0 : Pulse period measurement mode
0 1 1 : Pulse width measurement mode
1 0 0 : Programmable waveform generating mode
1 0 1 : Programmable one-shot generating mode
1 1 0 : Not available
1 1 1 : Not available
Timer Z write control bit
0 : Writing data to both latch and timer simultaneously
1 : Writing data only to latch
Output level latch
0 : “L” output
1 : “H” output
CNTR2 active edge switch bit
0 : Event counter mode: Count at rising edge
Pulse output mode: Start outputting “H”
Pulse period measurement mode: Measurement between two falling edges
Pulse width measurement mode: Measurement of “H” term
Programmable one-shot generating mode: After start outputting “L”,
“H” one-shot pulse generated
Interrupt at falling edge
1 : Event counter mode: Count at falling edge
Pulse output mode: Start outputting “L”
Pulse period measurement mode: Measurement between two rising edges
Pulse width measurement mode: Measurement of “L” term
Programmable one-shot generating mode: After start outputting “H”,
“L” one-shot pulse generated
Interrupt at rising edge
Timer Z count stop bit
0 : Count start
1 : Count stop
Timer/Event counter mode switch bit (Note)
0 : Timer mode
1 : Event counter mode
Note: When selecting the modes except the timer/event counter mode, set “0” to this bit.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 43 of 100
3803 Group (Spec.H QzROM version)
Fig 30. Timing chart of timer/event counter mode
Fig 31. Timing chart of pulse output mode
FFFF16
000016
TL
TR TR TR
TL : Value set to timer latch
TR : Timer interrupt request
TR TR TR TR
Waveform output
from CNTR2 pin CNTR2CNTR2
FFFF16
000016
TL
TL : Value set to timer latch
TR : Timer interrupt request
CNTR2 : CNTR2 interrupt request
(CNTR2 active edge switch bit = “0”; Falling edge active)
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 44 of 100
3803 Group (Spec.H QzROM version)
Fig 32. Timing chart of pulse period measurement mode (Measuring term between two rising edges)
Fig 33. Timing chart of pulse width measurement mode (Measuring “L” term)
T3
TR TR
T2
T1
T2 T3
CNTR2 of rising edge active
TR : Timer interrupt request
CNTR2 : CNTR2 interrupt request
Signal input from
CNTR2 pin
CNTR2
FFFF16
000016
CNTR2CNTR2CNTR2
FFFF16FFFF16 + T1
T3
TR
T2
T1
T1T3
CNTR2 interrupt of rising edge active; Measurement of “L” width
TR : Timer interrupt request
CNTR2 : CNTR2 interrupt request
Signal input from
CNTR2 pin
CNTR2
FFFF16
000016
CNTR2CNTR2
FFFF16 + T2
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 45 of 100
3803 Group (Spec.H QzROM version)
Fig 34. Timing chart of programmable waveform generating mode
Fig 35. Timing chart of programmable one-shot generating mode (“H” one-shot pulse generating)
Signal output from
CNTR2 pin
FFFF16
000016
T3
T2
T1
T2
T3
L
LT1
TR TR TR TR
CNTR2CNTR2
L : Timer initial value
TR : Timer interrupt request
CNTR2 : CNTR2 interrupt request
(CNTR2 active edge switch bit = “0”; Falling edge active)
L
TR TR TR
LL
Signal input from
INT1 pin
FFFF16
L
CNTR2CNTR2
L : One-shot pulse width
TR : Timer interrupt request
CNTR2 : CNTR2 interrupt request
(CNTR2 active edge switch bit = “0”; Falling edge active)
Signal output from
CNTR2 pin
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 46 of 100
3803 Group (Spec.H QzROM version)
SERIAL INTERFACE
Serial I/O1
Serial I/O1 can be used as either clock synchronous or
asynchronous (UART) serial I/O. A dedicated timer is also
provided for baud rate generation.
(1) Clock Synchronous Serial I/O Mode
Clock synchr onous serial I/O1 mode can be selected by setting
the serial I/O1 mode selection bit of the serial I/O1 control
register (bit 6 of address 001A16) to “1”.
For clock synchronous serial I/O, the transmitter and the receiver
must use the same clock. If an internal clock is used, transfer is
started by a write signal to the transmit/receive buffer register.
Fig 36. Bl ock diagram of cl ock synchronous serial I/O1
Fig 37. Operation of clock synchronous serial I/O1
Serial I/O1 control register
Receive buffer register 1
Receive shift register 1
Clock control circuit
1/4
Baud rate generator 1
f(XIN)
1/4
Clock control circuitFalling-edge detector
Transmit buffer reg ister 1
Transmit shift register 1
Serial I/O1 status regi ster
F/F
Address 001816
Receive buffer full flag (RBF)
Receive interrupt request (RI)
Shift clock
Serial I/O1 synchronous clock selection bit
Frequency division ratio 1/(n+1)
Address 001C16
BRG count source selection bit
Address 001816
Shift clock Transmit shift completion flag (TSC)
Transmit buffer empty flag (TBE)
Transmit interrupt request (TI)
Transmit interrupt source selection bit
Address 001916
Address 001A16
Data bus
Data bus
P46/SCLK1
P44/RXD1
P45/TXD1
(f(XCIN) in low-speed mode)
P47/SRDY1
D7
D7
D0D1D2D3D4D5D6
D0D1D2D3D4D5D6
RBF = 1
TSC = 1
TBE = 0 TBE = 1
TSC = 0
Transfer shift clock
(1/2 to 1/2048 of the internal
clock, or an external clock)
Serial output TXD1
Serial input RXD1
Write pulse to receive/transmit
buffer register 1 (address 001816)
Overrun error (OE)
detection
Notes 1: As the transmit interrupt (TI), which can be selected, either when the transmit buffer has emptied (TBE=1) or after the transmit
shift operation has ended (TSC=1), by setting the transmit interrupt source selection bit (TIC) of the serial I/O1 control register.
2: If data is written to the transmit buffer register 1 when TSC=0, the transmit clock is generated continuously and serial data is output
continuously from the TXD1 pin.
3: The receive interrupt (RI) is set when the receive buffer full flag (RBF) becomes “1”.
Receive enable signal SRDY1
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 47 of 100
3803 Group (Spec.H QzROM version)
(2) Asynchronous Serial I/O (UART) Mode
Clock asynchronous serial I/O mode (UART) can be selected by
clearing the s erial I/O1 mode se lection bit (b6) of the serial I/O1
control register to “0”.
Eight serial data transfer formats can be selected, and the transfer
formats used by a transmitter and receiver must be identical.
The transmit and receive shift registers each have the buffer
register 1, but the two buffer registers have the same a ddre ss in a
memory. Since the shift register cannot be written to or read from
directly, transmit data is written to the transmit buffer register 1,
and receive data is read from the receive buffer register 1.
The transmit buffer register 1 can also hold the next data to be
transmitted, and the receive buffer register 1 can hold a character
while the next character is being received.
Fig 38. Block diagram of UART serial I/O1
Fig 39. Operation of UART serial I/O1
f(XIN)
1/4
OE
PE FE
1/16
1/16
Data bus
Data bus
Receive buffer register 1
Address 001816
Receive shift register 1
Receive buffer full flag (RBF)
Receive interrupt request (RI)
Baud rate generator
Frequency division ratio 1/(n+1)
Address 001C16
ST/SP/PA generator
Transmit buffer register 1
Transmit shift register 1
Address 001816
Transmit shift
completion flag (TSC)
Transmit buffer empty flag (TBE)
Transmit interrupt request (TI)
Address 001916
ST detector
SP detector UART1 control register
Address 001B16
Character length selection bit
Address 001A16
BRG count source selection bit
Transmit interrupt source selection bit
Serial I/O1 synchronous clock selection bit
Clock control circuit
Character length selection bit
7 bits
8 bits
Serial I/O1 status register
Serial I/O1 control register
P46/SCLK1
P44/RXD1
P45/TXD1
(f(XCIN) in low-speed mode)
TSC=0
TBE=1
RBF=0
TBE=0 TBE=0
RBF=1 RBF=1
TBE=1 TSC=1*
STD0D1SP D0D1ST SP
Transmit or
receive clock
Transmit buffer register 1
write signal
Serial output
TXD1
Receive buffer register 1
read signal
Serial input RXD1
Generated at 2nd bit in 2-stop-bit mode
1 start bit
7 or 8 data bit
1 or 0 parity bit
1 or 2 sto p bit (s)
Notes 1: Error flag detection occurs at the same time that the RBF flag becomes “1” (at 1st stop bit, during reception).
2: As the transmit interrupt (TI), when eit her the TBE or TSC flag becomes “1”, can be selec ted to occur depending on the setting of the transmit interrupt source
selection bit (TIC) of the serial I/O1 control register .
3: The receive interrupt (RI) is set when the RB F flag becomes “1” .
4: After data is written to the transmit buff er when TSC =1, 0.5 to 1. 5 cyc les of the data shift cycle are necessary until changing to TSC=0.
STD0D1SP D0D1ST SP
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 48 of 100
3803 Group (Spec.H QzROM version)
[Tr ansmit Buffer Register 1/Receive Buffer Register 1
(TB1/RB1)] 001816
The transmit buf fer register 1 and the receive buf fer r egister 1 are
located at the s ame addres s. The tra nsmit buffer is write-only and
the receive buffer is read-only. If a character bit lengt h is 7 bits,
the MSB of data stored in the receive buffer is “0”.
[Serial I/O1 Status Register (SIO1STS)] 001916
The read-only serial I/O1 status register consists of seven flags
(bits 0 to 6) which indicate the operating status of the serial I/O1
function and various errors.
Three of the flags (bits 4 to 6) are valid only in UART mode.
The receive buffer full flag (bit 1) is cleare d to “0” when the
receive buffer register 1 is read.
If there is an error, it is detected at the same time that data is
transferred from the receive shift register 1 to the re ceive buffer
register 1, and the receive buffer full flag is set. A write to the
serial I/O1 status re gister clears all the error flags OE, PE, FE,
and SE (bit 3 to bit 6, resp ectively). Writing “0” to the serial I/O1
enable bit SIOE (bit 7 of the serial I/O1 control register) also
clears all the stat us flags , including the error flags.
Bits 0 to 6 of the serial I/O1 st atus register are initialized to “0” at
reset, but if the transmit enable bit (bit 4) of the serial I/O1
control register has been set to “1”, the transmit shift completion
flag (bit 2) and the transmit buf fer em pty flag (bit 0) beco me “1”.
[Serial I/O1 Control Register (SIO1CON)] 001A16
The serial I/O1 control register consists of eight control bits for
the serial I/O1 function.
[UART1 Control Register (UART1CON)] 001B16
The UART control register consists of four control bits (bits 0 to
3) which are val id when asynchronous serial I/O is selected and
set the data format of an da ta tr ansfer, and one bit (bit 4) which is
always valid and sets the output structure of the P45/TXD1 pin.
[Baud Rate Generator 1 (BRG1)] 001C16
The baud rate generator determines the baud rate for serial
transfer.
The baud rate generator divides the frequency of the count source
by 1/(n + 1), where n is the value written to the baud rate
generator.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 49 of 100
3803 Group (Spec.H QzROM version)
Fig 40. Structure of serial I/O1 control registers
b7
Transmit buffer empty flag (TBE)
0: Buffer full
1: Buffer empty
Receive buffer full flag (RBF)
0: Buffer empty
1: Buffer full
Transmit shift completion flag (TSC)
0: Transmit shift in progress
1: Transmit shift completed
Overrun error flag (OE)
0: No error
1: Overrun error
Parity error flag (PE)
0: No error
1: Parity error
Framing error flag (FE)
0: No error
1: Framing error
Summing error flag (SE)
0: (OE) U (PE) U (FE)=0
1: (OE) U (PE) U (FE)=1
Not used (returns “1” when read)
UART1 control register
(UART1CON : address 001B16)
Character length selection bit (CHAS)
0: 8 bits
1: 7 bits
Parity enable bit (PARE)
0: Parity checking disabled
1: Parity checking enabled
Parity selection bit (P ARS)
0: Even parity
1: Odd parity
Stop bit length selection bit (STPS)
0: 1 stop bit
1: 2 stop bits
P45/TXD1 P-channel output disable bit (POFF)
0: CMOS output (in output mode)
1: N-channel open drain output (in output mode)
Not used (return “1” when read)
Serial I/O1 control register
(SIO1CON : address 001A16)
Serial I/O1 status register
(SIO1STS : address 001916)
b0 b7 b0
b7 b0
BRG count source selection bit (CSS)
0: f(XIN) (f(XCIN) in low-speed mode)
1: f(XIN)/4 (f(XCIN)/4 in low - spee d mode)
Serial I/O1 synchronous clock selection bit (SCS)
0: BRG output divided by 4 when clock synchronous
serial I/O1 is selected, BRG output divided by 16
when UART is selected.
1: External clock input when clock synchronous serial
I/O1 is selected, external clock input divided by 16
when UART is selected.
SRDY1 output enable bit (SRDY)
0: P47 pin operates as normal I/O pin
1: P47 pin operates as SRDY1 output pin
Transmit interrupt source selection bit (TIC)
0: Interrupt when transmit buffer has emptied
1: Interrupt when transmit shift operation is completed
Transmit enable bit (TE)
0: Transmit disabled
1: Transmit enabled
Receive enable bit (RE)
0: Receive disabled
1: Receive enabled
Serial I/O1 mode selection bit (SIOM)
0: Clock asynchronous (UART) serial I/O
1: Clock synchronous serial I/O
Serial I/O1 enable bit (SIOE)
0: Serial I/O1 disabled
(pins P44 to P47 operate as normal I/O pins)
1: Serial I/O1 enabled
(pins P44 to P47 operate as serial I/O1 pins)
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 50 of 100
3803 Group (Spec.H QzROM version)
<Notes concerning serial I/O1>
1. Notes when selecting clock synchronous serial I/O
1.1 Stop of transmission operation
•Note
Clear the serial I/O1 enable bit and the transmit enable bit to
“0” (serial I/O and transmit disabled).
•Reason
Since transmission is not stopped and the transmission circuit
is not initialized even if only the serial I/O1 enable bit is
cleared to “0” (seria l I/O disabled), the interna l transmission is
running (in this case, since pins TXD1, RXD1, SCLK1, and
SRDY1 function as I/O ports, the transmission data is not
output). When data is written to the transmit buffer register 1
in this state, data starts to be shifted to the transmit shift
register 1. When the serial I/O1 enable bit is set to “1” at this
time, the data during internally shifting is output to the TXD1
pin and an operation failure occurs.
1.2 Stop of receive operation
•Note
Clear the receive enable bit to “0” (receive disabled), or clear
the serial I/O1 en able bit to “0” (serial I/O disabled).
1.3 Stop of transmit/receive operation
Note
Clear both the transmit enable bit and receive enable bit to “0”
(transmit and receive disabled).
(when data is transmitted and received in the clock
synchronous serial I/O mode, any one of data tr ansmissio n and
reception cannot be stopped.)
•Reason
In the clock synchronous serial I/O mode, the same clock is
used for transmission and reception. If any one of transmission
and reception is disabled, a bit error occurs because
transmission and reception cannot be synchronized.
In this mode, the clock circ uit of the transmission circuit also
operates for data reception. Accordingl y, the transmiss ion
circuit does not stop by clearing only the transmit enable bit to
“0” (transmit disabled). Also, the transmission circuit is not
initialized by clearing the serial I/O1 enable bit to “0” (serial
I/O disabled) (refer to 1.1).
2. Notes when selecting clock asynchronous serial I/O
2.1 Stop of transmission operation
•Note
Clear the transmit enable bit to “0” (transmit disabled). The
transmission operation does not stop by clearing the serial
I/O1 enable bit to “0”.
•Reason
Since transmission is not stopped and the transmission circuit
is not initialized even if only the serial I/O1 enable bit is
cleared to “0” (seria l I/O disabled), the interna l transmission is
running (in this case, since pins TXD1, RXD1, SCLK1, and
SRDY1 function as I/O ports, the transmission data is not
output). When data is written to the transmit buffer register 1
in this state, data starts to be shifted to the transmit shift
register 1. When the serial I/O1 enable bit is set to “1” at this
time, the data during internally shifting is output to the TXD1
pin and an operation failure occurs.
2.2 Stop of receive operation
•Note
Clear the receive enable bit to “0” (receive disabled ).
2.3 Stop of transmit/receive operation
Note 1 (only transmission operation is stopped)
Clear the transmit enable bit to “0” (transmit disabled). The
transmission operation does not stop by clearing the serial
I/O1 enable bit to “0”.
•Reason
Since transmission is not stopped and the transmission circuit
is not initialized even if only the serial I/O1 enable bit is
cleared to “0” (seria l I/O disabled), the interna l transmission is
running (in this case, since pins TXD1, RXD1, SCLK1, and
SRDY1 function as I/O ports, the transmission data is not
output). When data is written to the transmit buffer register 1
in this state, data starts to be shifted to the transmit shift
register 1. When the serial I/O1 enable bit is set to “1” at this
time, the data during internally shifting is output to the TXD1
pin and an operation failure occurs.
Note 2 (only receive operation is stopped)
Clear the receive enable bit to “0” (receive disabled ).
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 51 of 100
3803 Group (Spec.H QzROM version)
3. SRDY1 output of reception side
•Note
When signals are output from the SRDY1 pin on the reception
side by using an external clock in the clock synchronous serial
I/O mode, set all of the receive enable bit, the SRDY1 output
enable bit, and the transmit enable bit to “1” (transmit
enabled).
4. Setting serial I/O1 control register again
•Note
Set the serial I/O1 control register again after the transmission
and the reception circuits are reset by clearing both the
transmit enable bit and the receive ena ble bit to “0”.
5.Data transmission control with referring to transmit shift
register comple ti on flag
Note
After the transmit da ta is writ ten to the tra nsmit buffer register,
the transmit shift register completion flag changes from “1” to
“0” with a delay of 0.5 to 1.5 shift clocks. When data
transmission is controlled with referring to the flag after
writing the data to the transmit buffer register, note the delay.
6. Transmission control when external clock is selected
•Note
When an external clock is used as the synchronous clock for
data transmission, set the transmit enable bit to “1” at “H” of
the SCLK1 input level. Also, write data to the transmit buffer
register 1 at “H” of the SCLK1 input level.
7. Transmit interrupt request when transmit enable bit is set
•Note
When using the transmit interrupt, take the following
sequence.
1. Set the serial I/O1 transmit interrupt enable bit to “0” (dis-
abled).
2. Set the transmit enable bit to “1”.
3. Set the serial I/O1 transmit interrupt request bit to “0” after
1 or more instruction has executed.
4. Set the serial I/O1 transmit interrupt enable bit to “1”
(enabled).
•Reason
When the transmit enable bit is set to “1”, the transm it buffer
empty flag and the transmit shift register shift completion flag
are also set to “1”. Therefore, regardless of selecting which
timing for the generating of transmit interrupts, the interrupt
request is generated and the serial I/O1 transmit interrupt
request bit is set at this point.
Clear both the transmit enable
bit (TE) and the receive enable
bit (RE) to “0”
Set the bits 0 to 3 and bit 6 of
the serial I/O1 control register
Set both the transmit enable bit
(TE) and the receive enable bit
(RE), or one of them to “1”
Can be set with the
LDM instruction at
the same time
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 52 of 100
3803 Group (Spec.H QzROM version)
Serial I/O2
The serial I/O2 function can be used only for clock synchronous
serial I/O.
For clock synchronous serial I/O2, the transmitter and the
receiver must use the same clock. If the internal clock is used,
transfer is started by a write signal to the serial I/O2 register
(address 001F16).
[Serial I/O2 Control Regi ster (SIO2CON)] 001D16
The serial I/O2 control register contains eight bits which control
various serial I/O2 functions.
Fig 41. Structure of Serial I/O2 control register
Fig 42. Block diagra m of serial I/O2
Serial I/O2 control register
(SIO2CON : address 001D16)
b7 b0
Internal synchronous clock selection bits
b2 b1 b0
000:f(XIN)/8 (f(XCIN)/8 in low-speed mode)
001:f(X
IN)/16 (f(XCIN)/16 in low-speed mode)
010:f(X
IN)/32 (f(XCIN)/32 in low-speed mode)
011:f(X
IN)/64 (f(XCIN)/64 in low-speed mode)
110:f(X
IN)/128 f(XCIN)/128 in low-speed mode)
111:f(X
IN)/256 (f(XCIN)/256 in low-speed mode)
Serial I/O2 port selection bit
0: I/O port
1: SOUT2, SCLK2 signal output
SRDY2 output enable bit
0: I/O port
1: SRDY2 signal output
Transfer direction selection bit
0: LSB first
1: MSB first
Serial I/O2 synchronous clock selection bit
0: External clock
1: Internal clock
P51/SOUT2 P-channel output disable bit
0: CMOS output (in output mode)
1: N-channel open drain output (in output mode)
f(XIN)
Serial I/O counter 2 (3)
Serial I/O2 register (8)
Synchronization
circuit
“1”
“0”
“0”
“1”
“0”
“1”
SCLK2
“0”
“1”
Divider
1/8
1/16
1/32
1/64
1/128
1/256
Data bus
Serial I/O2
interrupt requ est
Serial I/O2 port selection bit
Serial I/O2 port selection bit
Serial I/O2 synchronous
clock selection bit
External clock
Internal synchronous
clock selection bits
P52/SCLK2
P51/SOUT2
P50/SIN2
P52 latch
P51 latch
P53 latch
(f(XCIN) in low-speed mode)
Address 001F16
P53/SRDY2
SRDY2 output enable bit
SRDY2
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 53 of 100
3803 Group (Spec.H QzROM version)
Fig 43. Timing of serial I/O2
D7D0D1D2D3D4D5D6
Transfer clock (Note 1)
Serial I/O2 output SOUT2
Serial I/O2 input SIN2
Serial I/O2 register
write signal
(Note 2)
Serial I/O2/timer Z inte rrupt request bit set
Notes1:When the internal clock is selected as the transfer clock, the divide ratio of f(XIN), or (f(XCIN) in low-speed mode, can be selected by
setting bits 0 to 2 of the serial I/O2 control register.
2:When the internal clock is selected as the transfer clock, the SOUT2 pin goes to high impedance after transfer completion.
Receive enable signal SRDY2
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 54 of 100
3803 Group (Spec.H QzROM version)
Serial I/O3
Serial I/O3 can be used as either clock synchronous or
asynchronous (UART) serial I/O3. A dedicated timer is also
provided for baud rate generation.
(1) Clock Synchronous Serial I/O Mode
Clock synchr onous serial I/O3 mode can be selected by setting
the serial I/O3 mode selection bit of the serial I/O3 control
register (bit 6 of address 003216) to “1”.
For clock synchronous serial I/O, the transmitter and the receiver
must use the same clock. If an internal clock is used, transfer is
started by a write signal to the transmit/receive buffer register 3.
Fig 44. Bl ock diagram of cl ock synchronous serial I/O3
Fig 45. Operation of clock synchronous serial I/O3
Serial I/O3 control register
Receive buffer register 3
Receive shift register 3
Clock control circuit
1/4
Baud rate generator 3
f(XIN)
1/4
Clock control circuitFalling-edge detector
Transmit buffer reg ister 3
Transmit shift register 3
Serial I/O3 status regi ster
F/F
Address 003016
Receive buffer full flag (RBF)
Receive interrupt request (RI)
Shift clock
Serial I/O3 synchronous clock selection bit
Frequency division ratio 1/(n+1)
Address 002F16
BRG count source selection bit
Address 003016
Shift clock Transmit shift completion flag (TSC)
Transmit buffer empty flag (TBE)
Transmit interrupt request (TI)
Transmit interrupt source selection bit
Address 003116
Address 003216
Data bus
Data bus
P36/SCLK3
P34/RXD3
P35/TXD3
(f(XCIN) in low-speed mode)
P37/SRDY3
D7
D7
D0D1D2D3D4D5D6
D0D1D2D3D4D5D6
RBF = 1
TSC = 1
TBE = 0 TBE = 1
TSC = 0
Transfer shift clock
(1/2 to 1/2048 of the internal
clock, or an external clock)
Serial output TXD3
Serial input RXD3
Write pulse to receive/transmit
buffer register 3 (address 003016)
Overrun error (OE)
detection
Notes 1: As the transmit interrupt (TI), which can be selected , either when the transmit buffer has emptied (TBE=1) or after the transmit
shift operation has ended (TSC=1), by setting the transmit interrupt source selection bit (TIC) of the serial I/O3 control register.
2: If data is written to the transmit buffer register 3 when TSC=0, the transmit clock is generated continuously and serial data is output
continuously from the TXD3 pin.
3: The receive interrupt (RI) is set when the receive buffer full flag (RBF) becomes “1”.
Receive enable signal SRDY3
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 55 of 100
3803 Group (Spec.H QzROM version)
(2) Asynchronous Serial I/O (UART) Mode
Clock asynchronous serial I/O mode (UART) can be selected by
clearing the s erial I/O3 mode se lection bit (b6) of the serial I/O3
control register to “0”.
Eight serial data transfer formats can be selected, and the transfer
formats used by a transmitter and receiver must be identical.
The transmit and receive shift registers each have the buffer
register 3, but the two buffers have the same address in a
memory. Since the shift register cannot be written to or read from
directly, transmit data is written to the transmit buffer register 3,
and receive data is read from the receive buffer register 3.
The transmit buffer register can also hold the next data to be
transmitted, and the receive buffer register 3 can hold a character
while the next character is being received.
Fig 46. Block diagram of UART serial I/O3
Fig 47. Operation of UART serial I/O3
f(XIN)
1/4
OE
PE FE
1/16
1/16
Data bus
Data bus
Receive buffer register 3
Address 003016
Receive shift register 3
Receive buffer full flag (RBF)
Receive interrupt request (RI)
Baud rate generator 3
Frequency division ratio 1/(n+1)
Address 002F16
ST/SP/PA generator
Transmit buffer register 3
Transmit shift register 3
Address 003016
Transmit shift
completion flag (TSC)
Transmit buffer empty flag (TBE)
Transmit interrupt request (TI)
Address 003116
ST detector
SP detector UART3 control register
Address 003316
Character length selection bit
Address 003216
BRG count source selection bit
Transmit interrupt source selection bit
Serial I/O3 synchronous clock selection bit
Clock control circuit
Character length selection bit
7 bits
8 bits
Serial I/O3 status register
Serial I/O3 control register
P36/SCLK3
P34/RXD3
P35/TXD3
(f(XCIN) in low-speed mode)
TSC=0
TBE=1
RBF=0
TBE=0 TBE=0
RBF=1 RBF=1
TBE=1 TSC=1*
STD0D1SP D0D1ST SP
Transmit or
receive clock
Transmit buffer register 3
write signal
Serial output
TXD3
Receive buffer register 3
read signal
Serial input
RXD3
* Generated at 2nd bit in 2-stop-bit mode
1 start bit
7 or 8 data bit
1 or 0 parity bit
1 or 2 stop bit (s)
Notes1: Error flag detection occurs at the same time that the RBF flag becomes “1” (at 1st stop bit, during rece ption).
2: As the transmit interrupt (TI), when either the TBE or TSC flag becomes “1”, can be selected to occur depending on the set ti ng of the tr ansmit interrupt source
selection bit (TIC) of the serial I/O3 control register.
3: The receive interrupt (RI) is set when the RBF flag becom es “1”.
4: After data is written to the transmit buffer register 3 when TSC=1, 0.5 to 1.5 cycles of the data shift cycle are necessary until changing to TSC=0.
STD0D1SP D0D1ST SP
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 56 of 100
3803 Group (Spec.H QzROM version)
[Transmit Bu ffer Register 3/Receive Buffer Register 3
(TB3/RB3)] 003016
The transmit buffer register 3 and the receive buf fer register 3 are
located at the same a ddress. Th e transmit buffer is write-only and
the receive buffer is read-only. If a character bit length is 7 bits,
the MSB of data stored in the receive buffer is “0”.
[Serial I/O3 Status Register (SIO3STS)] 003116
The read-only serial I/O3 status register consists of seven flags
(bits 0 to 6) which indicate the operating status of the serial I/O3
function and various errors.
Three of the flags (bits 4 to 6) are valid only in UART mode.
The receive buffer full flag (bit 1) is cleare d to “0” when the
receive buffer register 3 is read.
If there is an error, it is detected at the same time that data is
transferred from the receive shift register 3 to the receive buffer
register 3, and the receive buffer full flag is set. A write to the
serial I/O3 status register clears all the error flags OE, PE, FE,
and SE (bit 3 t o b it 6, respec tiv ely). Writing “0” to the serial I/O3
enable bit SIOE (bit 7 of the serial I/O3 control register) also
clears all the stat us fla g s, inc ludi ng the error flags.
Bits 0 to 6 of the serial I/O3 s tatus register a re initialize d to “0” at
reset, but if the transmit enable bit (bit 4) of the serial I/O3
control register has been set to “1”, the transmit shift completion
flag (bit 2) and the transmit buf fe r empty flag (bit 0) become “1”.
[Serial I/O3 Control Regi ster (SIO3CON)] 003216
The serial I/O3 control register consists of eight control bits for
the serial I/O3 function.
[UART3 Control Register (UART3CON)] 003316
The UART control register consists of four control bits (bits 0 to
3) which are valid when asynchronous serial I/O is selected and
set the data forma t of an data tran sfer, and one bit (bit 4) which is
always valid and sets the output structure of the P35/TXD3 pin.
[Baud Rate Generator 3 (BRG3)] 002F16
The baud rate generator determines the baud rate for serial
transfer.
The baud rate generator divides the frequency of the count source
by 1/(n + 1), where n is the value written to the baud rate
generator.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 57 of 100
3803 Group (Spec.H QzROM version)
Fig 48. Structure of serial I/O3 control registers
b7
Transmit buffer empty flag (TBE)
0: Buffer full
1: Buffer empty
Receive buffer full flag (RBF)
0: Buffer empty
1: Buffer full
Transmit shift completion flag (TSC)
0: Transmit shift in progress
1: Transmit shift completed
Overrun error flag (OE)
0: No error
1: Overrun error
Parity error flag (PE)
0: No error
1: Parity error
Framing error flag (FE)
0: No error
1: Framing error
Summing error flag (SE)
0: (OE) U (PE) U (FE)=0
1: (OE) U (PE) U (FE)=1
Not used (returns “1” when read)
UART3 control register
(UART3CON : address 003316)
Character length selection bit (CHAS)
0: 8 bits
1: 7 bits
Parity enable bit (PARE)
0: Parity checking disabled
1: Parity checking enabled
Parity selection bit (P ARS)
0: Even parity
1: Odd parity
Stop bit length selection bit (STPS)
0: 1 stop bit
1: 2 stop bits
P35/TXD3 P-channel output disable bit (POFF)
0: CMOS output (in output mode)
1: N-channel open drain output (in output mode)
Not used (return “1” when read)
Serial I/O3 control register
(SIO3CON : address 003216)
Serial I/O3 status register
(SIO3STS : address 003116)
b0 b7 b0
b7 b0
BRG count source selection bit (CSS)
0: f(XIN) (f(XCIN) in low-speed mode)
1: f(XIN)/4 (f(XCIN)/4 in low - spee d mode)
Serial I/O3 synchronous clock selection bit (SCS)
0: BRG output divided by 4 when clock synchronous
serial I/O3 is selected, BRG output divided by 16
when UART is selected.
1: External clock input when clock synchronous serial
I/O3 is selected, external clock input divided by 16
when UART is selected.
SRDY3 output enable bit (SRDY)
0: P37 pin operates as normal I/O pin
1: P37 pin operates as SRDY3 output pin
Transmit interrupt source selection bit (TIC)
0: Interrupt when transmit buffer has emptied
1: Interrupt when transmit shift operation is completed
Transmit enable bit (TE)
0: Transmit disabled
1: Transmit enabled
Receive enable bit (RE)
0: Receive disabled
1: Receive enabled
Serial I/O3 mode selection bit (SIOM)
0: Clock asynchronous (UART) serial I/O
1: Clock synchronous serial I/O
Serial I/O3 enable bit (SIOE)
0: Serial I/O3 disabled
(pins P34 to P37 operate as normal I/O pins)
1: Serial I/O3 enabled
(pins P34 to P37 operate as serial I/O3 pins)
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 58 of 100
3803 Group (Spec.H QzROM version)
<Notes concerning serial I/O3>
1. Notes when selecting clock synchronous serial I/O
1.1 Stop of transmission operation
•Note
Clear the serial I/O3 enable bit and the transmit enable bit to
“0” (serial I/O and transmit disabled).
•Reason
Since transmission is not stopped and the transmission circuit
is not initialized even if only the serial I/O3 enable bit is
cleared to “0” (seria l I/O disabled), the interna l transmission is
running (in this case, since pins TXD3, RXD3, SCLK3, and
SRDY3 function as I/O ports, the transmission data is not
output). When data is written to the transmit buffer register 3
in this state, data starts to be shifted to the transmit shift
register 3. When the serial I/O3 enable bit is set to “1” at this
time, the data during internally shifting is output to the TXD3
pin and an operation failure occurs.
1.2 Stop of receive operation
•Note
Clear the receive enable bit to “0” (receive disabled), or clear
the serial I/O3 en able bit to “0” (serial I/O disabled).
1.3 Stop of transmit/receive operation
Note
Clear both the transmit enable bit and receive enable bit to “0”
(transmit and receive disabled).
(when data is transmitted and received in the clock
synchronous serial I/O mode, any one of data tr ansmissio n and
reception cannot be stopped.)
•Reason
In the clock synchronous serial I/O mode, the same clock is
used for transmission and reception. If any one of transmission
and reception is disabled, a bit error occurs because
transmission and reception cannot be synchronized.
In this mode, the clock circ uit of the transmission circuit also
operates for data reception. Accordingl y, the transmiss ion
circuit does not stop by clearing only the transmit enable bit to
“0” (transmit disabled). Also, the transmission circuit is not
initialized by clearing the serial I/O3 enable bit to “0” (serial
I/O disabled) (refer to 1.1).
2. Notes when selecting clock asynchronous serial I/O
2.1 Stop of transmission operation
•Note
Clear the transmit enable bit to “0” (transmit disabled). The
transmission operation does not stop by clearing the serial
I/O3 enable bit to “0”.
•Reason
Since transmission is not stopped and the transmission circuit
is not initialized even if only the serial I/O3 enable bit is
cleared to “0” (seria l I/O disabled), the interna l transmission is
running (in this case, since pins TXD3, RXD3, SCLK3, and
SRDY3 function as I/O ports, the transmission data is not
output). When data is written to the transmit buffer register 3
in this state, data starts to be shifted to the transmit shift
register 3. When the serial I/O3 enable bit is set to “1” at this
time, the data during internally shifting is output to the TXD3
pin and an operation failure occurs.
2.2 Stop of receive operation
•Note
Clear the receive enable bit to “0” (receive disabled ).
2.3 Stop of transmit/receive operation
Note 1 (only transmission operation is stopped)
Clear the transmit enable bit to “0” (transmit disabled). The
transmission operation does not stop by clearing the serial
I/O3 enable bit to “0”.
•Reason
Since transmission is not stopped and the transmission circuit
is not initialized even if only the serial I/O3 enable bit is
cleared to “0” (seria l I/O disabled), the interna l transmission is
running (in this case, since pins TXD3, RXD3, SCLK3, and
SRDY3 function as I/O ports, the transmission data is not
output). When data is written to the transmit buffer register 3
in this state, data starts to be shifted to the transmit shift
register 3. When the serial I/O3 enable bit is set to “1” at this
time, the data during internally shifting is output to the TXD3
pin and an operation failure occurs.
Note 2 (only receive operation is stopped)
Clear the receive enable bit to “0” (receive disabled ).
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 59 of 100
3803 Group (Spec.H QzROM version)
3. SRDY3 output of reception side
•Note
When signals are output from the SRDY3 pin on the reception
side by using an external clock in the clock synchronous serial
I/O mode, set all of the receive enable bit, the SRDY3 output
enable bit, and the transmit enable bit to “1” (transmit
enabled).
4. Setting serial I/O3 control register again
•Note
Set the serial I/O3 control register again after the transmission
and the reception circuits are reset by clearing both the
transmit enable bit and the receive ena ble bit to “0”.
5.Data transmission control with referring to transmit shift
register comple ti on flag
•Note
After the transmit da ta is writ ten to the tra nsmit buffer register,
the transmit shift register completion flag changes from “1” to
“0” with a delay of 0.5 to 1.5 shift clocks. When data
transmission is controlled with referring to the flag after
writing the data to the transmit buffer register, note the delay.
6. Transmission control when external clock is selected
•Note
When an external clock is used as the synchronous clock for
data transmission, set the transmit enable bit to “1” at “H” of
the SCLK3 input level. Also, write data to the transmit buffer
register 3 at “H” of the SCLK input level.
7. Transmit interrupt request when transmit enable bit is set
•Note
When using the transmit interrupt, take the following
sequence.
1. Set the serial I/O3 transmit interrupt enable bit to “0” (dis-
abled).
2. Set the transmit enable bit to “1”.
3. Set the AD converter/Serial I/O3 transmit interrupt request
bit to “0” after 1 or more instruction has exec ute d.
4. Set the AD converter/Serial I/O3 transmit interrupt enable
bit to “1” (enabled).
•Reason
When the transmit enable bit is set to “1”, the transm it buffer
empty flag and the transmit shift register shift completion flag
are also set to “1”. Therefore, regardless of selecting which
timing for the generating of transmit interrupts, the interrupt
request is generated and the AD converter/Serial I/O3 transmit
interrupt is set at this point.
Clear both the transmit enable
bit (TE) and the receive enable
bit (RE) to “0”
Set the bits 0 to 3 and bit 6 of
the serial I/O3 control register
Set both the transmit enable bit
(TE) and the receive enable bit
(RE), or one of them to “1”
Can be set with the
LDM instruction at
the same time
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 60 of 100
3803 Group (Spec.H QzROM version)
PULSE WIDTH MODULATION (PWM)
The 3803 group (Spec.H QzROM version) has PWM functions
with an 8-bit resolution, based on a signal that is the clock input
XIN or that clock input divided by 2 or the clock input XCIN or
that clock input divided by 2 in low-speed mode.
Data Setting
The PWM output pin also functions as port P56. Set the PWM
period by the PWM prescaler, and set the “H” term of output
pulse by the PWM register.
If the value in the PWM prescaler is n and the value in the PWM
register is m (where n = 0 to 255 and m = 0 to 255):
PWM period = 255 × (n+1) / f(XIN)
= 31.875 × (n+1) µs
(when f(XIN) = 8 MHz, count source selection bit = “0”)
Output pulse “H” term = PWM period × m / 255
= 0.125 × (n+1) × m µs
(when f(XIN) = 8 MHz, count source selection bit = “0”)
PWM Operation
When bit 0 (PWM function enable bit) of the PWM control
register is set to “1”, operation starts by initializing the PWM
output circuit, and pulses are output starting at an “H”.
If the PWM register or PWM prescaler is updated during PWM
output, the pulses will change in the cycle after the one in which
the change was made.
Fig 49. Timing of PWM period
Fig 50. Block diagra m of PWM function
31.875 × m × (n + 1 )
255 µs
T = [31.875 × (n+1)] µs
PWM output
m : Contents of PWM register
n : Contents of PWM prescaler
T : PWM period
(when f(XIN) = 8 MHz, count source selection bit = “0”)
Data bus
Count source
selection bit
“0”
“1”
PWM
prescaler pre-latch PWM
register pre-latch
PWM
prescaler latch PWM
register latch
Transfer control circuit
PWM register
1/2
XIN
(XCIN at low-
speed mode) Port P56 latch
PWM function enable bit
Port P56
PWM pr escale r
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 61 of 100
3803 Group (Spec.H QzROM version)
Fig 51. Structure of PWM control register
Fig 52. PWM ou tput timing when PWM register or PWM prescaler is changed
<Notes>
The PWM starts after the PWM function enable bit is set to enable and “L” level is output from the PWM pin.
The length of this “L” level output is as follows:
(Count source selection bit = 0, where n is the value set in the prescaler)
(Count source selection bit = 1, where n is the value set in the prescaler)
b7 b0 PWM control register
(PWMCON: address 002B16)
PWM function enabl e bit
0: PWM disable d
1: PWM enab led
Count source selection bit
0:f(XIN) (f(XCIN) at low-speed mode)
1:f(XIN)/2 (f(XCIN)/2 at low-speed mode)
Not used
(return “0” when read)
PWM output
T T T2
B C
PWM register
write signal
PWM prescaler
write signal
(Changes “H” term from “A” to “ B”.)
(Changes PWM period from “T” to “T2”.)
B
TC
T2
=
When the contents of the PWM register or PWM prescaler have changed,
the PWM output will change from the next period after the change.
A
n1+
2×fXIN()
----------------------- sec
n1
+
fXIN()
---------------- sec
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 62 of 100
3803 Group (Spec.H QzROM version)
A/D CONVERTER
[AD Conversion Register 1, 2] AD1, AD2
The AD conversion register is a read-only register that stores the
result of an A/D conversion. When reading this register during an
A/D conversion, the previous conversion result is read.
Bit 7 of the AD conversion register 2 is the conversion mode
selection bit. When this bit is set to “0”, the A/D converter
becomes the 10-bit A/D mode. When this bit is set to “1”, that
becomes the 8-bit A/D mode. The conversion result of the 8-bit
A/D mode is stored in the AD conversion register 1. As for 10-bit
A/D mode, not only 10-bit reading but also only high-order 8-bit
reading of conversion result can be performed by selecting the
reading procedure of the AD conversion registers 1, 2 after A/D
conversion is completed (in Figure 55).
As for 10-bit A/D mode, the 8-bit reading inclined to MSB is
performed when reading the AD converter register 1 after A/D
conversion is started; and when the AD converter register 1 is
read after reading the AD converter register 2, the 8-bit reading
inclined to LSB is performed.
[AD/DA Control Register] ADCON
The AD/DA control register controls the A/D conversion
process. Bits 0 to 2 and bit 4 select a specific analog input pin.
Bit 3 signals the completion of an A/D conversion. The value of
this bit remains at “0” during an A/D conversion, and changes to
“1” when an A/D conversion ends. Writing “0” to this bit starts
the A/D conversion.
[Comparison Voltage Generator]
The comparison voltage generator divides the voltage between
AVSS and VREF into 1024, and that outputs the comparison
voltage in the 10-bit A/D mode (256 division in 8-bit A/D mode).
The A/D converter successively compares the comparison
voltage Vref in each mode, dividing the VREF voltage (see
below), with the input voltage.
10-bit A/D mode (10-bit reading)
Vref = × n (n = 0 1023)
10-bit A/D mode (8-bit reading)
Vref = × n (n = 0 255)
8-bit A/D mode
Vref = × n (n 0.5) (n = 1 255)
=0 (n = 0)
[Channel Selector]
The channel selector selects one of ports P67/AN7 to P60/AN0 or
P07/AN15 to P00/AN8, and inputs the voltage to the comparator.
[Comparator and Control Circuit]
The comparator and control circuit compares an analog input
voltage with the comparison voltage, and then stores the result in
the AD conversion registers 1, 2. When an A/D conversion is
completed, the control circuit sets the AD conversion completion
bit and the AD converter/Serial I/O3 transmit interrupt request
bit to “1”.
Note that because the comparator consists of a capacitor
coupling, set f(XIN) to 500 kHz or more during an A/D
conversion.
Fig 53. Structure of AD/DA control register
Fig 54. Structure of AD conversion register 2
Fig 55. Structure of 10-bit A/D mode reading
VREF
1024
-------------
VREF
256
-------------
VREF
256
-------------
AD/DA control regi ster
(ADCON : address 003416)
Analog input pin selection bi ts 1
0 0 0: P60/AN0orP00/AN8
0 0 1: P61/AN1orP01/AN9
0 1 0: P62/AN2orP02/AN10
0 1 1: P63/AN3orP03/AN11
1 0 0: P64/AN4orP04/AN12
1 0 1: P65/AN5orP05/AN13
1 1 0: P66/AN6orP06/AN14
1 1 1: P67/AN7orP07/AN15
AD conversion completion bit
0: Conversion in progress
1: Conversion completed
Analog input pin selection bi t 2
0: AN0 to AN 7 side
1: AN8 to AN 15 side
Not used (returns “0” when read)
DA1 output enable bit
0: DA1 ou tp ut di sabled
1: DA1 output enabled
DA2 output enable bit
0: DA2 ou tp ut di sabled
1: DA2 output enabled
b7 b0
b2 b1 b0
0
b7 b0
b8 AD conversion register 2 (AD2)
(AD2: address 00 3816)
b9
Conversion mode selection bit
0: 10-bit A/D conversion mode
1: 8-bit A/D conversion mode
Not used (returns “0” when read)
10-bit reading
(Read address 003816 before 003516)
AD conversion register 2
(AD2: address 003816)
AD conversion register 1
(AD1: address 003516)
Note :Bits 2 to 6 of address 003816 become “0” at reading.
8-bit reading
(Read only address 003516)
AD conversion register 1
(AD1: address 003516)b9
b7 b0
b8 b7 b6 b5 b4 b3 b2
b7 b0
b9 b8
b7
b7 b0
b6 b5 b4 b3 b2 b1 b0
0
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 63 of 100
3803 Group (Spec.H QzROM version)
Fig 56. Block diagra m of A/D converter
Channel selector
A/D control circuit
AD conve rsion register 1
Resistor ladder
VREF AVSS
Comparator
A/D converter interrupt request
10
P60/AN0
P61/AN1
P62/AN2
P63/AN3
P64/AN4
P65/AN5
P66/AN6
P67/AN7
P00/AN8
P01/AN9
P02/AN10
P03/AN11
P04/AN12
P05/AN13
P06/AN14
P07/AN15
b7 b0
4
Data bus
AD/DA control register
(Address 003416)
AD conve rsion register 2 (Address 003816)
(Address 003516)
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 64 of 100
3803 Group (Spec.H QzROM version)
D/A CONVERTER
The 3803 group (Spec.H QzROM ve rsion) has two internal D/A
converters (DA1 and DA2) with 8-bit resolution.
The D/A conversion is performed by setting the value in each
DAi conversion register (i = 1 or 2). The result of D/A
conversion is output from the DA1 or DA2 pin by setting the DAi
output enable bit (i = 1 or 2) to “1”.
When using the D/A converter, the corresponding port direction
register bit (P30/DA1 or P31/DA2) must be set to “0” (input
status).
The output analog voltage V is determined by the value n
(decimal notation) in the DAi conve rsion register (i = 1 or 2) as
follows:
V = VREF× n/256 (n = 0 to 255)
Where VREF is the reference voltage.
At reset, the DAi conversion register (i = 1 or 2) is cleared to
“0016”, and the DAi output enable bit (i = 1 or 2) is cleared to
“0”, and the P30/DA1 and P31/DA2 pins become high
impedance.
The DA output does not have buffers. Accordingly, connect an
external buffer when driving a low-impedance load.
Fig 57. Block diagram of D/A converter
Fig 58. Equivalent connection circuit of D/A converter (DA1)
DA1 conver sion regist er (8)
DA1 output ena bl e bi t
P30/DA1
Data bus
R-2R resist or ladder
DA2 conver sion regist er (8)
DA2 output ena bl e bi t
P31/DA2
R-2R resist or ladder
DA1 output en able bit
AVSS
VREF
R2RRRRRRR
2R2R2R2R2R2R2R2R
LSB
“1”“0”
MSB
DA1 conversion regis t er
P30/DA1
“0”
“1”
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 65 of 100
3803 Group (Spec.H QzROM version)
WATCHDOG TIMER
The watchdog timer gives a mean of returning to the reset status
when a program cannot run on a normal loop (for example,
because of a software run-away). The watchdog timer consists of
an 8-bit watchdog timer L and an 8-bit watchdog timer H.
Watchdog Timer Initial Value
Watchdog timer L is set to “FF16” and watchdog timer H is set to
“FF16” by writing to the watchdog timer control register (a ddress
001E16) or at a reset. Any write instruction that causes a write
signal can be used, such as the STA, LDM, CLB, etc. Data can
only be written to bits 6 and 7 of the watchdog timer control
register. Regardless of the value written to bits 0 to 5, the above-
mentioned value will be set to each timer.
Bit 6 can be written only once after releasing reset. After
rewriting it is disable to write any data to this bit.
Watchdog Timer Operations
The watchdog timer stops at reset and starts to count down by
writing to the watchdog timer control register (address 001E16).
An internal reset occurs at an underflow of the watchdog timer
H. The reset is released after waiting for a reset release time and
the program is processed from the reset vector address.
Accordingly, programming is usually performed so that writing
to the watchdog timer control register may be started before an
underflow. If writing to the watchdog timer control register is not
performed once, the watchdog timer does not function.
Bit 6 of Watchdog Timer Control Register
When bit 6 of the watchdog timer control register is “0”, the
MCU enters the stop mode by execution of STP instruction.
Just after releasing the stop mode, the watchdog timer restarts
counting(Note.). When executing the WIT instruction, the
watchdog timer does not stop.
When bit 6 is “1”, execution of STP instruction causes an
internal reset. When this bit is set to “1” once, it cannot be
rewritten to “0” by program. Bit 6 is “0” at reset.
The following shows the period between the write execution to
the watchdog timer control register and the underflow of
watchdog timer H.
Bit 7 of the watchdog timer control register is “0”:
when XCIN = 32.768 kHz; 32 s
when XIN = 16 MHz; 65.536 ms
Bit 7 of the watchdog timer control register is “1”:
when XCIN = 32.768 kHz; 125 ms
when XIN = 16 MHz; 256 µs
Note. The watchdog timer continues to count even while waiting for a
stop release. Therefore, make sure that watchdog timer H does not
underflow during this period.
Fig 59. Bl ock diagram of Watchdog timer
Fig 60. Structure of Watchdog timer control register
XIN
Data bus
XCIN
“10”
“00”
“01”
Main clock division
ratio selection bits (Note)
“0”
“1”
1/16
Watchdog timer H count
source selection bit
Reset
circuit
STP instr uction function selection bit
Watchdog timer H (8)
“FF16” is set when
watchdog timer
control register is
written to.
Internal reset
Watchdog timer L (8)
“FF16” is set when
watchdog timer
control register is
written to.
Note: Any one of high-speed, middle-speed or low-speed mode is selected by bits 7 and 6 of the CPU mode register.
STP instruction
RESET
b7
Watchdog timer H (for read-out of high-order 6 bit)
STP instruction function selection bit
0: Entering stop mode by execution of STP instruction
1: Internal reset by execution of STP instruction
Watchdog timer H count source selection bit
0: Watchdog timer L underflow
1: f(XIN)/16 or f(XCIN)/16
Watchdog timer control register
(WDTCON : address 001E16)
b0
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 66 of 100
3803 Group (Spec.H QzROM version)
RESET CIRCUIT
To reset the microcomputer, RESET pin should be held at an “L”
level for 16 cycles or more of XIN. Then the RESET pin is
returned to an “H” level (the power source voltage should be
between 1.8 V and 5.5 V, and the oscillation should be stable),
reset is released. After the reset is completed, the program starts
from the address contained in address FFFD16 (high-or der byte)
and address FFFC16 (low-order byte). Make sure that the reset
input voltage is less than 0.29 V for VCC of 1.8 V.
Fig 61. Reset circuit example
Fig 62. Reset sequence
VCCRESET
VCCRESET Power source voltage
detection circuit
Example at VCC = 5 V
1.8 V
0 V
0 V
VCC
RESET 0.29 V or less
RESET
Internal
reset
Data
φ
Address
SYNC
XIN
? ? ? ? FFFC FFFD ADH,L
? ? ? ?ADLADH
Notes 1: The frequency relation of f(XIN) and f(φ) is f(XIN) = 8 • f(φ).
2: The question marks (?) indicate an undefined state that depends on the previous state.
Reset address from the
vector table.
XIN : 10.5 to 18.5 clock cycles
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 67 of 100
3803 Group (Spec.H QzROM version)
Fig 63. I nternal status at reset
Note : X: Not fixed.
Since the initial values for other than above mentioned registers and
RAM contents are ind efinite at reset, they must be se t.
Port P0 (P0)
Port P0 direction register (P0D)
Port P1 (P1)
Port P1 direction register (P1D)
Port P2 (P2)
Port P2 direction register (P2D)
Port P3 (P3)
Port P3 direction register (P3D)
Port P4 (P4)
Port P4 direction register (P4D)
Port P5 (P5)
Port P5 direction register (P5D)
Port P6 (P6)
Port P6 direction register (P6D)
Timer 12, X count source selection register (T12XC SS)
Timer Y, Z count source selection register (TYZCS S)
MISRG
Transmit/Receive buffer register 1 (TB1/RB1)
Serial I/O1 status register (SIO1STS)
Serial I/O1 control register (SIO1CON)
UART1 control register (UART1CON)
Baud rate generator 1 (BRG1)
Serial I/O2 control register (SIO2CON)
Watchdog timer control register (WDTCON)
Serial I/O2 register (SIO2)
Prescaler 12 (PRE12)
Timer 1 (T1)
Timer 2 (T2)
Timer XY mode register (TM)
Prescaler X (PREX)
Timer X (TX )
Prescaler Y (PREY)
Timer Y (TY )
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)
(21)
(22)
(23)
(24)
(25)
(26)
(27)
(28)
(29)
(30)
(31)
(32)
(33)
Register contents
Address
000016
000116
000216
000316
000416
000516
000616
000716
000816
000916
000A16
000B16
000C16
000D16
000E16
000F16
001016
001816
001916
001A16
001B16
001C16
001D16
001E16
001F16
002016
002116
002216
002316
002416
002516
002616
002716
Timer Z (low-order) (TZL)
Timer Z (high-order) (TZH)
Timer Z mode register (TZM)
PWM control register (PWMCON)
PWM prescaler (PREPWM)
PWM register (PWM)
Baud rate generator 3 (BRG3)
Transmit/Receive buff er register 3 (TB3/RB3)
Serial I/O3 status register (SIO 3STS )
Serial I/O3 control register (SIO3CON)
UART3 control register (UART3CON)
AD/DA control register (ADCON)
AD conversion register 1 (AD1)
DA1 conversion register (DA1)
DA2 conversion register (DA2)
AD conversion register 2 (AD2)
Interrupt source se le ction register (INTSEL)
Interrupt edge select io n register (INTEDGE)
CPU mode register (CPUM)
Interrupt request regist er 1 (IREQ1)
Interrupt request regist er 2 (IREQ2)
Interrupt contro l reg is t er 1 (ICON1)
Interrupt contro l reg is t er 2 (ICON2)
Port P0 pull-up control register (PULL0)
Port P1 pull-up control register (PULL1)
Port P2 pull-up control register (PULL2)
Port P3 pull-up control register (PULL3)
Port P4 pull-up control register (PULL4)
Port P5 pull-up control register (PULL5)
Port P6 pull-up control register (PULL6)
Processor status regis ter
Program counter
(34)
(35)
(36)
(37)
(38)
(39)
(40)
(41)
(42)
(43)
(44)
(45)
(46)
(47)
(48)
(49)
(50)
(51)
(52)
(53)
(54)
(55)
(56)
(57)
(58)
(59)
(60)
(61)
(62)
(63)
(64)
(65)
002816
002916
002A16
002B16
002C16
002D16
002F16
003016
003116
003216
003316
003416
003516
003616
003716
003816
003916
003A16
003B16
003C16
003D16
003E16
003F16
0FF016
0FF116
0FF216
0FF316
0FF416
0FF516
0FF616
(PS)
(PCH)
(PCL)
Register contents
Address
0016
0016
0016
0016
0016
0016
0016
0016
0016
0016
0016
0016
0016
0016
0016
FF16
0116
FF16
0016
0016
FF16
FF16
0016
FF16
FF16
0016
0016
0016
0016
0016
FF16
0016
0016
FF16
0016
0016
0016
0016
X
0
1
1
X
0
1
1
X
0
0
0
X
0
0
0
X
0
1
1
X
0
1
1
X
0
0
0
X
1
0
0
0
X
1
X
0
X
1
X
0
X
1
X
0
X
1
X
0
X
1
X
1
X
1
X
1
X
0
X
1
X
0
X
X
0
X
0
0
0
X
X
X
X
X
0
0
0
0
0
X
X
X
X
X
1
0
1
0
0
X
X
X
X
X
0
0
0
0
0
X
X
X
X
X
0
X
0
0
0
X
X
X
X
X
0
0
0
1
0
X
X
X
X
X
1
0
0
1
0
X
X
X
X
X
0
0
0
1
1
X
X
X
X
0016
0016
0016
0016
FFFC16 contents
FFFD16 contents
0016
0016
0016
XXX1XXXX
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 68 of 100
3803 Group (Spec.H QzROM version)
CLOCK GENERATING CIRCUIT
The 3803 group (Spec.H QzROM version) has two built-in
oscillation circuits: main clock XIN-XOUT oscillation circuit and
sub clock XCIN-XCOUT oscillation circuit. An oscillation circuit
can be formed by connecting a resonator between XIN and XOUT
(XCIN and XCOUT). Use the circuit constants in accordance with
the resonator manufacturer’s recommended values. No external
resistor is needed between XIN and XOUT since a feed-back
resistor exists on-chip.(An external feed-back resistor may be
needed depending on conditions.) However, an external feed-
back resistor is needed between XCIN and XCOUT.
Immediately after power on, only the XIN oscillation circuit
starts oscilla ting, and XCIN and XCOUT pins function as I/O ports.
Fr eq uen cy Control
(1) Middle-speed mode
The internal clock φ is the freque ncy of XIN divided by 8. After
reset is released, this mode is selected.
(2) High-speed mode
The internal clock φ is half the frequency of XIN.
(3) Low-speed mode
The internal clock φ is half the frequency of XCIN.
(4) Low po wer dissipation mode
The low power consumption operation can be realized by
stopping the main clock XIN in low-speed mode. To stop the
main clock, set bit 5 of the CPU mode register to “1”. When the
main clock XIN is restarted (by setting the main clock stop bit to
“0”), set suff ic ient time for oscillation to stabilize .
The sub-clock XCIN-XCOUT oscillating circuit can not directly
input clocks that are generated externally. Accordingly, make
sure to cause an external resonator to oscillate.
Oscillation Control
(1) Stop mode
If the STP instruction is executed, the internal clock φ stops at an
“H” level, and XIN and XCIN oscillators stop. When the
oscillation stabilizing time set after STP instruction released bit
(bit 0 of address 00 1016) is “0”, the prescaler 12 is set to “FF16
and timer 1 is set to “0116”. When the oscillation stabilizing time
set after STP instruc tion release d bit is “1 ”, set th e suf ficie nt time
for oscillation of used oscillator to stabilize since nothing is set to
the prescaler 12 and timer 1.
After STP instruction is released, the input of the prescaler 12 is
connected to count source which had set at executing the STP
instruction, and the output of the prescaler 12 is connected to
timer 1. Oscillator restarts when an external interrupt is received,
but the internal clock φ is not supplied to the CPU (remains at
“H”) until timer 1 underflows. The internal clock φ is supplied
for the first time, when timer 1 underflows. This ensures time for
the clock oscillation using the ceramic resonators to be
stabilized. When the oscillator is resta rted by reset, apply “L”
level to the RESET pin until the oscillation is stable since a wait
time will not be generated.
(2) Wait mode
If the WIT instruction is executed, the internal clock φ stops at an
“H” level, but the oscillator does not stop. The internal clock φ
restarts at reset or when an interrupt is received. Since the
oscillator does not stop, normal operation can be started
immediately after the clock is restarted.
To ensure that the interrupts will be received to release the STP
or WIT state, their interrupt enable bits must be set to “1” before
executing of the STP or WIT instruction.
When releasing the STP state, the prescaler 12 and timer 1 will
start counting the clock XIN divided by 16. Accordingly, set the
timer 1 interrupt enable bit to “0” before executing the STP
instruction.
<Notes>
If you switch the mode between middle/high-speed and low-
speed, stabilize both XIN and XCIN oscillations. The sufficient
time is required for the sub clock to stabilize, especially
immediately after power on and at returning from stop mode.
When switching the mode between middle/high-speed and
low-speed, set the frequency on condition that f(XIN) >
3×f(XCIN).
When using the quartz-crystal oscillator of high frequency,
such as 16 MHz etc., it may be necessary to select a specific
oscillator with the specification demanded.
When using the oscillation stabilizing time set after STP
instruction released bit set to “1”, evaluate time to stabilize
oscillation of the used oscillator and set the value to the tim er 1
and prescaler 12.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 69 of 100
3803 Group (Spec.H QzROM version)
Fig 64. C eramic resonator circuit
Fig 65. External clock input circuit
XCIN XCOUT XIN XOUT
CIN COUT
CCIN CCOUT
Rf Rd Rd
Notes :Insert a damping resistor if r equired.
The resistan ce will vary depending on the oscillator
and the oscillation drive capacity setting.
Use the value recommended by the maker of the
oscillator.
Also, if the osc ill ator manufacturer' s da ta she et
specifies to add a feedback resistor externally to
the chip though a feed back resistor exists on-chip,
insert a fe edback resistor between XIN and XOUT
following the instruction.
XIN XOUT
External oscillation
circuit
Open
XCIN XCOUT
CCIN CCOUT
Rf Rd
VCC
VSS
VCC
VSS
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 70 of 100
3803 Group (Spec.H QzROM version)
Fig 66. System clock generati ng circuit block diagram (Single-chip mode)
WIT
instruction STP
instruction
Timing φ (internal clock)
S
R
Q
S
R
Q
Main clo ck (XIN-XOUT) stop bit
S
R
Q
1/2 1/4
XIN XOUT
XCOUT
XCIN
Interrupt request
Interrupt disable flag lReset
Port XC
switch bit
“1” “0”
Low-speed
mode
High-speed or
middle-speed mode
Middle-speed mo de
High-speed or
low-speed mode
Main clock division ratio
selection bits (Note 1)
Main clock division ratio
selection bits (Note 1)
Notes1: Either high-speed, middle-speed or low-speed mode is selected by bits 7 and 6 of the CPU mode register.
When low-speed mode is selected, set port XC switch bit (b4) to “1”.
2:f(X
IN)/16 is supplied as the count source to the prescaler 12 at reset, the count source before executing the STP instruction is
supplied as the count source at executing STP instruction.
3: When bit 0 of MISRG is “0”, timer 1 is set “0116” and prescaler 12 is set “FF16” automatically. When bit 0 of MISRG is “1” , set the
appropriate value to them in accordance with oscillation stabilizing time required by the using oscillator because nothing is
automatically set into timer 1 and prescaler 12.
4: Although a feed-back resistor exists on-chip, an external feed-back resistor may be needed depending on conditions.
Prescaler 12 Timer 1
Reset or
STP instruction
(Note 2)
Reset
(Note 3)
(Note 4)
STP
instruction
Divider
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 71 of 100
3803 Group (Spec.H QzROM version)
Fig 67. State transitions of system clock
CM4 : Port XC switch bit
0 : I/O port function (stop oscillating)
1 : XCIN-XCOUT oscillating function
CM5 : Main clock (XIN-XOUT) stop bit
0 : Operating
1 : Stopped
CM7, CM6: Main clock division rat io selection bit
b7 b6
00 :φ = f (XIN)/2 (High-speed mode)
01 :φ = f (XIN)/8 (Middle-speed mode)
10 :φ = f (XCIN)/2 (Low-speed mode)
1 1 : Not available
Reset
CM4
“1”←→”0”
CM
4
01
CM
6
10
CM
4
10
CM
6
10
CM7
“1”←→”0 CM4
“1”←→”0”
CM5
“1”←→”0”
CM6
“1”←→”0”
CM6
“1”←→”0”
CPU mode register
(CPUM : address 003B16)
b7 b4
CM
7
01
CM
6
10
High-speed mode
(f(φ) = 4 MHz)
CM7=0
CM6=0
CM5=0 (8 MHz oscillati ng)
CM4=0 (32 kHz stopped)
High-speed mode
(f(φ) = 4 MHz)
CM7=0
CM6=0
CM5=0 (8 MHz oscillati ng)
CM4=1 (32 kHz oscillating)
Notes1:Switch the mode by the allows shown between the mode blocks. (Do not switch between the modes directly without an allow.)
2: The all modes can be switched to the stop mode or the wait mode and return to the source mode when the stop mode or the
wait mode is ended.
3: Timer operates in the wait mode.
4: W hen the stop mode is ended, a delay of approx imately 1 ms occurs by connecting prescaler 12 and Timer 1 in middle/high-
speed mode.
5: When the stop mode is ended, a delay of approx imately 0.25 s occurs by Timer 1 and Timer 2 in low-speed mode.
6: W ait until oscillation stabilizes after oscillating the main clock XIN before the switching from the low-speed mode to mid dle/
high-speed mode.
7: The example assumes that 8 MHz is being applied to the XIN pin and 32 kHz to the XCIN pin. φ indicate s th e in ternal clock.
Middle-speed mode
(f(φ) = 1 MHz)
CM7=0
CM6=1
CM5=0 (8 MHz oscilla ti ng )
CM4=0 (32 kHz stopped)
Middle-s peed mode
(f(φ) = 1 MHz)
CM7=0
CM6=1
CM5=0 (8 MHz oscilla ti ng )
CM4=1 (32 kHz oscillating)
Low-speed mode
(f(φ) = 16 kHz)
CM7=1
CM6=0
CM5=0 (8 MHz oscillati ng)
CM4=1 (32 kHz oscillating)
Low-speed mode
(f(φ) = 16 kHz)
CM7=1
CM6=0
CM5=1 (8 MHz stopped)
CM4=1 (32 kHz oscillating)
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 72 of 100
3803 Group (Spec.H QzROM version)
QzROM Writing Mode
In the QzROM writing mode, the user ROM area can be
rewritten while the microcomputer is mounted on-board by u sing
a serial programmer which is applicable for this microcomputer.
Table 9 lists the pin description (QzROM writing mode) and
Figure 68 to Figure 70 show the pin connections.
Refer to Figure 71 and Figure 72 for examples of a connection
with a serial programmer.
Contact the manufacturer of you r serial programmer for seria l
programmer. Refer to the users manual of your serial
programmer for details on how to use it.
Table 9 Pin description (QzROM writing mode )
Pin Name I/O Function
VCC, VSS Power source Input Apply 2.7 to 5.5 V to VCC, and 0 V to VSS.
CNVSS VPP input Input QzROM programmable power source pin.
VREF Analog reference
voltage Input Input the reference voltage of A/D converter and D/A converter to
VREF.
AVSS Analog power source Input Connect AVss to Vss.
RESET Reset input Input Reset input pin for active “L”. Reset occurs when RESET pin is
held at an “L” level for 16 cycles or more of XIN.
XIN Clock input Input Set the same termination as the single-chip mode.
XOUT Clock output Output
P00P07
P10P17
P20P27
P33P37
P40, P44
P50P57
P60P67
I/O port I/O Input “H” or “L” level signal or leave the pin open.
P45ESDA input/output I/O Serial data I/O pin.
P46ESCLK input Input Serial clock input pin.
P47ESPGMB input Input Read/program pulse input pin.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 73 of 100
3803 Group (Spec.H QzROM version)
Fig. 68 Pin connection diagram (M38039GXH-XXXHP/KP, M38039GXHHP/KP)
48
P20(LED0)
M38039GXH-XXXHP/KP
M38039GXHHP/KP
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
32
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
P35/TXD3
P34/RXD3
P31/DA2
P30/DA1
VCC
VREF
AVSS
P67/AN7
P66/AN6
P65/AN5
P64/AN4
P63/AN3
P37/SRDY3
P36/SCLK3
P33
P32
VSS
XOUT
XIN
P42/INT1
RESET
CNVSS
P40/INT40/XCOUT
P41/INT00/XCIN
P27(LED7)
P22(LED2)
P23(LED3)
P24(LED4)
P25(LED5)
P26(LED6)
P21(LED1)
P61/AN1
P60/AN0
P57/INT3
P56/PWM
P55/CNTR1
P54/CNTR0
P52/SCLK2
P51/SOUT2
P50/SIN2
P46/SCLK1
P45/TXD1
P44/RXD1
P43/INT2
P62/AN2
P47/SRDY1/CNTR2
P53/SRDY2
P00/AN8
P01/AN9
P02/AN10
P03/AN11
P04/AN12
P05/AN13
P06/AN14
P07/AN15
P10/INT41
P11/INT01
P12
P13
P16
P14
P15
P17
VCC
RESET
GND
ESPGMB
ESCLK
ESDA
*
* Connect to oscillation circuit
: QzROM pin
VPP
Package type: PLQP0064KB-A (64P6Q-A)
PLQP0064GA-A (64P6U-A)
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 74 of 100
3803 Group (Spec.H QzROM version)
Fig. 69 Pin connection diagram (M38039GXHSP)
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
641
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
VCC
VREF
AVSS
P67/AN7
P66/AN6
P65/AN5
P64/AN4
P63/AN3
P62/AN2
P61/AN1
P60/AN0
P57/INT3
P56/PWM
P55/CNTR1
P54/CNTR0
P53/SRDY2
P52/SCLK2
P51/SOUT2
P47/SRDY1/CNTR2
P46/SCLK1
P45/TXD1
P44/RXD1
P43/INT2
P42/INT1
CNVSS
VSS
RESET
P41/INT00/XCIN
P40/INT40/XCOUT
XIN
XOUT
P50/SIN2
P30/DA1
P31/DA2
P32
P33
P34/RXD3
P35/TXD3
P36/SCLK3
P37/SRDY3
P00/AN8
P01/AN9
P02/AN10
P03/AN11
P04/AN12
P05/AN13
P06/AN14
P07/AN15
P10/INT41
P11/INT01
P13
P14
P15
P16
P17
P20(LED0)
P21(LED1)
P22(LED2)
P12
P23(LED3)
P24(LED4)
P25(LED5)
P26(LED6)
M38039GXHSP
Package type: PRDP0064BA-A (64P4B)
P27(LED7)
*
ESDA
ESCLK
ESPGMB
VPP
RESET
VCC
GND
* Connect to oscillation circuit
: QzROM pin
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 75 of 100
3803 Group (Spec.H QzROM version)
Fig. 70 Pin connection diagram (M38039GCH-XXXWG, M38039GCHWG)
3
2
1
8
7
6
5
4
P61/AN1P60/AN0P55/CNTR1P52/SCLK2 P50/SIN2 P44/RXD1P43/INT2CNVSS
P67/AN7P66/AN6P57/INT3P54/CNTR0P47/SRDY1/CNTR2P45/TXD1P40/INT40/XCOUT P41/INT00/XCIN
P30/DA1P31/DA2P32P37/SRDY3 P17P14P15P16
P33P34/RXD3P00/AN8P05/AN13 P12P13P26(LED6)P27(LED7)
P35/TXD3P01/AN9P03/AN11 P06/AN14 P11/INT01 P25(LED5)P23(LED3)P24(LED4)
P36/SCLK3 P02/AN10 P04/AN12 P07/AN15 P10/INT41 P20(LED0)P21(LED1)P22(LED2)
P62/AN2P63/AN3VREF AVSS VCC VSS XIN XOUT
ABCDEFGH
ABCDEFGH
50 46 44 41 40 32 31 30
51 47 45 42 39 27 29 28
53 52 48 43 38 37 26 25
56 55 54 49 33 36 35 34
164 58 59 57 24 22 23
60 61 4 7 12 14 21 20
62 63 5 8 10 13 17 19
2 3 6 9 11 15 16 18
PIN CONFIGURATION (TOP VIEW)
Package type: PTLG0064JA- A (6 4F0G)
* Connect to oscillation circuit
: QzROM pin
3
2
1
8
7
6
5
4
VPP
RESET
VCC
*
GND
ESPGMB
ESDA
ESCLK P65/AN5P64/AN4P56/PWM P53/SRDY2 P51/SOUT2 P46/SCLK1 P42/INT1RESET
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 76 of 100
3803 Group (Spec.H QzROM version)
Fig. 71 When using programmer of Suisei Electronics System Co., LTD, connection example
3803 Group
(Spec.H QzROM version)
Set the same termination as the
single-chip mode.
VCC
P45(ESDA)
P46(ESCLK)
P47(ESPGMB)
RESET
Vss
AVss XIN XOUT
Note: For the programming circuit, the wiring capacity of each signal pin must not exceed 47 pF.
CNVSS
T_VDD
T_VPP
T_RXD
T_SCLK
T_PGM/OE/MD
RESET circuit
T_RESET
GND
4.7k
4.7k
T_TXD
T_BUSY N.C.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 77 of 100
3803 Group (Spec.H QzROM version)
Fig. 72 When using E8 programmer connection example
3803 Group
(Spec.H QzROM version)
RESET
circuit
Set the same termination as the
single-chip mode.
Vcc
CNVss
P45(ESDA)
P46(ESCLK)
RESET
Vss
AVss XIN XOUT
4.7k
4.7k
*1: Open-collector buffer
Note: For the programming circuit, the wiring capacity of each signal pin must not exceed 47 pF.
Vcc
14
12
10
8
13
11
9
7
4
2
6
3
1
*1
P47(ESPGMB)
5
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 78 of 100
3803 Group (Spec.H QzROM version)
NOTES
NOTES ON PROGRAMMING
1. Pr ocessor Status Register
(1) Initializing of processor status register
Flags which af fect program execution must be initialized after a reset.
In particular, it is essential to initialize the T and D flags becaus e
they have an important effect on calculations. Initialize these
flags at beginning of the program.
<Reason>
After a re set, the c ont ents of the proc esso r sta tus re gist er (PS) are
undefined except for the I flag which is “1”.
Fig 73. Initialization of processor status register
(2) How to reference the processor status register
To reference the contents of the processor status register (PS),
execute the PHP ins tructio n once the n read the co nten ts of (S+1).
If necessary, execute the PLP instruction to return the PS to its
original status.
Fig 74. Stack memory contents after PHP instruction
execution
2. Decimal calcu lations
(1) Execution of decimal calculations
The ADC and SBC are the only instructions which will yield
proper decimal notation, set the decimal mode flag (D) to “1”
with the SED instruction. After executing the ADC or SBC
instruction, execute another instruction before executing the
SEC, CLC, or CLD instruction.
Fig 75. Execution of decimal calculations
(2) Notes on status flag in decimal mode
When decimal mode is selected, th e values of thre e of the flag s in
the status register (the N, V, and Z flags) are invalid after a ADC
or SBC instruction is executed.
The carry flag (C) is set to “1” if a carry is generated as a result of the
calculation, or is cleared to “0” if a borrow is generated. To
determine whether a calculati on has generated a carry, the C flag
must be initialized to “0” before each calculation. To check for a
borrow, the C flag must be initialized to “1” bef ore each calculation .
3. JMP instruction
When using the JMP instruction in indirect addressing mode, do
not specify the last address on a page as an indirect address.
4. Multiplication and Div is ion Instructions
The index X mode (T) and the decimal mode (D) flags do not
affect the MUL and DIV instruction.
The execution of these instructions does not change the
contents of the processor status register.
5. R ead-Modify-Write Instruction
Do not execute any read-modify-write instruction to the read
invalid (address) SFR.
The read-modify-write instruct ion reads 1-byte of data from
memory, modifies the data, and writes 1-byte the data to the
original memory.
In the 740 Family, the read-modify-write instructions are the
following:
(1) Bit handling instructions:
CLB, SEB
(2) Shift and rotate instructions:
ASL, LSR, ROL, ROR, RRF
(3) Add and subtract instructions:
DEC, INC
(4) Logical operation instructions (1’s complement):
COM
Although not the read-modify-write instructions, add and
subtract/log ical operation instructions (ADC, SBC, AND, EOR,
and ORA) when T flag = “1” operate in the way as the read-
modify-write instruction. Do not execute them to the read invalid
SFR.
<Reason>
When the read-modify-write instruction is executed to the read
invalid SFR, the following may result:
As reading is invalid, the read value is undefined. The instruction
modifies this undefined value and writes it back, so the written
value will be indeterminate.
Reset
Initializing of flags
Main program
Stored PS
(S)
(S) + 1
Set D flag to “1”
ADC or SBC instruction
NOP instruction
SEC, CLC, or CLD instruction
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 79 of 100
3803 Group (Spec.H QzROM version)
6. Serial Interface
In clock synchronous serial I/O, if the receive side is using an
external clock and it is to output the SRDY signal, set the transmit
enable bit, the receive enable bit, and the SRDY output enable bit
to “1”.
Serial I/O1 continues to output the final bit from the TXD1 pin
after transmission is completed. SOUT2 pin for serial I/O2 goes to
high impedance after transfer is completed.
When in serial I/Os 1 and 3 (clock-synchro nous mode) or in
serial I/O2, an external clock is used as synchronous clock, write
transmission data to the transmit buffer register or serial I/O2
register, during transfer clock is “H”.
7. A/D Converter
The comparator uses capacitive coupling amplifier whose charge
will be lost if the clock frequency is too low.
Therefore, make sure that f(XIN) in the middle/high-speed mode
is at least on 500 kHz during an A/D conversion.
Do not execute the STP instruction during an A/D conversion.
8. D/A Converter
The accuracy of the D/A converter becomes rapidly poor under
the VCC = 4.0 V or less condition; a supply voltage of VCC 4.0
V is recommended. When a D/A converter is not used, set all
values of DAi conversion registers (i=1, 2) to “0016”.
9. Instruction Execution Time
The instruction execution time is obtained by multiplying the
period of the internal clock φ by the number of cycles needed to
execute an instruction.
The number of cycles required to execute an instruction is shown
in the list of machine instructions.
The period of the interna l clock φ is double of the XIN period in
high-speed mode.
10.Reserved Area, Reserved Bit
Do not write any data to the reserved area in the SFR area and the
special page. (Do not change the contents after reset.)
11.CPU Mode Register
Be sure to fix bit 3 of the CPU mode register (address 003B16) to
“1”.
COUNTERMEASURES AGAINST NOISE
(1) Shortest wiring length
1. Wiring for RESET pin
Make the length of wiring which is connected to the RESET
pin as short as possible. Especially, connect a capacitor across
the RESET pin and the VSS pin with the shortest possible
wiring (within 20 mm).
•Reason
The width of a pulse input into the RESET pin is determined by
the timing necessary conditions. If noise having a shorter pulse
width than the standard is input to the RESET pin, the reset is
released before the internal state of the microcomputer is
completely initialized. This may cause a program runaway.
Fig. 76 Wiring for the RESET pin
2. Wiring for clock input/ou tput pins
Make the length of wiring which is connected to clock I/O
pins as short as possible.
Make the length of wiring (within 20 mm) across the
grounding lead of a capacitor which is connected to an
oscillator and the VSS pin of a microcomputer as short as
possible.
Separate the V SS pattern only for oscillation from other VSS
patterns.
•Reason
If noise enters clock I/O pins, clock waveforms may be
deformed.
This may cause a program failure or program runaway. Also, if a
potential difference is caused by the noise between the VSS level
of a microcomputer and the VSS level of an oscillator, the correct
clock will not be input in the microcomputer.
Fig. 77 Wiring for clock I/O pins
RESET
Reset
circuit
Noise
VSSVSS
N.G.
Reset
circuit
VSS
RESET
VSS
O.K.
Noise
XIN
XOUT
VSS
N.G.
XIN
XOUT
VSS
O.K.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 80 of 100
3803 Group (Spec.H QzROM version)
(2) Connection of bypass capacitor across VSS line and VCC
line
In order to stabilize th e sys tem operation and avoid the latch-up,
connect an approximately 0.1 µF bypass capacitor across the VSS
line and the VCC line as follows:
Connect a bypass capacitor across the VSS pin and the VCC pin
at equal length.
Connect a bypass capacitor across the VSS pin and the VCC pin
with the shortest possible wiring.
Use lines with a larger diameter than other signal lines for VSS
line and VCC line.
Connect the power source wiring via a bypass capacitor to the
VSS pin and the VCC pin.
Fig. 78 Bypass capacitor across the V
SS
line and the V
CC
line
(3) Oscillator concerns
In order to obtain the stabilized operation clock on the user
system and its condition, contact the oscillator manufacturer and
select the oscillator and oscillation circuit constants. Be careful
especially when range of voltage and temperature is wide.
Also, take care to preve nt an osci llator that generates clocks for a
microcomputer operation from being affected by other signals.
1. Keeping oscillator away from large current signal lines
Install a microcomputer (and especially an oscillator) as far as
possible from signal lines where a current larger than the
tolerance of current value flows.
•Reason
In the system using a microcomputer, there are signal lines for
controlling motors, LEDs, and thermal heads or others. When a
large current flows through those signal lines, strong noise
occurs because of mutual inductance.
2. Installing oscillator away from signal lines where potential
levels change frequently
Install an oscillator and a connecting pattern of an oscillator
away from signal lines where potential levels change
frequently. Also, do not cross such signal li nes over the clock
lines or the signal lines which are sensitive to noise.
•Reason
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 program runaway.
Fig. 79 Wiring for a large current signal line/Wiring of
signal lines where potential levels change
frequently
(4) Analog input
The analog input pin is connected to the capacitor of a voltage
comparator. Accordingly, sufficient accuracy may not be
obtained by the charge/discharge current at the time of A/D
conversion when the analog signal source of high-impedance is
connected to an analog input pin. In order to ob tain the A/D
conversion result stabilized more, please lower the impedance of
an analog signal source, or add the smoothing capacitor to an
analog input pin.
(5) Difference of memory size
When memory size differ in one group, actual values such as an
electrical characteristics, A/D conversion accuracy, and the
amount of proof of noise incorrect operation may differ from the
ideal values.
When these products are used switching, perform system
evaluation for each product of every after confirming product
specification.
VSS
VCC
VSS
VCC
N.G. O.K.
XIN
XOUT
VSS
M
Microcomputer
Mutual inductance
Large
current
GND
XIN
XOUT
VSS
CNTRDo not cross.
N.G.
1. Keeping oscillator away from large current signal lines
2. Installing oscillator away from signal lines where potential
levels change frequently
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 81 of 100
3803 Group (Spec.H QzROM version)
NOTES ON PERIPHERAL FUNCTIONS
Notes on Input and Output Ports
1. Use in Stand-By State
When using the MCU in stand-by state*1 for low-power
consumption, do not leave the input level of an I/O port
undefined. Be especially careful to the I/O ports for the N-
channel open-drain.
In this case, pull-up (connect to Vcc) or pull-down (connect to
Vss) these ports through a resistor.
When determining a re sistance value, note the following:
External circuit
Variation in the output level during ordinary operation
When using a built- in pull-up resistor, note variations in curr ent
values:
When setting as an input port: Fix the input level
When setting as an output port: Prevent current from
flowing out externally.
<Reason>
Even if a port is set to output by the direction register, when the
content of the port latch is “1”, the transistor becomes the OFF
state, which allows the port to be in the high-impedance state.
This may cause the level to be undefined depending on external
circuits.
As described above, if the input level of an I/O port is left
undefined, the power source current may flow because the
potential applied to the input buffe r in the MCU will be unstable.
*1 Stand-by state: Stop mode by executing the STP instruction
Wait mode by executing the WIT instruction
2. Modifying Output Data with Bit Handling Instruc tion
When the port latch of an I/O port is modified with the bit
handling instruction*1, the value of an unspecified bit may
change.
<Reason>
I/O ports can be set to input mode or output mo de in byte units.
When the port register is read or written, the following will be
operated:
Port as input mode
Read: Read the pin level
Write: Write to the port latch
Port as output mode
Read: Read the port latch or peripheral function output
(specifications vary depending on the port)
Write: Write to the port latch (output the content of the port
latch from the pin)
Meanwhile, the bit handling instructions are the read-modify-
write instructions*2. Executing the bit handling instruction to the
port register allows reading and writing a bit unspecified with the
instruction at the same time.
If an unspecified bit is set to input mode, the pin level is read and
the value is written to the port la tch. At this time, if the original
content of the port latch and the pin level do not match, the
content of the port latch changes.
If an unspecified bit is set to output mode, the port latch is
normally read, but the peripheral function output is read in some
ports and the value is written to the port latch. At this time, if the
original content of the port latch and the peripheral function
output do not match, the content of the port latch changes.
*1 Bit handling instructions: CLB, SEB
*2 Read-modify-write instruction: Reads 1-byte of data from
memory, modifies the data, and writes 1-byte of the data to
the original memory.
3. Direction Registers
The values of the port direction registers cannot be read. This
means, it is impossible to use the LDA instruction, memory
operation instruction when the T flag is “1”, addressing mode
using direction register values as qualifiers, and bit test
instructions such as BBC and BBS. It is also impossible to use bit
operation instructions such as CLB and SEB, and read-modify-
write instructions to direction registers, including calculations
such as ROR. To set th e direction regist ers, use i nstructions such
as LDM or STA.
Termination of Unused Pin s
1. Terminate unused pins
(1) Output ports: Open
(2) I/O ports:
Set the por ts to input mode and con nect each pi n to VCC or VSS
through a resistor o f 1 k to 10 k. An internal pull-up resistor
can also be used for the port where the internal pull-up resister is
selectable.
To set the ports to output mode, leave open at “L” or “H” output.
When setting the ports to output mode and leave open, input
mode in the initial state remains until the mode of the ports are
switched to output mode by a program after a reset. This may
cause the voltage level of the pins to be undefined and the
power source current to increase while the ports remains in
input mode. For any effects on the system, careful system
evaluations should be implemented on the user side.
The direction registers may be changed due to a program
runaway or noise, so reset the registers periodically by a
program to increase the program reliability.
(3) The AVSS pin when not using the A/D converter:
When not using the A/D converter, handle a power source pin
for the A/D converter, AVSS pin as follows:
AVSS: Connect to the VSS pin.
2. Termination remarks
(1) When setting I/O ports to input mode
[1] Do not leave open
<Reason>
The power source current may increase depending on the
first-stage circuit.
The ports are more likely affected by noise when compared
with the termination shown on the above “1. (2) I/O ports”
[2] Do not connect to VCC or VSS directly
<Reason>
If the direction registers are changed to output mode due to a
program runaway or noise, a short circuit may occur.
[3] Do not connect multiple ports in a lump to VCC or VSS
through a resistor.
<Reason>
If the direction registers are changed to output mode due to a
program runaway or noise, a short circuit may occur between the
ports.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 82 of 100
3803 Group (Spec.H QzROM version)
Notes on Interrupts
1. Change of relevant register settings
When the setting of the following registers or bits is changed, the
interrupt request bit may be set to “1”. When not requiring the
interrupt occurrence synchronized with these setting, take the
following sequence.
Interrupt edge selection register (address 003A16)
Timer XY mode register (address 002316)
Timer Z mode register (address 002A16)
Set the above listed registers or bits as the following sequence.
Fig 80. Se quence of changing relevant register
<Reason>
The interrupt request bit ma y be set to “ 1” in the following c ases.
When setting the external interrupt active edge
Related bits:
INT0 interrupt edge selection bit
(bit 0 of interrupt edge selection register (address 003A16))
INT1 interrupt edge selection bit
(bit 1 of interrupt edge selection register (address 003A16))
INT2 interrupt edge selection bit
(bit 3 of interrupt edge selection register (address 003A16))
INT3 interrupt edge selection bit
(bit 4 of interrupt edge selection register (address 003A16))
INT4 interrupt edge selection bit
(bit 5 of interrupt edge selection register (address 003A16))
CNTR0 activate edge switch bit
(bit 2 of timer XY mode register (address 002316))
CNTR1 activate edge switch bit
(bits 6 of timer XY mode register (address 002316))
CNTR2 activate edge switch bit
(bits 5 of timer Z mode register (address 002A16))
When switching the interrupt sources of an interrupt vector
address where two or more interrupt sources are assigned
Related bits:
INT0, INT4 interrupt switch bit
(bit 6 of interrupt edge selection register (address 003A16))
INT0/Timer Z interrupt source selection bit
(bit 0 of interrupt source selection register (address 003916))
Serial I/O2/Timer Z interrupt source selection bit
(bit 1 of interrupt source selection register (address 003916))
INT4/CNTR2 interrupt source selection bit
(bit 4 of interrupt source selection register (address 003916))
CNTR1/Serial I/O3 receive interrupt source selection bit
(bit 6 of interrupt source selection register (address 003916))
AD conversion/Serial I/O3 transmit interrupt source selection bit
(bit 6 of interrupt source selection register (address 003916))
2. Check of interrupt re quest bit
When executing the BBC or BBS instruction to an interrupt
request bit of an interrupt request register immediately after this
bit is set to “0”, execute one or more instructions before
executing the BBC or BBS instruction.
Fig 81. Se quence of check of interrupt request bit
<Reason>
If the BBC or BBS instruction is executed immediately after an
interrupt request bit of an interrupt request register is cleared to
“0”, the value of the interrupt request bit before being cleared to
“0” is read.
Notes on 8-bit Timer (timer 1, 2, X, Y)
If a value n (between 0 and 255) is written to a timer latch, the
frequency division ratio is 1/(n+1).
When switching the count source by the timer 12, X and Y
count source selection bits, the value of timer count is altered
in unconsiderable amount owing to gen erating of thin pulses in
the count input signals.
Therefore, select the timer count source before set the value to
the prescaler and th e timer.
Set the double-function port of the CNTR0/CNTR1 pin and
port P54/P55 to output in the pulse output mode.
Set the double-function port of CNTR0/CNTR1 pin and port
P54/P55 to input in the event counter mode and the pulse width
measurement mode.
Set the interrupt edge select bit (active edge switch bit)
or the interrupt (source) select bit to “1”.
NOP (one or more instructions)
Set the corresponding interrupt enable bit to “0” (disabled).
Set the corresponding interrupt request bit to “0”
(no interrupt request issued).
Set the corresponding interrupt enable bit to “1” (enabled). NOP (one or more instructions)
Clear the interrupt request bit to “0” (no interrupt issued)
Execute the BBC or BBS instruction
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 83 of 100
3803 Group (Spec.H QzROM version)
Notes on 16-bit Timer (timer Z)
1. Pu lse output mode
Set the double-function port of the CNTR2 pin and port P47 to
output.
2. Pulse period measurement mode
Set the double-function port of the CNTR2 pin and port P47 to
input.
A read-out of timer value is imp ossible in this mode. The timer
can be written to only during timer stop (no measurement of
pulse period).
Since the timer latch in this mode is specialized for the read-
out of measured values, do not perform any write operation
during measurement.
“FFFF16” is set to the timer when the timer underflows or
when the valid edge of measurement start/completion is
detected.
Consequently, the timer value at start of pulse period
measurement depends on the timer value just before
measurement start.
3. Pulse width measurement mode
Set the double-function port of the CNTR2 pin and port P47 to
input.
A read-out of timer value is imp ossible in this mode. The timer
can be written to only during timer stop (no measurement of
pulse period).
Since the timer latch in this mode is specialized for the read-
out of measured values, do not perform any write operation
during measurement.
“FFFF16” is set to the timer when the timer underflows or
when the valid edge of measurement start/completion is
detected.
Consequently, the timer value at start of pulse width
measurement depends on the timer value just before
measurement start.
4. Programmable waveform generating mode
Set the double-function port of the CNTR2 pin and port P47 to
output.
5. Programmable one-shot generating mode
Set the double-function port of CNTR2 pin and port P47 to
output, and of INT1 pin and port P42 to input in this mode.
This mode cannot be used in low-speed mode.
If the value of the CNTR2 active edge switch bit is changed
during one-shot generating enabled or generating one-shot
pulse, then the output level from CNTR2 pin changes.
6. All modes
Timer Z write control
Which write control can be selected by the timer Z write control
bit (bit 3) of the timer Z mode register (address 002A16), writing
data to both the latch and the timer at the same time or writing
data only to the latch.
When the operation “writi ng data only to the latch” is selected,
the value is set to the timer latch by writing data to the address of
timer Z and the timer is updated at next underflow. After reset
release, the operation “writing data to both the latch and th e timer
at the same time” is select ed, and the value is set to both the latch
and the timer at the same time by writing data to the address of
timer Z.
In the case of writing data only to the latch, if writing data to the
latch and an underflow are performed almost at the same time,
the timer value may become undefined.
Timer Z read control
A read-out of timer value is impossible in pulse period
measurement mode and pulse width measurement mode. In the
other modes, a read-out of timer value is possible regardless of
count operating or stopped.
However, a read-out of timer latch value is impossible.
Switch of interrupt active edge of CNTR2 and INT1
Each interrupt active edge depends on setting of the CNTR2
active edge switch bit and the INT1 active edge selection bit.
Switch of count source
When switching the count source by the timer Z count source
selection bits, the value of timer count is altered in
inconsiderable amount owing to generating of thin p ulses on the
count input signals.
Therefore, select the timer count source before setting the value
to the prescaler and the timer.
Notes on Serial Interface
1. Notes when selecting clock synchronous serial I/O
(1) Stop of transmission operation
As for serial I/Oi (i = 1, 3) that can be used as either a clock
synchronous or an asynchronous (UART) serial I/O, clear the
serial I/Oi enable bit and the transmit enable bit to “0” (serial
I/Oi and transmit disabled).
<Reason>
Since transmission is not stopped and the transmission circuit is
not initialized even if only the serial I/Oi enable bit is cleared to
“0” (serial I/Oi disabled), the internal transmission is running (in
this case, since pins TxDi, RxDi, SCLKi, and SRDYi function as
I/O ports, the transmission data is not output). When data is
written to the transmit buffer register i in this state, data starts to
be shifted to the transmit shift register i. When the serial I/Oi
enable bit is set to “1” at this time, the data during internally
shifting is output to the TxDi pin and an operation failure occurs.
(2) Stop of receive operation
As for serial I/Oi (i = 1, 3) that can be used as either a clock
synchronous or an asynchronous (UART) serial I/O, clear the
receive enable bit t o “0” (receive disabled), or clear the serial
I/Oi enable bit to “0” (serial I/Oi disabled).
(3) Stop of transmit/receive operation
As for serial I/Oi (i = 1, 3) that can be used as either a clock
synchronous or an asynchronous (UART) serial I/O, clear both
the transmit ena ble bit and r eceiv e enabl e bi t to “0” (transmi t a nd
receive disabled).
(when data is transmitted and received in the clock synchronous
serial I/O mode, any one of data transmission and reception
cannot be stopped.)
<Reason>
In the clock synchronous serial I/O mode, the same clock is used
for transmission and reception. If an y one of transmission and
reception is disabled, a bit error occurs because transmission and
reception cannot be synchronized.
In this mode, the clock circuit of the transmission circuit also
operates for data reception. Accordingly, the transmission circuit
does not stop by clearing only the transmit enable bi t to “0”
(transmit disabled). Also, the transmission circuit is not
initialized by clearing the serial I/Oi enable bit to “0” (serial I/Oi
disabled) (refer to (1) in 1.).
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 84 of 100
3803 Group (Spec.H QzROM version)
2. N otes when selectin g clock asynchronous serial I/O
(1) Stop of transmission operation
Clear the transm it enable bit to “0” (transmit disa bled). The
transmission operation does not stop by clearing the serial I/Oi
enable bit (i = 1, 3) to “0”.
<Reason>
This is the same as (1) in 1.
(2) Stop of receive operation
Clear the receive enable bit to “0” (receiv e disabled).
(3) Stop of transmit/receive operation
Only transmission operation is stopped.
Clear the transm it enable bit to “0” (transmit disa bled). The
transmission operation does not stop by clearing the serial I/Oi
enable bit (i = 1, 3) to “0”.
<Reason>
This is the same as (1) in 1.
Only receive operation is stopped.
Clear the receive enable bit to “0” (receiv e disabled).
3. SRDYi (i = 1, 3) output of reception side
When signals are output from the SRDYi pin on the reception side
by using an external clock in the clock synchronous serial I/O
mode, set all of the receive enable bit, the SRDYi output enable
bit, and the transmit enable bit to “1” (transmit enabled).
4. Settin g serial I/Oi (i = 1, 3) control register again
Set the serial I/Oi control register again after the transmissi on
and the reception circuits are re set by clearing both the transmit
enable bit and the receive enable bit to “0.”
Fig 82. Se quence of setting serial I/Oi (i = 1, 3) control
register again
5. Data transmission control with referring to transmit
shift register completion flag
After the transmit data is written to the transmit buffer register,
the transmit shift register completion flag changes from “1” to
“0” with a delay of 0.5 to 1.5 shift clocks. When data
transmission is controlled with referring to the flag after writing
the data to the transmit buffer register, note the delay.
6. Transmission control when external clock is selec te d
When an external clock is used as the synchronous clock for data
transmission, set the transmit enable bit to “1” at “H” of the
SCLKi (i = 1, 3) input level. Also, write the transmit data to the
transmit buffer register at “H” of the SCLKi input level.
7. Transmit interrupt r equest when transmit enable bit
is set
When using the transmit interrupt, take the following sequence.
(1) Set the serial I/Oi transmit interrupt enable bit (i = 1, 3) to
“0” (disabled).
(2) Set the transmit enable bit to “1”.
(3) Set the serial I/Oi transmit interrupt request bit (i = 1, 3) to
“0” after 1 or more instruct ion has exe cut ed.
(4) Set the serial I/Oi transmit interrupt enable bit (i = 1, 3) to
“1” (enabled).
<Reason>
When the transmission enable b it is set to “ 1”, the tr ansmit buf fer
empty flag and transmit shift register shift completion flag are
also set to “1”.
Therefore, regardless of selecting which timing for the
generating of transmit interrupts, the interrupt request is
generated and the transmit interrupt request bit is set at this point.
8. Writing to baud rate generator i (BRGi) (i = 1, 3)
W rite data to the baud rate generator i (BRGi) (i = 1, 3) while the
transmission/reception operation is stopped.
Notes on PWM
The PWM starts from “H” level af ter the PWM enable bit is set
to enable and “L” level is temporarily output from the PWM pin.
The length of this “L” level output is as follows:
n + 1
2 × f(XIN) (s) (Count source selection bit = “0”,
where n is the value set in the prescaler)
n + 1
f(XIN) (s) (Count source selection bit = “1”,
where n is the value set in the prescaler)
Notes on A/D Converter
1. Analog input pin
Make the signal source impedance for analog input low, or equip
an analog input pin with an external capacitor of 0.01
µ
F to 1
µ
F.
Further, be sure to verify the operation of application products on
the user side.
<Reason>
An analog input p in includes the capacitor for analog voltage
comparison. Accordingly, when signals from signal source with
high impedance are input to an analog input pin, charge and
discharge noise generates. This may cause the A/D conversion
precision to be worse.
2. A /D converter power source pin
The AVSS pin is A/D converte r power source pins. Regar dless of
using the A/D conversion function or not, connect it as following:
•AV
SS: Connect to the VSS line
<Reason>
If the AVSS pin is opened, the microcomputer may have a failure
because of noise or others.
Can be set with the
LDM instruction at
the same time
Set the bits 0 to 3 and bit 6 of the serial I/Oi
control register
Clear both the transmit enable bit (TE) and
the receive enable bit (RE) to “ 0
Set both the transmit enable bit (TE) and the
receive enable bit (RE), or one of them to “1”
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 85 of 100
3803 Group (Spec.H QzROM version)
3. Clock frequency during A/D conversion
The comparator consists of a capacity coupling, and a charge of
the capacity wi ll be lost if the clock frequency is too low. Thus,
make sure the following during an A/D conversion.
•f(XIN) is 500 kHz or more
Do not execute the STP instruction
4. Difference between at 8-bit reading in 10-bit A/D
mode and at 8-bit A/D mode
At 8-bit reading in the 10-bit A/D mode, “–1/2 LSB” correction
is not performed to the A/D conversion result.
In the 8-bit A/D mode, the A/D conversion characteristics is the
same as 3802 group’s characteristics because “–1/2 LSB”
correction is performed.
Notes on D/A Converter
1. VCC when using D/A converter
The D/A converter accuracy when VCC is 4.0 V or less differs
from that of when VCC is 4.0 V or more. When using the D/A
converter, we recommend using a VCC of 4.0 V or more.
2. D/Ai conversion register when not using D/A con-
verter
When a D/A converter is not used, set all values of the D/Ai
conversion registers (i = 1, 2) to “0016”. The initial value after
reset is “0016”.
Notes on Watchdog Timer
Make sure that the watchdog timer H does not underflow
while waiting Stop release, because the watchdog timer keeps
counting during that term.
When the STP instruction function selection bit ha s been set to
“1”, it is impossible to switc h it to “0” by a program.
Notes on RESET Pin
Connecting capacitor
In case where the RESET signal rise time is long, connect a
ceramic capacitor or others across the RESET pin and the VSS
pin.
Use a 1000 pF or more capacitor for high frequency use. When
connecting the capacitor, note the following:
Make the length of the wiring which is connected to a
capacitor as short as possible.
Be sure to verify the operation of application products on the
user side.
<Reason>
If the several nanosecond or several ten nanosecond impulse
noise enters the RESET pin, it may cause a microcomputer
failure.
Notes on Low-speed Operation Mode
1. Using sub-cloc k
To use a sub-clock, fix bit 3 of the CPU mode register to “1” or
control the Rd (refer to Figure 83) resistance value to a certain
level to stabilize an oscillation. For resistance value of Rd,
consult the oscillator manufacturer.
Fig 83. C eramic resonator circuit
<Reason>
When bit 3 of the CPU mode register is set to “0”, the sub-cl ock
oscillation may stop.
2. Switch between middle/high-speed mode and low-
speed mode
If you switch the mode between middle/high-speed and low-
speed, stabilize both XIN and XCIN oscillations. The sufficient
time is required for the sub clock to stabilize, especially
immediately after power on and at returning from stop mode.
When switching the mode be tween middle/high-speed and low-
speed, set the frequency on condition that f(XIN) > 3×f(XCIN).
Quartz-Crystal Oscillator
When using the quartz-crystal oscillator of high f requency, such
as 16 MHz etc., it may be necessary to select a specific oscillator
with the specification demanded.
Notes on Restarting Oscillation
Restarting oscillation
Usually, when the MCU stops the clock oscillation by STP
instruction and the STP instruction has been released by an
external interrupt source, the fixed values of Timer 1 and
Prescaler 12 (Timer 1 = “0116”, Prescaler 12 = “FF16”) are
automatically reloaded in order for the oscillation to stabiliz e.
The user can inhibit the automatic setting by writing “1” to bit 0
of MISRG (address 001016).
However, by setting this bit to “1”, the previous values, set just
before the STP instruction was executed, will remain in Timer 1
and Prescaler 12. Therefore, you will need to set an appropriate
value to each register, in accordance with the oscillation
stabilizing time, before executing the STP instruction.
<Reason>
Oscillation will restart when an external interrupt is received.
However, internal clock
φ
is supplied to the CPU only when
Timer 1 starts to underflow. This ensures time for the clock
oscillation using the ceramic resonators to be stabilized.
XCIN XCOUT
CCIN CCOUT
Rd
Rf
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 86 of 100
3803 Group (Spec.H QzROM version)
Notes on Using Stop Mode
Register setting
Since values of the prescaler 12 and Timer 1 are automati cally
reloaded when returning from the stop mode, set them again,
respectively. (When the oscillation stabilizing time set after STP
instruction released bit is “0”)
Clock restoration
After restoration from the stop mode to the normal mode by an
interrupt request, the contents of the CPU mode register previous
to the STP instruction execution are retained. Accordingl y, if
both main clock and sub clock were oscillating before execution
of the STP instruction, the oscillation of both clocks is resumed
at restoration.
In the above case, when the main clock side is set as a system
clock, the oscillation st abilizing time for approximately 8,000
cycles of the XIN input is reserved at restoration from the stop
mode. At this time, note that the oscillation on the sub clock side
may not be stabilized even after the lapse of the oscillation
stabilizing time of the main clock side.
Notes on W a it Mode
Clock restoration
If the wait mode is released by a reset when XCIN is set as the
system clock and XIN oscillation is stopped during execution of
the WIT instruction, XCIN oscillation stops, XIN oscillations
starts, and XIN is set as the system clock.
In the above case, the RESET pin should be held at “L” until the
oscillation is stabi lized.
Notes on Handling of Pow er Source Pins
In order to avoid a latch-up occurrence, connect a capacitor
suitable for high frequencies as bypass capacitor between power
source pin (VCC pin) and GND pin (VSS pin), and between power
source pin (VCC pin) and analog power source inpu t pin (AVSS
pin). Besides, connect the capacitor to as close as possible. For
bypass capacitor which should not be located too far from the
pins to be connected, a ceramic capacitor of 0.01
µ
F–0.1
µ
F is
recommended.
Notes on Power Source Voltage
When the power source voltage value of a microcomputer is less
than the value which is indicated as the recommended operating
conditions, the microcomputer does not operate normally and
may perform unstable operation.
In a system where the power source voltage drops slowly when
the power source voltage drops or the power supply is turned off,
reset a microcomputer when the power source voltage is less
than the recommended operating conditions and design a system
not to cause errors to the system by this unstable operation.
Notes on Product Shipped in Blank
As for the product s hipped 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
foreign bodies on a socket, etc. because a writing environment
may cause some writing errors.
Precautions Regarding Overvoltage in QzROM Version
Make sure that voltage exceeding the VCC pin voltage is not
applied to other pins. In particular, ensure that the state indicated
by bold lines in figure below does not occur for CNVSS pin (VPP
power source pin for QzROM) during power-on or power-off.
Otherwise the contents of QzROM could be rewritten.
Fig 84. Timing Diagram (bold-lined periods are applicable)
Notes on QzRO M Version
Connect the CNVSS/VPP pin the shortest possible to t he GND
pattern which is supplied to the VSS pin of the microcomputer.
In addition connecting an approximately 5 k resistor in series to
the GND could improve noise immunity. In this case as well as
the above mention, connect the pin the shortest possible to the
GND pattern which is supplied to the VSS pin of the
microcomputer.
•Reason
The CNVSS/VPP pin is the power source input pin for the built-in
QzROM. When programming in the QzROM, the impedance of
the VPP pin is low to all ow the e lectric current for wri ting to fl ow
into the built-in QzROM. Because of this, noise can enter easily.
If noise enters the VPP pin, abnormal instruction codes or data
are read from the QzROM, wh ich may cause a pro gram run away.
Fig 85. Wiring for the CNVSS/VPP
VCC pin voltage
CNVSS pin voltage
1.8 V 1.8 V
(1) The input voltage to other MCU pins rises before the VCC pin
voltage rises.
(2) The input voltage to other MCU pins falls before the VCC pin
voltag e f a ll s .
Note: If VCC falls bel o w the minimum value 1.8 V (shaded areas),
the internal circuit becomes unstable. Take additional care
to prev en t ov erv o ltage.
~
~
(1) (2)
~
~
The shortest
CNVSS/VPP
VSS
Approx. 5k
The shortest
(Note)
(Note)
Note. Shows th e microcomputer’s pin.
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 87 of 100
3803 Group (Spec.H QzROM version)
Notes On QzROM Writing Orders
When ordering the QzROM product shipped after writing,
submit the mask file (extension: .msk) which is made by the
mask file converter MM.
Be sure to set the ROM option data* setup when making the
mask file by using the mask file converter MM. The ROM
code protect is specified according to the ROM option data* in
the mask file which is submitted at ordering. Note that the
mask file which has nothing at the ROM option data* or has
the data other than “0016”, “FE16” and “FF16” can not be
accepted.
•SetFF
16” to the ROM code protect address in ROM data
regardless of the presence or absence of a protect. When data
other than “FF16” is set, we may ask that the ROM data be
submitted again.
* ROM option data: mask option noted in MM
Data Required for QzROM Writing Orders
The following are necessary when ordering a QzROM product
shipped after writing:
1. QzROM Writing Confirmation Form*
2. Mark Specification Form*
3. ROM data...........Mask file
* For the QzROM writing confirmation form and the mark
specification form, re fer to the “Renesas Technology Corp.”
Homepage (http://www.renesas.com/homepage.jsp).
Note that we cannot deal with special font marking (customer’s
trademark etc.) in QzROM microcomputer.
QzROM Receive Flow
When writing to QzROM is performed by user side, the
receiving inspection by the following flow is necessary.
Fig. 86 QzROM receive flow
QzROM product shipped in blank
Programming
Verify test
Receiving inspection of
unprotected area (Verify test)
Programming to unprotected area
Verify test for unprotected area
Shipping
User
QzROM product shipped after writing
“protect d isabled”
“protect enabled to the protect area 1”
Renesas
Receiving inspection
(Blank check)
Programming
Verify test for all area
Shipping
User
Renesas
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 88 of 100
3803 Group (Spec.H QzROM version)
ELECTRICAL CHARACTERISTICS
Absolute maximum ratings
NOTES:
1. This value is 300 mW except SP package.
Ta ble 10 Absolute maximum ratings
Symbol Parameter Conditions Ratings Unit
VCC Power source voltages All voltages are based on VSS.
When an input voltage is
measured, output transistors
are cut off.
0.3 to 6.5 V
VIInput voltage P00-P07, P10-P17, P20-P27,
P30, P31, P34-P37, P40-P47,
P50-P57, P60-P67, VREF
0.3 to VCC + 0.3 V
VIInput voltage P32, P330.3 to 5.8 V
VIInput voltage RESET, XIN 0.3 to VCC + 0.3 V
VIInput voltage CNVSS 0.3 to 8.0 V
VOP00-P07, P10-P17, P20-P27,
P30, P31, P34-P37, P40-P47,
P50-P57, P60-P67, XOUT
0.3 to VCC + 0.3 VOutput voltage
VOOutput voltage P32, P330.3 to 5.8 V
PdPower dissipation Ta=25 °C1000(1) mW
Topr Operating temperature −−20 to 85 °C
Tstg Storage temperature −−65 to 125 °C
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 89 of 100
3803 Group (Spec.H QzROM version)
Recommended operating conditions
NOTES:
1. When using A/D converter, see A/D converter recommended operating conditions.
2. The start voltage and the start time for oscillation depend on the using oscillator, oscillation circuit constant value and operating
temperature range, etc.. Particularly a high-frequency oscillator might require some notes in the low voltage operation.
3. When the oscillation frequency has a duty cycle of 50%.
4. When using the microcomputer in low-speed mode, set the sub-clock input oscillation frequency on condition that f(XCIN) < f(XIN)/3.
Table 11 Recommended operating conditions (1)
(V
CC
= 1.8 to 5.5 V, V
SS
= 0 V, Ta = –20 to 85 °C, unless otherwise noted)
Symbol Parameter Conditions Limits Unit
Min. Typ. Max.
VCC Power source
voltage(1) When start oscillating(2) 2.2 5.0 5.5 V
High-speed mode
f(φ) = f(XIN)/2 f(XIN) 2.1 MHz 2.0 5.0 5.5 V
f(XIN) 4.2 MHz 2.2 5.0 5.5
f(XIN) 8.4 MHz 2.7 5.0 5.5
f(XIN) 12.5 MHz 4.0 5.0 5.5
f(XIN) 16.8 MHz 4.5 5.0 5.5
Middle-speed mode
f(φ) = f(XIN)/8 f(XIN) 6.3 MHz 1.8 5.0 5.5 V
f(XIN) 8.4 MHz 2.2 5.0 5.5
f(XIN) 12.5 MHz 2.7 5.0 5.5
f(XIN) 16.8 MHz 4.5 5.0 5.5
VSS Power source voltage 0 V
VIH “H” input voltage
P00-P07, P10-P17,
P20-P27, P30, P31,
P34-P37, P40-P47,
P50-P57, P60-P67
1.8 VCC < 2.7 V 0.85 VCC VCC V
2.7 VCC 5.5 V 0.8 VCC VCC
VIH “H” input voltage
P32, P331.8 VCC < 2.7 V 0.85 VCC 5.5 V
2.7 VCC 5.5 V 0.8 VCC 5.5
VIH “H” input voltage
RESET, XIN, XCIN,
CNVSS
1.8 VCC < 2.7 V 0.85 VCC VCC V
2.7 VCC 5.5 V 0.8 VCC VCC
VIL “L” input voltage
P00-P07, P10-P17,
P20-P27, P30-P37,
P40-P47, P50-P57,
P60-P67
1.8 VCC < 2.7 V 0 0.16 VCC V
2.7 VCC 5.5 V 0 0.2 VCC
VIL “L” input voltage
RESET, CNVSS 1.8 VCC < 2.7 V 0 0.16 VCC V
2.7 VCC 5.5 V 0 0.2 VCC
VIL “L” input voltage
XIN, XCIN 1.8 VCC 5.5 V 0 0.16 VCC V
f(XIN) Main clock input
oscillation
frequency(3)
High-speed mode
f(φ) = f(XIN)/2 2.0 VCC < 2.2 V MHz
2.2 VCC < 2.7 V MHz
2.7 VCC < 4.0 V MHz
4.0 VCC < 4.5 V MHz
4.5 VCC 5.5 V 16.8 MHz
Middle-speed mode
f(φ) = f(XIN)/8 1.8 VCC < 2.2 V MHz
2.2 VCC < 2.7 V MHz
2.7 VCC < 4.5 V MHz
4.5 VCC 5.5 V 16.8 MHz
f(XCIN)Sub-clock input oscillation frequency(3, 4) 32.768 50 kHz
20 VCC 36×()1.05×
2
-----------------------------------------------------------
24 VCC 40.8×()1.05×
3
----------------------------------------------------------------
9VCC 0.3×()1.05×
3
----------------------------------------------------------
24 VCC 60×()1.05×
3
-----------------------------------------------------------
15 VCC 9×()1.05×
3
--------------------------------------------------------
24 VCC 28.8×()1.05×
3
----------------------------------------------------------------
15 VCC 39+×()1.1×
7
--------------------------------------------------------
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 90 of 100
3803 Group (Spec.H QzROM version)
NOTES:
1. The total output current is the sum of all the currents flowing through all the applicable ports. The total average current is an average
value measured over 100 ms. The total peak current is the peak value of all the currents.
2. The peak output current is the peak current flowing in each port.
3. The average output current IOL(avg), IOH(avg) are average value measured over 100 ms.
Table 12 Recommended operating conditions (2)
(VCC = 1.8 to 5.5 V, VSS = 0V, Ta = –20 to 85 °C, unless otherwise noted)
Symbol Parameter Limits Unit
Min. Typ. Max.
ΣIOH(peak) “H” total peak output current(1) P00-P07, P10-P17, P20-P27, P30, P31, P34-P3780 mA
ΣIOH(peak) “H” total peak output current(1) P40-P47, P50-P57, P60-P6780 mA
ΣIOL(peak) “L” total peak output current(1) P00-P07, P10-P17, P30-P3780 mA
ΣIOL(peak) “L” total peak output current(1) P20-P2780 mA
ΣIOL(peak) “L” total peak output current(1) P40-P47, P50-P57, P60-P6780 mA
ΣIOH(avg) “H” total average output current(1) P00-P07, P10-P17, P20-P27, P30, P31, P34-P3740 mA
ΣIOH(avg) “H” total average output current(1) P40-P47, P50-P57, P60-P6740 mA
ΣIOL(avg) “L” total average output current(1) P00-P07, P10-P17, P30-P3740 mA
ΣIOL(avg) “L” total average output current(1) P20-P2740 mA
ΣIOL(avg) “L” total average output current(1) P40-P47, P50-P57, P60-P6740 mA
IOH(peak) “H” peak output current(2) P00-P07, P10-P17, P20-P27, P30, P31, P34-P37,
P40-P47, P50-P57, P60-P67
10 mA
IOL(peak) “L” peak output current(2) P00-P07, P10-P17, P30-P37, P40-P47, P50-P57,
P60-P6710 mA
IOL(peak) “L” peak output current(2) P20-P2720 mA
IOH(avg) “H” average output current(3) P00-P07, P10-P17, P20-P27, P30, P31, P34-P37,
P40-P47, P50-P57, P60-P67
5mA
IOL(avg) “L” average output current(3) P00-P07, P10-P17, P30-P37, P40-P47, P50-P57,
P60-P675mA
IOL(avg) “L” average output current(3) P20-P2710 mA
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 91 of 100
3803 Group (Spec.H QzROM version)
Electrical characteristics
NOTES:
1. P35 is measured when the P35/TXD3 P-channel output disable bit of the UART3 control register (bit 4 of address 003316) is “0”.
P45 is measured when the P45/TXD1 P-channel output disable bit of the UART1 control register (bit 4 of address 001B16) is “0”.
Table 13 Electrical characteristics (1)
(VCC = 1.8 to 5.5 V, VSS = 0V, Ta = –20 to 85 °C, unless otherwise noted)
Symbol Parameter Test conditions Limits Unit
Min. Typ. Max.
VOH “H” output voltage(1)
P00-P07, P10-P17, P20-P27, P30, P31,
P34-P37, P40-P47, P50-P57, P60-P67
IOH = 10 mA
VCC = 4.0 to 5.5 V VCC 2.0 V
IOH = –1.0 mA
VCC = 1.8 to 5.5 V VCC 1.0
VOL “L” output voltage
P00-P07, P10-P17, P20-P27, P30-P37,
P40-P47, P50-P57, P60-P67
IOL = 10 mA
VCC = 4.0 to 5.5 V 2.0 V
IOL = 1.6 mA
VCC = 1.8 to 5.5 V 1.0
VOL “L” output voltage
P20-P27IOL = 20 mA
VCC = 4.0 to 5.5 V 2.0 V
IOL = 1.6 mA
VCC = 1.8 to 5.5 V 0.4
VT+ VTHysteresis
CNTR0, CNTR1, CNTR2, INT0-INT40.4 V
VT+ VTHysteresis
RxD1, SCLK1, SIN2, SCLK2, RxD3, SCLK3 0.5 V
VT+ VTHysteresis
RESET 0.5 V
IIH “H” input current
P00-P07, P10-P17, P20-P27, P30-P37,
P40-P47, P50-P57, P60-P67
VI = VCC
(Pin floating,
Pull-up transistor “off”)
5.0 µA
IIH “H” input current
RESET, CNVSS VI = VCC 5.0 µA
IIH “H” input current
XIN VI = VCC 4.0 µA
IIL “L” input current
P00-P07, P10-P17, P20-P27, P30-P37,
P40-P47, P50-P57, P60-P67
VI = VSS
(Pin floating,
Pull-up transistor “off”)
5.0 µA
IIL “L” input current
RESET, CNVSS VI = VSS 5.0 µA
IIL “L” input current
XIN VI = VSS 4.0 µA
IIL “L” input current (at Pull-up)
P00-P07, P10-P17, P20-P27, P30, P31,
P34-P37, P40-P47, P50-P57, P60-P67
VI = VSS
VCC = 5.0 V 80 210 420 µA
VI = VSS
VCC = 3.0 V 30 70 140
VRAM RAM hold voltage When clock stopped 1.8 VCC V
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 92 of 100
3803 Group (Spec.H QzROM version)
Table 14 Electrical characteristics (2)
(VCC = 1.8 to 5.5 V, Ta = –20 to 85 °C, f(XCIN)=32.768kHz (Stopped in middle-speed mode),
Output transistors “off”, AD converter not operated)
Symbol Parameter Test conditions Limits Unit
Min. Typ. Max.
ICC Power source
current High-speed
mode VCC = 5.0 V f(XIN) = 16.8 MHz 8.0 15.0 mA
f(XIN) = 12.5 MHz 6.5 12.0
f(XIN) = 8.4 MHz 5.0 9.0
f(XIN) = 4.2 MHz 2.5 5.0
f(XIN) = 16.8 MHz (in WIT state) 2.0 3.6
VCC = 3.0 V f(XIN) = 8.4 MHz 1.9 3.8 mA
f(XIN) = 4.2 MHz 1.0 2.0
f(XIN) = 2.1 MHz 0.6 1.2
Middle-speed
mode VCC = 5.0 V f(XIN) = 16.8 MHz 4.0 7.0 mA
f(XIN) = 12.5 MHz 3.0 6.0
f(XIN) = 8.4 MHz 2.5 5.0
f(XIN) = 16.8 MHz (in WIT state) 1.8 3.3
VCC = 3.0 V f(XIN) = 12.5 MHz 1.5 3.0 mA
f(XIN) = 8.4 MHz 1.2 2.4
f(XIN) = 6.3 MHz 1.0 2.0
Low-speed
mode VCC = 5.0 V f(XIN) = stopped 55 200 µA
In WIT state 40 70
VCC = 3.0 V f(XIN) = stopped 15 40 µA
In WIT state 8 15
VCC = 2.0 V f(XIN) = stopped 6 15 µA
In WIT state 3 6
In STP state
(All oscillation stopped) Ta = 25 °C0.11.0µA
Ta = 85 °C10
Increment when A/D
conversion is executed f(XIN) = 16.8 MHz, VCC = 5.0 V
In Middle-, high-speed mode 500 µA
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 93 of 100
3803 Group (Spec.H QzROM version)
A/D converter char acteristics
NOTES:
1. 8-bit A/D mode: When the conversion mode selection bit (bit 7 of address 003816) is “1”.
2. 10-bit A/D mode: When the conversion mode selection bit (bit 7 of address 003816) is “0”.
NOTES:
1. 8-bit A/D mode: When the conversion mode selection bit (bit 7 of address 003816) is “1”.
2. 10-bit A/D mode: When the conversion mode selection bit (bit 7 of address 003816) is “0”.
D/A converter char acteristics
NOTES:
1. Using one D/A converter, with the value in the other DAi conversion register (i=1, 2) being “0016”.
Table 15 A/D converter recommended operating conditions
(VCC = 2.0 to 5.5 V, VSS = AVSS = 0 V, Ta = –20 to 85 °C, unless otherwise noted)
Symbol Parameter Conditions Limits Unit
Min. Typ. Max.
VCC Power source voltage
(When A/D converter is used) 8-bit A/D mode(1) 2.0 5.0 5.5 V
10-bit A/D mode(2) 2.2 5.0 5.5
VREF Analog convert reference voltage 2.0 VCC V
AVSS Analog power source voltage 0 V
VIA Analog input voltage AN0-AN15 0VCC V
f(XIN) Main clock input oscillation
frequency
(When A/D converter is used)
2.0 VCC = VREF < 2.2 V 0.5 MHz
2.2 VCC = VREF < 2.7 V 0.5
2.7 VCC = VREF < 4.0 V 0.5
4.0 VCC = VREF < 4.5 V 0.5
4.5 VCC = VREF 5.5 V 0.5 16.8
20 VCC 36×()1.05×
2
-----------------------------------------------------------
24 VCC 40.8×()1.05×
3
----------------------------------------------------------------
9VCC 0.3×()1.05×
3
----------------------------------------------------------
24.6 VCC 62.7×()1.05×
3
---------------------------------------------------------------------
Table 16 A/D converter characteristics
(VCC = 2.0 to 5.5 V, VSS = AVSS = 0 V, Ta = –20 to 85 °C, unless otherwise noted)
Symbol Parameter Test conditions Limits Unit
Min. Typ. Max.
Resolution 8-bit A/D mode(1) 8bit
10-bit A/D mode(2) 10
Absolute accuracy
(excluding quantization error) 8-bit A/D mode(1) 2.0 VREF < 2.2 V ±3 LSB
2.2 VREF 5.5 V ±2
10-bit A/D mode(2) 2.2 VREF < 2.7 V ±5 LSB
2.7 VREF 5.5 V ±4
tCONV Conversion time 8-bit A/D mode(1) 50 2tc(XIN)
10-bit A/D mode(2) 61
RLADDER Ladder resistor 12 35 100 k
IVREF Reference power
source input current at A/D converter operated VREF = 5.0 V 50 150 200 µA
at A/D converter stopped VREF = 5.0 V 5.0 µA
II(AD) A/D port input current 5.0 µA
Table 17 D/A converter characteristics
(VCC = 2.7 to 5.5 V, VREF = 2.7 V to VCC, VSS = AVSS = 0 V, Ta = –20 to 85 °C, unless otherwise noted)
Symbol Parameter Limits Unit
Min. Typ. Max.
Resolution 8bit
Absolute accuracy 4.0 VREF 5.5 V 1.0 %
2.7 VREF < 4.0 V 2.5
tsu Setting time 3µs
RO Output resistor 2 3.5 5 k
IVREF Reference power source input current(1) 3.2 mA
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 94 of 100
3803 Group (Spec.H QzROM version)
Timing requirements and switching characteristics
Table 18 Timing requirements (1)
(VCC = 2.0 to 5.5 V, VSS = 0V, Ta = –20 to 85 °C, unless otherwise noted)
Symbol Parameter Limits Unit
Min. Typ. Max.
tW(RESET) Reset input “L” pulse width 16 XIN cycle
tC(XIN) Main clock XIN
input cycle time 4.5 VCC 5.5 V 59.5 ns
4.0 VCC < 4.5 V 10000/(86 VCC 219)
2.7 VCC < 4.0 V 26 × 103/(82 VCC - 3)
2.2 VCC < 2.7 V 10000/(84 VCC 143)
2.0 VCC < 2.2 V 10000/(105 VCC 189)
tWH(XIN) Main clock XIN
input “H” pulse width 4.5 VCC 5.5 V 25 ns
4.0 VCC < 4.5 V 4000/(86 VCC 219)
2.7 VCC < 4.0 V 10000/(82 VCC 3)
2.2 VCC < 2.7 V 4000/(84 VCC 143)
2.0 VCC < 2.2 V 4000/(105 VCC 189)
tWL(XIN) Main clock XIN
input “L” pulse width 4.5 VCC 5.5 V 25 ns
4.0 VCC < 4.5 V 4000/(86 VCC 219)
2.7 VCC < 4.0 V 10000/(82 VCC 3)
2.2 VCC < 2.7 V 4000/(84 VCC 143)
2.0 VCC < 2.2 V 4000/(105 VCC 189)
tC(XCIN) Sub-clock XCIN input cycle time 20 µs
tWH(XCIN) Sub-clock XCIN input “H” pulse width 5 µs
tWL(XCIN) Sub-clock XCIN input “L” pulse width 5 µs
tC(CNTR) CNTR0CNTR2
input cycle time 4.5 VCC 5.5 V 120 ns
4.0 VCC < 4.5 V 160
2.7 VCC < 4.0 V 250
2.2 VCC < 2.7 V 500
2.0 VCC < 2.2 V 1000
tWH(CNTR) CNTR0CNTR2
input “H” pulse width 4.5 VCC 5.5 V 48 ns
4.0 VCC < 4.5 V 64
2.7 VCC < 4.0 V 115
2.2 VCC < 2.7 V 230
2.0 VCC < 2.2 V 460
tWL(CNTR) CNTR0CNTR2
input “L” pulse width 4.5 VCC 5.5 V 48 ns
4.0 VCC < 4.5 V 64
2.7 VCC < 4.0 V 115
2.2 VCC < 2.7 V 230
2.0 VCC < 2.2 V 460
tWH(INT) INT00, INT01, INT1, INT2,
INT3, INT40, INT41
input “H” pulse width
4.5 VCC 5.5 V 48 ns
4.0 VCC < 4.5 V 64
2.7 VCC < 4.0 V 115
2.2 VCC < 2.7 V 230
2.0 VCC < 2.2 V 460
tWL(INT) INT00, INT01, INT1, INT2,
INT3, INT40, INT41
input “L” pulse width
4.5 VCC 5.5 V 48 ns
4.0 VCC < 4.5 V 64
2.7 VCC < 4.0 V 115
2.2 VCC < 2.7 V 230
2.0 VCC < 2.2 V 460
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 95 of 100
3803 Group (Spec.H QzROM version)
NOTES:
1. When bit 6 of address 001A16 and bit 6 of address 003216 are “1” (clock synchronous).
Divide this value by four when bit 6 of address 001A16 and bit 6 of address 003216 are “0” (UART).
Table 19 Timing requirements (2)
(VCC = 2.0 to 5.5 V, VSS = 0V, Ta = 20 to 85 °C, unless oth erwise noted)
Symbol Parameter Limits Unit
Min. Typ. Max.
tC(SCLK1)
tC(SCLK3)Serial I/O1, serial I/O3
clock input cycle time(1) 4.5 VCC 5.5 V 250 ns
4.0 VCC < 4.5 V 320
2.7 VCC < 4.0 V 500
2.2 VCC < 2.7 V 1000
2.0 VCC < 2.2 V 2000
tWH(SCLK1)
tWH(SCLK3)Serial I/O1, serial I/O3
clock input “H” pulse width(1) 4.5 VCC 5.5 V 120 ns
4.0 VCC < 4.5 V 150
2.7 VCC < 4.0 V 240
2.2 VCC < 2.7 V 480
2.0 VCC < 2.2 V 950
tWL(SCLK1)
tWL(SCLK3)Serial I/O1, serial I/O3
clock input “L” pulse width(1) 4.5 VCC 5.5 V 120 ns
4.0 VCC < 4.5 V 150
2.7 VCC < 4.0 V 240
2.2 VCC < 2.7 V 480
2.0 VCC < 2.2 V 950
tsu(RxD1-SCLK1)
tsu(RxD3-SCLK3)Serial I/O1, serial I/O3
clock input setup time 4.5 VCC 5.5 V 70 ns
4.0 VCC < 4.5 V 90
2.7 VCC < 4.0 V 100
2.2 VCC < 2.7 V 200
2.0 VCC < 2.2 V 400
th(SCLK1-RxD1)
th(SCLK3-RxD3)Serial I/O1, serial I/O3
clock input hold time 4.5 VCC 5.5 V 32 ns
4.0 VCC < 4.5 V 40
2.7 VCC < 4.0 V 50
2.2 VCC < 2.7 V 100
2.0 VCC < 2.2 V 200
tC(SCLK2)Serial I/O2
clock input cycle time 4.5 VCC 5.5 V 500 ns
4.0 VCC < 4.5 V 650
2.7 VCC < 4.0 V 1000
2.2 VCC < 2.7 V 2000
2.0 VCC < 2.2 V 4000
tWH(SCLK2)Serial I/O2
clock input “H” pulse width 4.5 VCC 5.5 V 200 ns
4.0 VCC < 4.5 V 260
2.7 VCC < 4.0 V 400
2.2 VCC < 2.7 V 950
2.0 VCC < 2.2 V 2000
tWL(SCLK2)Serial I/O2
clock input “L” pulse width 4.5 VCC 5.5 V 200 ns
4.0 VCC < 4.5 V 260
2.7 VCC < 4.0 V 400
2.2 VCC < 2.7 V 950
2.0 VCC < 2.2 V 2000
tsu(SIN2-SCLK2)Serial I/O2
clock input setup time 4.5 VCC 5.5 V 100 ns
4.0 VCC < 4.5 V 130
2.7 VCC < 4.0 V 200
2.2 VCC < 2.7 V 400
2.0 VCC < 2.2 V 800
th(SCLK2-SIN2)Serial I/O2
clock input hold time 4.5 VCC 5.5 V 100 ns
4.0 VCC < 4.5 V 130
2.7 VCC < 4.0 V 150
2.2 VCC < 2.7 V 300
2.0 VCC < 2.2 V 600
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 96 of 100
3803 Group (Spec.H QzROM version)
NOTES:
1. When the P45/TXD1 P-channel output disable bit of the UART1 control register (bit 4 of address 001B16) is “0”.
Ta ble 20 Switching characteristics (1)
(VCC = 2.0 to 5.5 V, VSS = 0V, Ta = 20 to 85 °C, unless oth erwise noted)
Symbol Parameter Test
conditions
Limits Unit
Min. Typ. Max.
tWH(SCLK1)
tWH(SCLK3)Serial I/O1, serial I/O3
clock output “H” pulse
width
4.5 VCC 5.5 V
Fig.87
tC(SCLK1)/2-30, tC(SCLK3)/2-30 ns
4.0 VCC < 4.5 V tC(SCLK1)/2-35, tC(SCLK3)/2-35
2.7 VCC < 4.0 V tC(SCLK1)/2-40, tC(SCLK3)/2-40
2.2 VCC < 2.7 V tC(SCLK1)/2-45, tC(SCLK3)/2-45
2.0 VCC < 2.2 V tC(SCLK1)/2-50, tC(SCLK3)/2-50
tWL(SCLK1)
tWL(SCLK3)Serial I/O1, serial I/O3
clock output “L” pulse
width
4.5 VCC 5.5 V tC(SCLK1)/2-30, tC(SCLK3)/2-30 ns
4.0 VCC < 4.5 V tC(SCLK1)/2-35, tC(SCLK3)/2-35
2.7 VCC < 4.0 V tC(SCLK1)/2-40, tC(SCLK3)/2-40
2.2 VCC < 2.7 V tC(SCLK1)/2-45, tC(SCLK3)/2-45
2.0 VCC < 2.2 V tC(SCLK1)/2-50, tC(SCLK3)/2-50
td(SCLK1-TxD1)
td(SCLK3-TxD3)Serial I/O1, serial I/O3
output delay time(1) 4.5 VCC 5.5 V 140 ns
4.0 VCC < 4.5 V 200
2.7 VCC < 4.0 V 350
2.2 VCC < 2.7 V 400
2.0 VCC < 2.2 V 420
tV(SCLK1-TxD1)
tV(SCLK3-TxD3)Serial I/O1, serial I/O3
output valid time(1) 4.5 VCC 5.5 V 30 ns
4.0 VCC < 4.5 V 30
2.7 VCC < 4.0 V 30
2.2 VCC < 2.7 V 30
2.0 VCC < 2.2 V 30
tr(SCLK1)
tr(SCLK3)Serial I/O1, serial I/O3
rise time of clock
output
4.5 VCC 5.5 V 30 ns
4.0 VCC < 4.5 V 35
2.7 VCC < 4.0 V 40
2.2 VCC < 2.7 V 45
2.0 VCC < 2.2 V 50
tf(SCLK1)
tf(SCLK3)Serial I/O1, serial I/O3
fall time of clock output 4.5 VCC 5.5 V 30 ns
4.0 VCC < 4.5 V 35
2.7 VCC < 4.0 V 40
2.2 VCC < 2.7 V 45
2.0 VCC < 2.2 V 50
tWH(SCLK2) Serial I/O2
clock output “H” pulse
width
4.5 VCC 5.5 V tC(SCLK2)/2-160 ns
4.0 VCC < 4.5 V tC(SCLK2)/2-200
2.7 VCC < 4.0 V tC(SCLK2)/2-240
2.2 VCC < 2.7 V tC(SCLK2)/2-260
2.0 VCC < 2.2 V tC(SCLK2)/2-280
tWL(SCLK2) Serial I/O2
clock output “L” pulse
width
4.5 VCC 5.5 V tC(SCLK2)/2-160 ns
4.0 VCC < 4.5 V tC(SCLK2)/2-200
2.7 VCC < 4.0 V tC(SCLK2)/2-240
2.2 VCC < 2.7 V tC(SCLK2)/2-260
2.0 VCC < 2.2 V tC(SCLK2)/2-280
td(SCLK2-SOUT2) Serial I/O2
output delay time 4.5 VCC 5.5 V 200 ns
4.0 VCC < 4.5 V 250
2.7 VCC < 4.0 V 300
2.2 VCC < 2.7 V 350
2.0 VCC < 2.2 V 400
t
V
(S
CLK2
-S
OUT2
)
Serial I/O2
output valid time 4.5 VCC 5.5 V 0 ns
4.0 VCC < 4.5 V 0
2.7 VCC < 4.0 V 0
2.2 VCC < 2.7 V 0
2.0 VCC < 2.2 V 0
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 97 of 100
3803 Group (Spec.H QzROM version)
NOTES:
1. When the P35/TXD3 P4-channel output disable bit of the UART3 control register (bit 4 of address 003316) is “0”.
Fig 87.
Circuit for measuring output switching characteristics (1)
Fig 88.
Circuit for measuring output switching characteristics (2)
Ta ble 21 Switching characteristics (2)
(VCC = 2.0 to 5.5 V, VSS = 0V, Ta = 20 to 85 °C, unless oth erwise noted)
Symbol Parameter Test
conditions
Limits Unit
Min. Typ. Max.
tf(SCLK2) Serial I/O2
fall time of clock output 4.5 VCC 5.5 V
Fig.87
30 ns
4.0 VCC < 4.5 V 35
2.7 VCC < 4.0 V 40
2.2 VCC < 2.7 V 45
2.0 VCC < 2.2 V 50
tr(CMOS) CMOS
rise time of output(1) 4.5 VCC 5.5 V 10 30 ns
4.0 VCC < 4.5 V 12 35
2.7 VCC < 4.0 V 15 40
2.2 VCC < 2.7 V 17 45
2.0 VCC < 2.2 V 20 50
tf(CMOS) CMOS
fall time of output(1) 4.5 VCC 5.5 V 10 30 ns
4.0 VCC < 4.5 V 12 35
2.7 VCC < 4.0 V 15 40
2.2 VCC < 2.7 V 17 45
2.0 VCC < 2.2 V 20 50
Measurement output pin
100pF
CMOS output
Measurement out put pin
100pF
N-channel open-drain output
1k
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 98 of 100
3803 Group (Spec.H QzROM version)
Fig 89. Timing diagram (in single-chip mode)
tC(CNTR) tWL(CNTR)
tWH(CNTR)
0.8VCC 0.2VCC
CNTR0, CNTR1
CNTR2
INT1, INT2, INT3
INT00, INT40
INT01, INT41
RESET
XIN
tWL(INT)tWH(INT)
0.8VCC 0.2VCC
0.8VCC
0.2VCC
tW(RESET)
tC(XIN)tWL(XIN)
tWH(XIN)
0.8VCC 0.2VCC
tC(SCLK1), tC(SCLK2), tC(SCLK3)
tWL(SCLK1), tWL(SCLK2), tWL(SCLK3)
0.8VCC
0.2VCC
tWH(SCLK1), tWH(SCLK2), tWH(SCLK3)
tftr
tsu(RXD1-SCLK1),
tsu(SIN2-SCLK2),
tsu(RXD3-SCLK3)
th(SCLK1-RXD1),
th(SCLK2-SIN2),
th(SCLK3-RXD3)
td(SCLK1-TXD1), td(SCLK2-SOUT2), td(SCLK3-TXD3)
tv(SCLK1-TXD1),
tv(SCLK2-SOUT2),
tv(SCLK3-TXD3)
0.2VCC
0.8VCC
SCLK1
SCLK2
SCLK3
RXD1
RXD3
SIN2
TXD1
TXD3
SOUT2
XCIN
tC(XCIN)tWL(XCIN)
tWH(XCIN)
0.8VCC 0.2VCC
Single-chip mode timing diagram
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 99 of 100
3803 Group (Spec.H QzROM version)
PACKAGE OUTLINE
Diagrams showing the lates t package dimensions and mounting information are available in the “Packages” section of the Renesas
Technology website.
3.8
A
2
1.050.750.65
b
2
19.3518.75 19.05
0.60.50.4
b
p
Previous CodeJEITA Package Code RENESAS Code
PRDP0064BA-A 64P4B
MASS[Typ.]
7.9gP-SDIP64-17x56.4-1.78
0.320.250.2
MaxNomMin
Dimension in Millimeters
Symbol
Reference
56.656.456.2
D
17.15
17.0
16.85
E
A
1.31.00.9
0.38
2.8
L
c
1.778
e
15°
b
3
A
1
5.08
1.528 2.028
INCLUDE TRIM OFFSET.
DIMENSION "*3" DOES NOT
NOTE)
DO NOT INCLUDE MOLD FLASH.
DIMENSIONS "*1" AND "*2"1.
2.
33
64
32
1
SEATING PLANE
*1
*2
*3*3
E
c
A
1
A
2
D
L A
b2
eb3bp
e
1
e
1
Terminal cross section
b1
c
1
bp
c
2.
1. DIMENSIONS "*1" AND "*2"
DO NOT INCLUDE MOLD FLASH.
NOTE)
DIMENSION "*3" DOES NOT
INCLUDE TRIM OFFSET.
Index mark
*3
17
32
64
49
116
3348
F
*1
*2
x
y
bp
H
E
E
HD
D
ZD
Z
E
Detail F
A
c
A
2
A
1
L1
L
P-LQFP64-10x10-0.50 0.3g
MASS[Typ.]
64P6Q-A / FP-64K / FP-64KVPLQP0064KB-A
RENESAS CodeJEITA Package Code Previous Code
1.0
0.125
0.18
1.25
1.25
0.08
0.20
0.145
0.09
0.250.200.15
MaxNomMin
Dimension in Millimeters
Symbol
Reference
10.110.0
9.9
D
10.110.0
9.9
E
1.4
A
2
12.212.011.8
12.212.011.8
1.7
A
0.15
0.1
0.05
0.65
0.5
0.35
L
x
c
0.5
e
0.08
y
H
D
H
E
A
1
b
p
b
1
c
1
Z
D
Z
E
L
1
e
REJ03B0166-0113 Rev.1.13 Aug 21, 2009
Page 100 of 100
3803 Group (Spec.H QzROM version)
Terminal cross section
b1
c1
bp
c
2.
1. DIMENSIONS "*1" AND "*2"
DO NOT INCLUDE MOLD FLASH.
NOTE)
DIMENSION "*3" DOES NOT
INCLUDE TRIM OFFSET.
*3
116
17
32
33
48
49
64
F
*1
*2
x
y
Index mark
D
H
D
E
H
E
eb
p
Z
D
Z
E
Detail F
c
A
A
2
A
1
L
L
1
Previous CodeJEITA Package Code RENESAS Code
PLQP0064GA-A 64P6U-A
MASS[Typ.]
0.7gP-LQFP64-14x14-0.80
1.0
0.125
0.35
1.0
1.0
0.20
0.20
0.145
0.09
0.420.370.32
MaxNomMin
Dimension in Millimeters
Symbol
Reference
14.114.013.9
D
14.114.013.9
E
1.4
A
2
16.216.015.8
16.216.015.8
1.7
A
0.20.1
0
0.70.50.3
L
x
c
0.8
e
0.10
y
H
D
H
E
A
1
b
p
b
1
c
1
Z
D
Z
E
L
1
0.15
v
0.20
w
Previous CodeJEITA Package Code RENESAS Code
PTLG0064JA-A 64F0G
MASS[Typ.]
0.07gP-TFLGA64-6x6-0.65
0.08
0.470.430.39
MaxNomMin
Dimension in Millimeters
Symbol
Reference
6.0
D
6.0
E
1.05
A
x
0.65
e
0.10
y
b
1
b0.31 0.35 0.39
B
w
S
wA
S
A
H
G
F
E
D
C
B
12345678
S
yS
AB
Index mark
SAB
v
x4
(Laser mark)
Index mark
D
E
A
b
1
b
e
e
A - 1
REVISION HISTORY 3803 Group (Spec.H QzROM version) Datasheet
Rev. Date Description
Page Summary
1.00 Sep. 30, 200 First Edition issued
1.10 Nov. 14, 2005 20 Fig 14. Port block diagra m (3) (1 8) Port P56 revised
61 Fig 54. Block diagram of Watchdog timer;
STP instruction disable bit
STP instruction function sele ction bit re vised
69 QzROM version; appr o xim ately 1 k to 5 k resistor
approximately 5 k resistor
Fig 47. Wiring for the CNVSS/VPP added
Notes On QzROM Writing Orders; (extensio n: .mask)
(extension: .msk) revised
82 to 83 Package Outline revised
84 to 91 Appe ndix added
1.13 Aug 21, 2009 1 FEATURES revised
2 Table 1 moved
Last Table 2 deleted
3 Last Table 3 deleted
4 Fig 3 added
5 Table 1 added
6 Fig 4 revised
7 Table 2 revised
8 Fig 5 revised
9 Packages revised
Fig 6 revised
10 GROUP DESCRIPTION deleted
Table 3 re vise d
16 Fig 11 revised
17 Fig 12 revised
18 Table 6 revised
21 Fig 15 revised
26 Termination of unused pins added
Tabl e 7 ad ded
27 to 32 Chapter “INTERRUPTS” revised
46 Fig 37 revised
47 (2) Asynchronous Serial I/O (UART) Mode revised
Fig 39 revised
48 [Serial I/O1 Status Register (SIO1STS)] revised
50 <Notes concerni ng serial I/O1> revised
51 6. Transmission control when external clock is selected revised
Reason revised
53 Fig 43 revised
54 (1) Clock Synchronous Serial I/O Mode revised
Fig 45 revised
REVISION HI STO RY
A - 2
REVISION HISTORY 3803 Group (Spec.H QzROM version) Datasheet
All trademarks and registered trademarks are the property of their respective owners.
1.13 Aug 21, 2009 55 (2) Asynchronous Serial I/O (UART) Mode revised
Fig 47 revised
56 [Serial I/O3 Status Register (SIO3STS)] revised
58 <Notes concerni ng serial I/O3> revised
59 6. Transmission control when external clock is selected revised
7. Transmit interrupt request when transmit enable bit is set revised
60 PWM Operation revised
62 [AD Conver sion Register 1, 2] AD1, AD2 revised
[AD/DA Control Register] ADCON revised
[Compara tor and Control Circuit]] revised
Fig 54 added
Fig 55 revised
64 D/A CONVERTER revis ed
65 Watchdog Timer Initial Value revised
Fig 59 revised
69 Fig 64 revised
Fig 65 revised
70 Fig 66 revised
72 QzROM Writing Mode added
Tabl e 9 ad ded
73 Fig 68 added
74 Fig 69 added
75 Fig 70 added
76 Fig 71 added
77 Fig 72 added
78 to 87 NOTES revised
88 Table 10 rev i se d
91 Table 13 rev i se d
93 Table 15 rev i se d
Table 17 revised
99 PACKAGE OUTLINE revised
Rev. Date Description
Page Summary
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.
Sales Strategic Planning Div. Nippon Bldg., 2-6-2, Ohte-machi, Chiyoda-ku, Tokyo 100-0004, Japan
http://www.renesas.com
Refer to "http://www.renesas.com/en/network" for the latest and detailed information.
Renesas Technology America, Inc.
450 Holger Way, San Jose, CA 95134-1368, U.S.A
Tel: <1> (408) 382-7500, Fax: <1> (408) 382-7501
Renesas Technology Europe Limited
Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.K.
Tel: <44> (1628) 585-100, Fax: <44> (1628) 585-900
Renesas Technology (Shanghai) Co., Ltd.
Unit 204, 205, AZIACenter, No.1233 Lujiazui Ring Rd, Pudong District, Shanghai, China 200120
Tel: <86> (21) 5877-1818, Fax: <86> (21) 6887-7858/7898
Renesas Technology Hong Kong Ltd.
7th Floor, North Tower, World Finance Centre, Harbour City, Canton Road, Tsimshatsui, Kowloon, Hong Kong
Tel: <852> 2265-6688, Fax: <852> 2377-3473
Renesas Technology Taiwan Co., Ltd.
10th Floor, No.99, Fushing North Road, Taipei, Taiwan
Tel: <886> (2) 2715-2888, Fax: <886> (2) 3518-3399
Renesas Technology Singapore Pte. Ltd.
1 Harbour Front Avenue, #06-10, Keppel Bay Tower, Singapore 098632
Tel: <65> 6213-0200, Fax: <65> 6278-8001
Renesas Technology Korea Co., Ltd.
Kukje Center Bldg. 18th Fl., 191, 2-ka, Hangang-ro, Yongsan-ku, Seoul 140-702, Korea
Tel: <82> (2) 796-3115, Fax: <82> (2) 796-2145
Renesas Technology Malaysia Sdn. Bhd
Unit 906, Block B, Menara Amcorp, Amcorp Trade Centre, No.18, Jln Persiaran Barat, 46050 Petaling Jaya, Selangor Darul Ehsan, Malaysia
Tel: <603> 7955-9390, Fax: <603> 7955-9510
RENESAS SALES OFFICES
© 2009. Renesas Technology Corp., All rights reserved. Printed in Japan.
Colophon .7.2