PanaXSeries is a trademark of Matsushita Electric Industrial Co., Ltd.
The other corporation names, logotype and product names written in this book are trademarks or registered trademarks of their
corresponding corporations.
Request for your special attention and precautions in using the technical information
and semiconductors described in this book
(1) An export permit needs to be obtained from the competent authorities of the Japanese Government if any of
the products or technologies described in this book and controlled under the "Foreign Exchange and Foreign
Trade Law" is to be exported or taken out of Japan.
(2) The technical information described in this book is limited to showing representative characteristics and
applied circuits examples of the products. It neither warrants non-infringement of intellectual property right
or any other rights owned by our company or a third party, nor grants any license.
(3) W e are not liable for the infringement of rights owned by a third party arising out of the use of the product or
technologies as described in this book.
(4) The products described in this book are intended to be used for standard applications or general electronic
equipment (such as office equipment, communications equipment, measuring instrument s and household
appliances).
Consult our sales staff in advance for information on the following applications:
• Special applications (such as for airplanes, aerospace, automobiles, traffic control equipment, combustion
equipment, life support systems and safety devices) in which exceptional quality and reliability are required,
or if the failure or malfunction of the products may directly jeopardize life or harm the human body.
• Any applications other than the standard applications intended.
(5) The products and product specifications described in this book are subject to change without notice for
modification and/or improvement. At the final stage of your design, purchasing, or use of the prod ucts,
therefore, ask for the most up-to-date Product Standards in advance to make sure that the latest specifications
satisfy your requirements.
(6) When designing your equipment, comply with the guaranteed values, in particular those of maximum rating,
the range of operating power supply volta ge, and heat radiation characteristics. Otherwise, we will not be
liable for any defect which may arise later in your equipment.
Even when the products are used within the guaranteed values, take into the consideration of incidence of
break down and failure mode, possible to occur to semiconductor products. Measures on the systems such as
redundant design, arresting the spread of fire or preventing glitch are recommended in order to prevent
physical injury, fire, social damages, for example, by using the products.
(7) When using products for which damp-proof packing is required, observe the conditions (including shelf life
and amount of time let standing of unsealed items) agreed upon when specification sheets are individually
exchanged.
(8) This book may be not reprinted or reproduced whether wholly or partially, without the prior written
permission of Matsushita Electric Industrial Co., Ltd.
If you have any inquiries or questions about this book or our semiconductors, please contact one of our sales
offices listed at the back of this book.
Page 4
About This Manual
Organization
In this LSI manual, this LSI functions are presented in the following order : overview, basic CPU functions, interrupt
functions, port functions, timer functions, serial functions, and other peripheral hardware functions.
Each section contains overview of function, block diagram, control register, operation, and setting example.
Manual Configuration
Each section of this manual consists of a title, summary, main text, key information, precautions and warnings, and
references.
The layout and definition of each section are shown below.
Subtitle
Sub-subtitle
The smallest block
in this manual.
Main text
Key information
Important information
from the text.
Chapter 2 Basic CPU
2-8Reset
2-8-1Reset operation
The CPU contents are reset and registers are initialized when the NRST pin (P.27) is pulled to low.
Initiating a Reset
There are two methods to initiate a reset.
(1) Drive the NRST pin low for at least four clock cycles.
NRST pin should be holded "low" for more than 4 clock cycles (200 nS at a 20 MHz).
NRST pin
4 clock cycles
(200 nS at a 20 MHz)
Figure 2-8-1 Minimum Reset Pulse Width
(2) Setting the P2OUT7 flag of the P2OUT register to "0" outputs low level at P27 (NRST) pin. And
transfering to reset by program (software reset) can be executed. If the internal LSI is reset and
register is initiated, the P2OUT7 flag becomes "1" and reset is released.
[ Chapter 4. 4-4-2 Registers ]
On this LSI, the starting mode is NORMAL mode that high oscillation is the base clock.
When the power voltage low circuit is connected to NRST pin, circuit that gives pulse for
enough low level time at sudeen unconnected. And reset can be generated even if its pulse
is low level as the oscillation clock is under 4 clocks, take notice of noise.
Summary
Introduction to the
section.
References
References for the
main text.
Precautions and
warnings
Precautions are listed
in case.
Be sure to read these
of lost functionality or
damage.
About This Manual 1
II - 44
Reset
Page 5
Finding Desired Information
This manual provides three methods for finding desired information quickly and easily.
(1) Consult the index at the front of the manual to locate the beginning of each section.
(2) Consult the table of contents at the front of the manual to locate desired titles.
(3) Chapter names are located at the top outer corner of each page, and section titles are located
at the bottom outer corner of each page.
Related Manuals
Note that the following related documents are available.
"MN101C Series LSI user's Manual"
<Describes the device hardware>
"MN101C Series Instruction Manual"
<Describes the instruction set.>
"MN101C Series C Compiler User's Manual: Usage Guide"
<Describes the installation, the commands, and options of the C Compiler.>
"MN101C Series C Compiler User's Manual: Language Description"
<Describes the syntax of the C Compiler.>
"MN101C Series C Compiler User's Manual: Library Reference"
<Describes the standard library of the C Compiler.>
"MN101C Series Cross-assembler User's Manual"
<Describes the assembler syntax and notation.>
"MN101C Series C Source Code Debugger User's Manual"
<Describes the use of C source code debugger.>
"MN101C Series PanaX Series Installation Manual"
<Describes the installation of C compiler, cross-assembler and C source code debugger
and the procedure for bringing up the in-circuit emulator.>
About This Manual 2
Page 6
Page 7
Chapter 1Overview
1
Chapter 2 CPU Basics
Chapter 3Interrupts
2
3
3
Chapter 4I/O Ports
Chapter 5Prescaler5
Chapter 68-bit Timers
Chapter 716-bit Timer
Chapter 8Time Base Timer /
8-bit Free-running Timer
4
6
7
8
11
2
Chapter 9Watchdog Timer
Chapter 10Buzzer
Chapter 11Serial Interface 0,1
Chapter 12Serial Interface 3
Chapter 13Serial Interface 4
Chapter 14Automatic Transfer
Controller
Chapter 15A/D Converter
9
10
11
12
13
14
15
Chapter 16D/A Converter
Chapter 17Appendices
Chapter 18Flash EEPROM
16
17
18
Page 8
Contents
Chapter 1Overview
1-1Overview ..................................................................................................................... I - 2
1-1-1Overview .................................................................................................... I - 2
1-1-2Product Summary ....................................................................................... I - 2
1-2Hardware Functions .................................................................................................... I - 3
1-3Pin Description............................................................................................................ I - 9
1-3-1Pin Configuration ....................................................................................... I - 9
1-3-2Pin Specification....................................................................................... I - 10
1-3-3Pin Functions ........................................................................................... I - 1 1
1- 4Block Diagram ........................................................................................................... I - 17
1-4-1Block Diagram .......................................................................................... I - 1 7
1- 5Electrical Characteristics ........................................................................................... I - 18
1-5-1Absolute Maximum Ratings ..................................................................... I - 18
1-5-2Operating Conditions ............................................................................... I - 19
1-5-3DC Characteristics .................................................................................... I - 22
1-5-4A/D Converter Characteristics ................................................................. I - 26
1-5-5D/A Converter Characteristics ................................................................. I - 27
1-6Precautions................................................................................................................ I - 28
1-6-1General Usage .......................................................................................... I - 28
1-6-2Unused Pins ............................................................................................. I - 2 9
1-6-3Power Supply ........................................................................................... I - 31
1-6-4Power Supply Circuit................................................................................ I - 32
1-7Package Dimension ................................................................................................... I - 33
Chapter 2 CPU Basics
2-1Overview.................................................................................................................. II - 2
2-1-1Block Diagram ....................................................................................... II - 3
2-1-2CPU Control Registers ........................................................................... II - 4
2-1-3Instruction Execution Controller ........................................................... II - 5
2-1-4Pipeline Process...................................................................................... II - 6
2-1-5Registers for Address.............................................................................. II - 6
2-1-6Registers for Data ................................................................................... II - 7
2-1-7Processor Status Word ............................................................................ II - 8
2-1-8Addressing Modes ............................................................................... II - 10
2-2Memory Space....................................................................................................... II - 12
2-2-1Memory Mode ...................................................................................... II - 12
2-2-2Single-chip Mode ................................................................................. II - 13
2-2-3Special Function Registers...................................................................... II - 14
2-3Bus Interface ............................................................................................................ II - 15
ii
contents
Page 9
2-3-1Bus Controller ......................................................................................... II - 15
2-3-2Control Registers..................................................................................... II - 16
2-4Standby Function..................................................................................................... II - 19
2-4-1Overview ................................................................................................. II - 19
2-4-2CPU Mode Control Register.................................................................... II - 2 1
2-4-3Transition between SLOW and NORMAL.............................................. II - 22
2-4-4Transition to ST ANDBY Modes ............................................................. II - 23
2- 5Clock Switching........................................................................................................ II - 25
2-6Bank Function .......................................................................................................... II - 27
2-6-1Overview ................................................................................................. II - 27
2-6-2Bank Setting ............................................................................................ II - 27
2-6-3Bank Memory Space ............................................................................... II - 29
2- 7ROM Correction ....................................................................................................... II - 30
2-7-1Overview ................................................................................................. II - 30
2-7-2Correction Sequence ............................................................................... II - 30
2-7-3ROM Correction Control Register ........................................................... II - 32
2-7-4ROM Correction Setup Example .............................................................. II - 35
2-8Reset ........................................................................................................................ II - 38
2-8-1Reset Operation....................................................................................... II - 38
2-8-2Oscillation Stabilization W ait T ime.......................................................... II - 40
2-9Register Protection................................................................................................... II - 42
2-9-1Overview ................................................................................................. II - 42
2-9-2Setting of the Register Protection Function ............................................ II - 4 2
2-9-3Rewrite Procedure ................................................................................... II - 42
Chapter 3Interrupts
3-1Overview................................................................................................................. III - 2
3-1-1Functions ............................................................................................... III - 3
3-1-2Block Diagram ...................................................................................... III - 4
3-1-3Operation ............................................................................................... III - 5
3-1-4Interrupt Flag Setup............................................................................... III - 14
3-2Control Registers.................................................................................................. III - 15
3-2-1Registers List ....................................................................................... III - 15
3-2-2Interrupt Control Registers.................................................................. III - 16
3-3External Interrupts ................................................................................................... III - 38
3-3-1Overview ................................................................................................ III - 38
3-3-2Block Diagram ........................................................................................ III - 39
3-3-3Control Registers.................................................................................... III - 42
3-3-4Programmable Active Edge Interrupt ..................................................... III - 47
3-3-5Both Edges Interrupt.............................................................................. III - 48
3-3-6Key Input Interrupt ................................................................................ III - 19
3-3-7Noise Filter ............................................................................................. III - 51
iii
contents
Page 10
3-3-8AC Zero-Cross Detector ........................................................................ III - 54
Chapter 4I/O Ports
4-1Overview .................................................................................................................. IV - 2
4-1-1I/O Port Diagram...................................................................................... IV - 2
4-1-2I/O Port Status at Reset ........................................................................... IV - 3
4-1-3Control Registers..................................................................................... IV - 4
4-2Port 0 ........................................................................................................................ IV - 6
4-2-1Description.............................................................................................. IV - 6
4-2-2Registers ................................................................................................. IV - 7
4-2-3Block Diagram ......................................................................................... IV - 8
4-3Port 1 ....................................................................................................................... IV - 12
4-3-1Description............................................................................................. IV - 12
4-3-2Registers ................................................................................................ IV - 13
4-3-3Block Diagram ........................................................................................ IV - 16
4-4Port 2 ....................................................................................................................... IV - 17
4-4-1Description............................................................................................. IV - 17
4-4-2Registers ................................................................................................ IV - 18
4-4-3Block Diagram ........................................................................................ IV - 19
4-5Port 5 ....................................................................................................................... IV - 21
4-5-1Description............................................................................................. IV - 21
4-5-2Registers ................................................................................................ IV - 22
4-5-3Block Diagram ........................................................................................ IV - 23
4-6Port 6 ....................................................................................................................... IV - 26
4-6-1Description............................................................................................. IV - 26
4-6-2Registers ................................................................................................ IV - 27
4-6-3Block Diagram ........................................................................................ IV - 29
4-7Port 7 ....................................................................................................................... IV - 30
4-7-1Description............................................................................................. IV - 30
4-7-2Registers ................................................................................................ IV - 31
4-7-3Block Diagram ........................................................................................ IV - 33
4-8Port 8 ....................................................................................................................... IV - 37
4-8-1Description............................................................................................. IV - 37
4-8-2Registers ................................................................................................ IV - 38
4-8-3Block Diagram ........................................................................................ IV - 40
4-9Port A ...................................................................................................................... IV - 41
4-9-1Description............................................................................................. IV - 41
4-9-2Registers ................................................................................................ IV - 42
4-9-3Block Diagram ........................................................................................ IV - 44
4-10Real Time Output Control (Port 1) ........................................................................... IV - 45
iv
contents
Page 11
4-10-1Registers ................................................................................................ IV - 45
4-10-2Operation................................................................................................ IV - 46
4-11Synchronous Output (Port 7) .................................................................................. IV - 4 8
4-11-1Block Diagram ........................................................................................ IV - 48
4-11-2Registers ................................................................................................ IV - 49
4-11-3Operation................................................................................................ IV - 50
4-11-4Setup Example ........................................................................................ IV - 52
Chapter 5Prescaler
5-1Overview .................................................................................................................... V - 2
5-1-1Peripheral Functions ................................................................................. V - 3
5-1-2Block Diagram ........................................................................................... V - 4
5-2Control Registers........................................................................................................ V - 5
5-2-1Registers List............................................................................................. V - 5
5-2-2Control Registers....................................................................................... V - 6
5-3Operation.................................................................................................................. V - 11
5-3-1Operation................................................................................................. V - 11
5-3-2Setup Example ......................................................................................... V - 12
Chapter 68-bit T imers
6-1Overview................................................................................................................. VI - 2
6-2Control Registers...................................................................................................... VI - 6
6-2-1Registers ................................................................................................. VI - 6
6-2-2Programmable Timer Registers ................................................................ VI - 8
6-2-3Timer Mode Registers ............................................................................ VI - 10
6- 38-bit Timer Count..................................................................................................... VI - 15
6-3-1Operation................................................................................................ VI - 15
6-3-2Setup Example ........................................................................................ VI - 17
6-48-bit Event Count .................................................................................................... VI - 19
6-4-1Operation................................................................................................ VI - 19
6-4-2Setup Example ........................................................................................ VI - 21
6-58-bit Timer Pulse Output ......................................................................................... VI - 23
6-5-1Operation................................................................................................ VI - 23
6-5-2Setup Example ........................................................................................ VI - 24
6-68-bit PWM Output .................................................................................................. VI - 26
6-6-1Operation................................................................................................ VI - 26
6-6-2Setup Example ........................................................................................ VI - 28
6-78-bit Timer Synchronous Output............................................................................. VI - 3 0
v
contents
Page 12
6-7-1Operation................................................................................................ VI - 30
6-7-2Setup Example ........................................................................................ VI - 31
6-8Serial Interface Transfer Clock Output .................................................................... VI - 33
6-8-1Operation................................................................................................ VI - 33
6-8-2Setup Example ........................................................................................ VI - 34
6-9Simple Pulse W idth Measurement........................................................................... VI - 36
6-9-1Operation................................................................................................ VI - 36
6-9-2Setup Example ........................................................................................ VI - 37
6-10Cascade Connection ............................................................................................... VI - 3 9
6-10-1Operation................................................................................................ VI - 39
6-10-2Setup Example ........................................................................................ VI - 41
6-11Remote Control Carrier Output ................................................................................ VI - 43
6-11-1Operation................................................................................................ VI - 43
6-11-2Setup Example ........................................................................................ VI - 44
Chapter 716-bit T imer
7-1Overview................................................................................................................ VII - 2
7-1-1Functions .............................................................................................. VII - 2
7-1-2Block Diagram ..................................................................................... VII - 3
7-2Control Registers................................................................................................... VII - 4
7-2-1Registers ............................................................................................... VII - 4
7-2-2Programmable Timer Registers............................................................ VII - 5
7-2-3Timer Mode Registers.......................................................................... VII - 8
7-316-bit Timer Count .............................................................................................. VII - 10
7-3-1Operation ............................................................................................ VII - 10
7-3-2Setup Example.................................................................................... VII - 13
7-416-bit Event Count .............................................................................................. VII - 15
7-4-1Operation ............................................................................................ VII - 15
7-4-2Setup Example.................................................................................... VII - 17
7-516-bit Timer Pulse Output................................................................................... VII - 19
7-5-1Operation ............................................................................................ VII - 19
7-5-2Setup Example.................................................................................... VII - 21
7-616-bit Standard PWM Output
(Only duty can be changed consecutively) .................................... VII - 23
7-6-1Operation ............................................................................................ VII - 23
7-6-2Setup Example.................................................................................... VII - 25
7-716-bit High Precision PWM Output
(Cycle/Duty can be changed consecutively)...................................... VII - 27
7-7-1Operation ............................................................................................ VII - 27
7-7-2Setup Example.................................................................................... VII - 29
7-816-bit Timer Synchronous Output ...................................................................... VII - 31
vi
contents
Page 13
7-8-1Operation ............................................................................................ VII - 31
7-8-2Setup Example.................................................................................... VII - 32
7-916-bit Timer Capture ........................................................................................... VII - 34
7-9-1Operation ............................................................................................ VII - 34
7-9-2Setup Example.................................................................................... VII - 37
Chapter 8Time Base Timer / 8-bit Free-running Timer
8-1Overview ................................................................................................................ VIII - 2
8-1-1Functions .............................................................................................. VIII - 2
8-1-2Block Diagram ....................................................................................... VIII - 3
8-2Control Registers.................................................................................................... VIII - 4
8-2-1Control Registers................................................................................... VIII - 4
8-2-2Programmable Timer Registers .............................................................. VIII - 5
8-2-3Timer Mode Registers ........................................................................... VIII - 6
8- 38-bit Free-running Timer......................................................................................... VIII - 7
8-3-1Operation............................................................................................... VIII - 7
8-3-2Setup Example ..................................................................................... VIII - 10
8- 4Time Base Timer ................................................................................................... VIII - 12
8-4-1Operation............................................................................................. VIII - 12
8-4-2Setup Example ..................................................................................... VIII - 14
Chapter 9Watchdog Timer
9-1Overview................................................................................................................. IX - 2
9-1-1Block Diagram ...................................................................................... IX - 2
9-2Control Registers.................................................................................................... IX - 3
9-3Operation ................................................................................................................ IX - 4
9-3-1Operation ............................................................................................... IX - 4
9-3-2Setup Example....................................................................................... IX - 7
Chapter 10Buzzer
10-1Overview ................................................................................................................... X - 2
10-1-1Block Diagram .......................................................................................... X - 2
10-2Control Register ........................................................................................................ X - 3
10-3Operation................................................................................................................... X - 4
10-3-1Operation.................................................................................................. X - 4
10-3-2Setup Example .......................................................................................... X - 5
Chapter 11Serial Interface 0,1
vii
contents
Page 14
11-1Overview .................................................................................................................. XI - 2
11-1-1Functions ................................................................................................ XI - 2
11-1-2Block Diagram ......................................................................................... XI - 4
11-2Control Registers...................................................................................................... XI - 6
11-2-1Registers ................................................................................................. XI - 6
11-2-2Serial Interface 0 Data Buffer Registers ................................................... XI - 7
11-2-3Serial Interface 0 Mode Registers............................................................ XI - 8
11-2-4Serial Interface 1 Data Buffer Registers ................................................. XI - 14
11-2-5Serial Interface 1 Mode Registers.......................................................... XI - 15
11-3Operation................................................................................................................ XI - 21
11-3-1Clock Synchronous Serial Interface ...................................................... XI - 21
11-3-2Serial interface 0 Synchronous Serial Interface Pin Setup ..................... XI - 33
11-3-3Serial interface 1 Synchronous Serial Interface Pin Setup ..................... XI - 36
11-3-4Setup Example ....................................................................................... XI - 39
11-3-5UART Serial Interface............................................................................ XI - 4 2
11-3-6Serial interface 0 UART Serial Interface Pin Setup ................................ XI - 5 4
11-3-7Serial interface 1 UART Serial Interface Pin Setup ................................ XI - 5 6
11-3-8Setup Example ....................................................................................... XI - 58
Chapter 12Serial Interface 3
12-1 Overview............................................................................................................... XII - 2
12-1-1Functions ............................................................................................. XII - 2
12-1-2Block Diagram .................................................................................... XII - 3
12-2 Control Registers .................................................................................................. XII - 4
12-2-1Registers .............................................................................................. XII - 4
12-2-2Data Buffer Registers .......................................................................... XII - 5
12-2-3Mode Registers ...................................................................................... XII - 6
12-3Operation............................................................................................................... XII - 10
12-3-1Clock Synchronous Serial Interface ..................................................... XII - 10
12-3-2Setup Example ...................................................................................... XII - 24
12-3-3Single Master IIC Interface................................................................... XII - 27
12-3-4Setup Example ...................................................................................... XII - 36
Chapter 13Serial Interface 4
13-1Overview ................................................................................................................ XIII - 2
13-1-1Functions .............................................................................................. XIII - 2
viii
contents
Page 15
13-1-2Block Diagram ....................................................................................... XIII - 3
13-2Control Registers.................................................................................................... XIII - 4
13-2-1Registers List......................................................................................... XIII - 4
13-2-2Data Register......................................................................................... XIII - 5
13-2-3Mode Registers ..................................................................................... XIII - 6
13-3Operation................................................................................................................ XIII - 9
13-3-1Setup Example of the Slave IIC Serial Interface ................................... XIII - 11
Chapter 14Automatic Transfer Controller
14-1Overview ................................................................................................................ XIV - 2
14-1-1A TC1 ..................................................................................................... XIV - 2
14-1-2Functions .............................................................................................. XIV - 3
14-1-3Block Diagram ....................................................................................... XIV - 4
14-2Control Registers.................................................................................................... XIV - 5
14-2-1Registers ............................................................................................... XIV - 5
14-3Operation................................................................................................................ XIV - 9
14-3-1Basic Operations and Timing ................................................................ XIV - 9
14-3-2Setting the Memory Address .............................................................. XIV - 11
14-3-3Setting the Data Transfer Count ......................................................... XIV - 12
14-3-4Setting the Data Transfer Modes ........................................................ XIV - 13
14-3-5Transfer Mode 0.................................................................................. XIV - 14
14-3-6Transfer Mode 1.................................................................................. XIV - 15
14-3-7Transfer Mode 2.................................................................................. XIV - 16
14-3-8Transfer Mode 3.................................................................................. XIV - 17
14-3-9Transfer Mode 4.................................................................................. XIV - 18
14-3-10Transfer Mode 5.................................................................................. XIV - 19
14-3-11Transfer Mode 6.................................................................................. XIV - 20
14-3-12Transfer Mode 7.................................................................................. XIV - 22
14-3-13Transfer Mode 8.................................................................................. XIV - 24
14-3-14Transfer Mode 9.................................................................................. XIV - 26
14-3-15Transfer Mode A................................................................................. XIV - 28
14-3-16Transfer Mode B ................................................................................. XIV - 29
14-3-17Transfer Mode C ................................................................................. XIV - 30
14-3-18Transfer Mode D ................................................................................. XIV - 31
14-3-19Transfer Mode E ................................................................................. XIV - 32
14-3-20Transfer Mode F ................................................................................. XIV - 33
14-4Setup Example ...................................................................................................... XIV - 34
Chapter 15A/D Converter
15-1Overview ................................................................................................................. XV - 2
15-1-1Functions ............................................................................................... XV - 2
ix
contents
Page 16
15-1-2Block Diagram ........................................................................................ XV - 3
15-2Control Registers..................................................................................................... XV - 4
15-2-1Registers ................................................................................................ XV - 4
15-2-2Control Registers.................................................................................... XV - 5
15-2-3Data Buffers ........................................................................................... XV - 7
15-3Operation................................................................................................................. XV - 8
15-3-1Setup .................................................................................................... XV - 1 0
15-3-2Setup Example ...................................................................................... XV - 12
15-3-3Cautions ............................................................................................... XV - 16
Chapter 16D/A Converter
16-1Overview ................................................................................................................ XVI - 2
16-1-1Functions .............................................................................................. XVI - 2
16-2Operation................................................................................................................ XVI - 3
16-3Control Registers.................................................................................................... XVI - 4
16-3-1Overview ............................................................................................... XVI - 4
16-3-2Control Registers................................................................................... XVI - 5
16-3-3Input Data Register ............................................................................... XVI - 6
16-4Setup Example ........................................................................................................ XVI - 7
Chapter 17Appendices
17-1Probe Switches ..................................................................................................... XVII - 2
17-1-1PRB-MBB101C77-M.............................................................................. XVII - 2
17-1-2PX-CN101-M ......................................................................................... XVII - 3
17-1-3PX-ADP101-64-M.................................................................................. XVII - 4
17-1-4PRB-DMY101C77-M ............................................................................. XVII - 5
17-2Special Function Registers List ............................................................................ XVII - 6
17-3
Instruction Set..................................................................................................... XVII - 15
17-4
Instruction Map .................................................................................................. XVII - 21
Chapter 18Flash EEPROM
18-1Overview ............................................................................................................. XVIII - 2
18-1-1Overview .............................................................................................. XVIII - 2
18-1-2Differences between Mask ROM version and EPROM version........... XVIII - 4
18-2Pin Descriptions .................................................................................................. XVIII - 5
18-3Electrical Characteristics ..................................................................................... XVIII - 6
18-3-1Absolute Maximum Ratings ................................................................. XVIII - 6
18-3-2Operating Conditions ........................................................................... XVIII - 7
18-3-3DC Characteristics ................................................................................ XVIII - 8
x
contents
Page 17
18-4Reprogramming Flow........................................................................................... XVIII - 9
18-5PROM writer mode ............................................................................................ XV III - 10
18-6Onboard Serial Programming Mode .................................................................. XVII I - 1 2
18-6-1Overview ............................................................................................ XVIII - 12
18-6-2Circuit Requirements for the T arget Board (in Clock Synchronous
Communication using the YDC Serial Writer)..................................... XVIII - 13
18-6-3Circuit Requirements for the T arget Board (in Clock Synchronous
Communication using the PanaX Serial Writer).................................. XVIII - 16
xi
contents
Page 18
Page 19
Chapter 1Overview
1
Page 20
Chapter 1 Overview
1-1Overview
1-1-1Overview
The MN101C series of 8-bit single-chip microcontroller incorporates multiple types of peripheral functions.
This chip series is well suited for camera, VCR, MD, TV, CD, LD, printer, telephone, home automation
products, pager, air conditioner, PPC remote control, fax machine, musical instrument, and other applications.
The MN101C77 series brings to embedded microcontroller applications flexible, optimized hardware
configurations and a simple efficient instruction set. The MN101C77C has an internal 48 KB of ROM and
3 KB of RAM. Peripheral functions include 5 external interrupts, 17 internal interrupts including NMI,
independent 6 timer counters, 4 sets of serial interfaces, A/D converter, D/A converter, watchdog timer,
automatic data transfer, synchronous output, buzzer output, and remote control output. The configuration of this microcontroller is well suited for application such as a system controller in a camera, VCR
selection timer, CD player, or MD.
With two oscillation systems (max.20 MHz/32 kHz) contained on the chip, the system clock can be
switched to high speed oscillation (NORMAL mode), or to low speed oscillation (SLOW mode). The
system clock is generated by dividing the oscillation clock. The best operation clock for the system can
be selected by switching its frequency by software. There are 2 choices for high speed oscillation : the
normal mode, which has a system clock based on the clock (fosc/2) divided by 2, and the 2x-speed
mode, which has a system clock based on the same cycle clock (fosc).
On the normal mode, when the oscillation source(fosc) is 8 MHz, minimum instructions executiontime is for 250 ns, and when fosc is 20 MHz, it is 100 ns. On the 2x-speed mode, CPU is operated with
the same cycle to the external clock, when fosc is 8 MHz, minimum instructions execution time is 125 ns.
The packages are 64-pin LQFP and 64-pin TQFP (under development).
1-1-2Product Summary
This manual describes the following models of the MN101C77 series. These products have same peripheral functions. (Refer to chapter 18 Flash EEPROM for Flash version.)
Table 1-1-1 Product Summary
Model ROM Size RAM SizeClassification
MN101C77C 48 KB 3 KB Mask ROM version
MN101CF77G 128 KB 6 KB Flash EEPROM version
I - 2
Overview
Page 21
1-2Hardware Functions
CPU CoreMN101C Core
- LOAD-STORE architecture (3-stage pipeline)
- Half-byte instruction set / Handy addressing
- Memory addressing space is 256 KB
- Minimum instructions execution time (3.0 V to 3.6 V for Flash version)
High speed oscillation
[normal]0.10 µs/ 20 MHz (2.5 V to 3.6 V)
0.50 µs/ 4 MHz (1.8 V to 3.6 V)
[2x-speed] 0.119 µs/ 8.39 MHz (2.5 V to 3.6 V)
Low speed oscillation61.04 µs/ 32.768 kHz (1.8 V to 3.6 V)
- Operation modes
NORMAL mode ( High speed oscillation )
SLOW mode ( Low speed oscillation )
HALT mode
STOP mode
(The operation clock can be switched in each mode.)
Chapter 1 Overview
0.20 µs/ 10 MHz (2.1 V to 3.6 V)
Memory bankData memory space expansion by bank form (4 banks unit : 64 KB / 1 bank)
- Bank for source address / Bank for destination address
ROM correction Max.3 parts in program can be corrected
Internal memory ROM 48 KB (Flash version 128 KB)
RAM 3 KB (Flash version 6 KB)
Interrupts17 Internal interrupts
<Non-maskable interrupt (NMI)>
- Incorrect code execution interrupt and Watchdog timer interrupt
< Timer interrupts >
- Timer 0 interrupt (8-bit timer)
- Timer 1 interrupt (8-bit timer)
- Timer 4 interrupt (8-bit timer)
- Timer 5 interrupt (8-bit timer)
- Timer 6 interrupt (8-bit timer)
- Time base interrupt (8-bit timer)
- Timer 7 interrupt (16-bit timer)
- Match interrupt for Timer 7 compare register 2
Hardware Functions
I - 3
Page 22
Chapter 1 Overview
< Serial interface interrupts >
- Serial interface 0 reception interrupt (Full-Duplex UART)
- Serial interface 0 transmission interrupt (synchronous + Full-Duplex UART)
- Serial interface 1 reception interrupt (Full-Duplex UART)
- Serial interface 1 transmission interrupt (synchronous + Full-Duplex UART)
- Serial interface 3 interrupt (synchronous + single master IIC)
- Clock source
fosc, fosc/2, fosc/4, fosc/16, fs, fs/2, fs/4, fs/16,
1/1, 1/2, 1/4, 1/16 of the external clock
- Hardware organization
Compare register with double buffer2 sets
Input capture register1 set
Timer interrupt2 vectors
- Timer functions
Square wave output ( Timer pulse output ), Event count,
High precision PWM output ( Cycle/Duty variable continuously ),
Timer synchronous output, Input capture function ( Both edges
can be operated )
- Real time output control
PWM output is controlled in real time by the external interrupt 0 (IRQ0).
At the interrupt enable edge of the external interrupt 0 (IRQ0), PWM output
( Timer output ) is controlled in 3 values ; "fixed high", "fixed low",
"Hi-z".
Hardware Functions
I - 5
Page 24
Chapter 1 Overview
Watchdog timer
- Watchdog timer frequency can be selected from fs/216, fs/2
18
or fs/220.
Remote control output
Based on the timer 0, and timer 3 output, a remote control carrier with duty
cycle of 1/2 or 1/3 can be output.
- Transfer size 7 to 8 bits can be selected.
[Note : When Matsushita standard serial writer is used for flash memory
version, serial interface 0 is used for program transfer.]
I - 6
Hardware Functions
Page 25
Chapter 1 Overview
Serial interface 1 ( Full-Duplex UART / Synchronous serial interface )
- MSB/LSB can be selected as the first bit to be transferred. Any
transfer size 1 to 8 bits can be selected.
- Sequence transmission, sequence reception or both are available.
Single master IIC
- IIC communication for single master ( 9-bit transfer )
Serial interface 4 ( Slave IIC )
IIC slave serial interface
- IIC high-speed transfer mode (400 kbps) is available.
- 7 bits or 10 bits slave address setting is available.
- Compatible with general call communication mode
LED driver8 pins
PortI/O ports 53 pins
- LED ( large current ) driver pin 8 pins
- Serves as external interrupt 5 pins
Special pins 10 pins
- Analog reference voltage input pin 2 pins
- Operation mode input pin 1 pin
- Reset input pin 1 pin
- Power pin 2 pins
- Oscillation pin 4 pins
Package64-pin LQFP ( 14 mm square / 0.8 mm pitch )
64-pin TQFP ( 10 mm square / 0.5 mm pitch )
Hardware Functions
I - 7
Page 26
Chapter 1 Overview
On Flash version MN101CF77G, NC pin cannot be used as user pin as it is used as VPP pin.
Refer to chapter 18 Flash EEPROM when designing your board for compatibility with Flash
version.
Set VREF+ to VDD, VREF- to VSS even when A/D converter is not used.
Connect these oscillation pins to cer amic or
crystal oscillat ors for high-frequency c loc k
operation.
If the clock is an external input, connect it to OSC1
and leave OSC2 open. T he chip will not oper at e
with an external c lock when using either the
STOP or SLOW modes.
NRST14I/OReset pin P27This pin resets the chip when power is turned on,
P0015I/OI/O port 0SBO1A, TXD1A
P0116SBI1A, RXD1 A
SDA4B
P0217SBT1A , SCL4B
P0318SBO0A , T XD0A
P0419SBI0A, RXD0 A
P0520SBT0A
P0621 BUZZER
P1022I/OI/O port 1TCO0A, RMOUTA
P1123TCIO0B, RMOUTB
P1224TCO4A
P1325TCIO4B
P1426TCI07
Connect these oscillation pins to cer amic
oscillators or crystal oscillators for low-fr equency
clock operation.
If the clock is an external input, connect it to XI
and leave XO open. The c h ip will not operate with
an ex ternal clock when using the STOP mode. If
these pins are not used, connect XI to VSS and
leav e XO open.
is allocated as P27 and contains an internal pullup resistor. S etting this pin low initializes the
internal state of the device. Thereafter, setting the
input to high r eleases the reset. The hardware
waits for t he sy stem clock to stabilize, then
processes the reset int errupt. Also, if ""0" " is
written to P27 and the reset is initiated by
softwar e, a low level will be out put. The output
has an n-channel open-drain configur ation. I f a
capacitor is to be inserted between NRST and
VDD, it is recommended that a discharge diode
be placed between NRST and VDD.
7-Bit CMOS tri-state I/O port.
Eac h bi t can b e set in di vi dual l y as either an in put
or output by the P0DIR register. A pull-up resistor
for eac h bit c an be selected individually by the
P0PLU register.
At reset, the input mode is selected and pull-up
resistors are disabled (high impedance output) .
5-Bit CMOS tri-state I/O port.
Eac h bi t can b e set in di vi dual l y as either an in put
or output by the P1DIR register. A pull-up resistor
for eac h bit c an be selected individually by the
P1PLU register.
At reset, the input mode is selected and pull-up
resistors are disabled (high impedance output) .
Pin Description
I - 11
Page 30
Chapter 1 Overview
Table 1-3-4 Pin Function Summary (2/6)
NameNo.I/OF unctio nOther FunctionDescription
P2027I/OI/O port 2 IRQ0
P2128IRQ1, ACZ
P2229IRQ2
P2330IRQ3
P2431IRQ4
P2714InputI /O port 2 NRSTP27 has an n-channel open-drain configurati on.
P5032I/OI/O port 5 SBI3
P5133SBO3,
P5234SBT3
P5335SDA4A
5-Bit CMOS tri-state I/O port.
A pull-up resistor for each bi t can be select e d
individually by the P2PLU register .
At reset, pull-up r esistor s are d isabled
(high impedance output ) .
When "0" is written and the reset is initiated by
softwar e, a low level will be out put.
5-Bit CMOS tri-state I/O port.
Each bit can be set individually as either an input
or output by the P5 DIR register . A pul l-up resistor
for eac h bit c an be selected individually by the
P5PLU register. At reset, the P50t o P54 input
mode is selected and pull- up resistors are
disabled. (high impedance output)
8-Bit CMOS tri-state I/O port.
Each bit can be set individually as either an input
or output by the P6 DIR register . A pul l-up resistor
for eac h bit c an be selected individually by the
P6PLU register.
At reset, the P60 to P67 input mode is selected
and pull- up resistors are disabled.
(high impedance output )
8-Bit CMOS tri-state I/O port.
Each bit can be set individually as either an input
or output by the P7 DIR register . A pul l-up/pulldown resistor for each bit can be selected
individually by the P7PLU r e gist e r . Howev er,
pull-up and pull-down resistors cannot be mixed.
At reset, the P70to P77 input mode is selected
and pull- up resistors are disabled. (high
impedance output )
8-Bit CMOS tri-state I/O port. Each bit can be set
individu al ly as either an input or output by the
P8DIR register. A pull-up resistor for each bit c an
be selected individually by the P8PLU register.
When c o nfigured as out puts, these pins can
drive LEDs directly. A t reset, the P80to P 87 input
mode is selected and pull- up resistors are
disabled. (high impedance output)
6-Bit I/O port. A pull-up or pull-down resistor for
each bi t can be selected individually by the
PAPLUD resister. However, pull-up and pulldown resistors cannot be mixed. At reset, the
PA0 to PA 6 input mode is selected and pull- up
resistor s are di sabled. (high impedance ou tput)
Transmission data output pins for serial
interfaces 0 , 1, 3. The output configuration,
eit her CMOS push-pull or n-channel op en-drain
can be selected. Pull-up r esistors can be
selected by the P0PLU register, the P5PLU
register and the P7PLUD r egister. S elec t output
mode by the P0DI R register , the P5DI R register
and the P7DI R r egister, and serial data output
mode by serial mode register 1 ( S C0MD1,
SC1M D1, SC3MD1). These can be used as
normal I/O pins when the serial interfac e is not
used .
Reception data input pins for serial inter faces 0,
1, 3. Pll-up resistors can be selected by the
P0PLU register, the P5PLU register and the
P7PLUD register. Select input mode by the
P0DIR register, the P5DI R r egister, the P7DIR
register and serial input mode by the serial mode
regist er 1 ( S C0MD1, S C1 MD1, S C 3MD1). These
can be u sed as normal I /O pins when t he seri al
interface is not used.
Clock I /O pins for serial interf ac es 0, 1, 3. The
output configuration, either CMOS push-pull or nchannel op en - drain can be selected. Pull - up
resist o rs ca n be selected by the P0P LU re sister
and the P5PLU register and t he P 7PLUD
register. Select clock I/O for each communication
mode by the P0DI R register , the P5DI R register ,
the P7DIR register and serial mode register 1
( SC0MD1, SC1M D1, S C3MD1). T hese can be
used as normal I/O pins when the serial interf ace
is not used.
In the serial interface in UART mode, these pins
are configured as the transmission data output
pins. The output configurati on, either CMOS
push-pull or n-channel open -drain can be
selected. Pull-up resistors can be selected by
the P0PLU r egister and t he P 7PLUD register.
Select out put mode by the P0DIR register and the
P7DIR register, and serial data output by serial
interface 1 mode register 1 ( SC0MD1, SC1MD1).
These can be used as normal I/O pins when the
serial interfac e i s not used.
Pin Description
I - 13
Page 32
Chapter 1 Overview
Table 1-3-6 Pin Function Summary (4/6)
NameNo.I/OFunctionOther FunctionDescription
RX D0A 19InputS B I 0A, P04
RXD0B49SBI0B, P71
RXD1A16SBI1A, P01
RXD1B46SBI1B, P74
UART reception
data input pin
SDA4A
In t he serial interfac e in UART mode, these pins
are configured as the received data input pin.
Pull-up resistors can be selected by the P0PLU
register and P7PLUD register. Set this pin to the
input mode by t he P0DI R r egister and the P 7DI R
register, and to the serial input mode by the serial
interf ace1 mode register 1 ( SC0MD1, SC1MD1).
This can be used as normal I/O pin when t he
serial interface is not used.
P10,T CO0AOut put pin for remote cont r ol t r ansmission signal
Event counter clock input pins, overflow pulse
and PWM signal output pins for 8-bit timers 0 , 1,
4, 5. To use these pins as ev ent clock inputs,
configure t hem as inputs by t he P 1DI R and
P7DIR register. When the pins are used as
inputs, pull-up resistors can be specified by the
P1PLU, P 7P LUD register. F or overflow pulse,
PWM signal output, select the special function pin
by the port 1 out put mode register (P1OMD) and
set to the out put mode by the P1DIR register.
When not used for timer I/O, these can be used
as normal I/O pins.
Reception data input pins for serial interfac es 4.
During data communications, select n-channel
open-drain to comply wit h IIC communication
standard. Pull-up resistors can be selected by
the P0PLU r egister and the P 5PLU r egister.
During data communications, select output mode
by the P0DIR register and the P5DIR register.
These can be used as normal I/O pins when the
serial interface is not used.
Clock I/O pins for serial interfaces 4. During data
communications, select n- channel open-drain to
comply with IIC communication standard. Pull-up
resistors can be selected by the P0PLU resister
and the P5PLU register. During dat a
communications, select out put mode by the
P0DIR register and the P5DIR register. These
can be used as normal I/O pins when the serial
interf ac e is not used.
with a carrier signal. For remote cont r ol c arrier
output, select the special function pin by the port
1 output mode register (P1O MD) and set to the
output mode by the P1DIR register. Also, set to
the remote control carrier output by the remote
control c arr ier output cont rol r egister (RMCTR).
This can be used as a normal I/O pin when
remote control is not used.
I - 14
Pin Description
Page 33
Chapter 1 Overview
Table 1-3-7 Pin Function Summary (5/6)
NameNo.I/OFunctionOther FunctionDescription
BUZZER 21OutputBuzzer out putP06Piezoelectric buzzer dr iver pin. The driving
frequency can be selected by the DLYCT R
register. Select output mode by the P0DIR
register and select P 06 buzzer out put by the
DLY CTR register. W hen not used for buzzer
output, this pin can be used as a normal I/O pin.
TCI 0726I/OTimer I/ O pinP14Event counter cloc k input pin, overflow pulse and
PWM signal output pin for 16-bit timer 7. T o use
this pin as event cloc k input , configure this as
input by the P1DIR register. In the input mode,
pull-up resistors can be selected by the P1PLU
register. F or overflow pulse, PWM signal output,
select the special function pin by the port 1 output
mode register (P1O MD), and set to t he output
mode by the P1DIR register. W hen not used for
timer I/O, this can be used as normal I/O pin.
P21, IRQ1An input pin for an AC zero-cross detection circuit.
Reference power supply pins for the A /D
converter. Normally, the values of VDD=VREF+
and VSS=VREF - ar e used. W h en t he y are not
used, the v alues should be VRE F+=VDD and
VREF-=VSS.
Analog input pins for an 7-channel, 10-bit A/D
conv er ter. When not used for analog input, these
pins can be used as normal I/O pins.
Analog output pins for an 2-channel, 8-bit D/A
conv er ter. When not used for analog output,
these pins can be u sed as normal I/O pins.
External interrupt input pins. T he valid edge for
IRQ0 to 4 can be selected with the IRQnICR
register. IRQ1 is an external interrupt pin that is
able to deternine AC zero c rossings. Both edge
for IRQ0 to 4 are valid for interrupt. When these
are not used for inter rupt s, t hese can be used as
normal input pins.
The AC zero-c r oss detection circuit outputs a high
level when the input is at an intermediate level. It
outputs a low level at all ot her t imes. A CZ input
signal is connected to the P 21 input c irc uit and
the IQR1 interrupt circuit. When the AC zero-cross
detect ion circ uit is not used, this pin can be used
as a normal P21 input.
Input pins for interrupt based on ORed result of
pin inputs. K ey input pin for 2 bits can be
selected individually by the key interrupt control
register (P6M D). W hen not used for KEY input,
these pins can be used as normal I/O pins.
This pin sets the memory expansion mode.
AIways set the input low.
This LSI user's manual describes the standard specification.
System clock ( fs ) is 1/2 of high speed oscillation at NORMAL mode, or 1/4 of low speed oscillation at SLOW mode.
Please ask our sales offices for its own product specifications.
Contents
Model
Structure
Application
Function
MN101C77
CMOS integrated circuit
General purpose
8-Bit single-chip microcontroller
1-5-1Absolute Maximum Ratings
Parameter
1
2 Input clamp volt age
Input pin voltage
3
Output pin volta ge
4
I/O pin voltage
5
6
Peak ou tput
7
current
Port 8 *4
Other than Port 8
8
9
Aver ag e ou tput
10
current *1
Port 8 *4
Other than Port 8
11
Symbo l
V
DD
Ic-500 to +500
V
I
V
O
V
IO
I
(peak)
OL1
(peak)
I
OL2
I
(peak)
OH
(avg)
I
OL1
I
(avg)
OL2
(avg)-5
I
OH
*2,*3
(voltages referenced to Vss)
- 0.3 to +4.6
-0.3 to V
-0.3 to V
-0.3 to V
DD
DD
DD
+0.3
+0.3
+0.3
30
10
-10
20
5
UnitRating
µ
mA
VPower supply voltage
A
V
I - 18
Power dissipation300
12
Operating ambient t emperature
13
Stor age t emperatur e
14
P
D
T
opr
T
stg
-40 to +85
-40 to +125 *5
*1Applied to any 100 ms period.
*2Connect at least one bypass capacitor of 0.1 µF or larger between the power
supply pin and the ground for latch-up prevention.
*3The absolute maximum ratings are the limit values beyond which the LSI may
be damaged and proper operation is not assured.
*4Applied when P8LED register outputs LED.
*5-40 to + 98 (°C) for the Flash EEPROM version.
Externa l c l oc k in put 1 OSC1 (OS C 2 is opened)
Clock frequencyf
18
High level pulse width
19
osc
t
wh1
20.0
*1 Figure 1-5-3
Low level pulse width
20
Rising time
21
t
wl1
t
wr1
20.0
Figure 1-5-3
Falling time
22
t
wf1
Externa l c l oc k in put 2 XI (XO is opened)
Clock frequency
23
High level pulse width
24
f
x
t
wh2
*1 Figure 1-5-4
Low level pulse width
253.5
Rising time
26
t
wl2
t
wr2
Figure 1-5-4
Falling timet
27
wf2
Rating
MINTYPMAX
1.020.0
5.0
5.0
32.768
3.5
20
20
MHz
ns
kHz
µ
ns
s
*1The clock duty rate should be 45% to 55%.
Certain operating conditions differ between the mask ROM version and the Flash version.
Refer to chapter 18 Flash EEPROM for electrical characteristics of the Flash version.
I - 20
Electrical Characteristics
Page 39
twh1twl1
Chapter 1 Overview
0.9VDD
0.1VDD
twr1
twc1
Figure 1-5-3 OSC1 Timing Chart
twh2twl2
twf1
0.9VDD
0.1VDD
twr2
twf2
twc2
Figure 1-5-4 XI Timing Chart
Electrical Characteristics
I - 21
Page 40
Chapter 1 Overview
V
1-5-3DC Characteristics
Ta=-40 oC to +85 oC
=1.8 V to 3.6 V VSS=0
V
DD
ParameterSymbolConditionsUnit
Power supply curr ent (not load at output pin) *1
f
=20. 00 MHz,VDD=3.3 V
1
2
I
I
Power supply current
3
4
I
I
5I
Supply curren t dur ing
HALT1 mode
6I
7I
Supply curren t dur ing
STOP mode
8I
osc
DD1
[fs = f
/2]
osc
=8.39 MHz,VDD=3.3 V
f
osc
DD2
[f
= f
/2]
s
osc
fx=32.768 kHz ,VDD=3.3 V
DD3
DD4
DD5
DD6
DD7
DD8
= fx/2] Ta=25 oC
[f
s
f
=32.768 kHz ,VDD=3.3 V
x
= fx/2] Ta=-40 oC to +85 oC
[f
s
f
=32.768 kHz ,VDD=3.3 V
x
o
Ta=25
fx=32.768 kHz ,VDD=3.3 V
Ta=-40 oC to +85 oC
VDD=3.3 V
o
Ta=25
VDD=3.3 V
Ta=-40
C
C
o
C to +85 oC
Rating
MINTYPMAX
126
36
1020
40
510
40
02
30
mA
A
µ
*1Measured under conditions of Ta=25 °C, without load.
- The supply current during operation, IDD1(IDD2), is measured under the following conditions:
After all I/O pins are set to input mode and the oscillation is set to <NORMAL mode>, the
MMOD pin is connected to VSS level, the input pins are connected to VDD level, and a 20 MHz
(8.39 MHz) square wave of VDD and VSS amplitude is input to the OSC1 pin.
- The supply current during operation, IDD3(IDD4), is measured under the following conditions:
After all I/O pins are set to input mode and the oscillation is set to <SLOW mode>, the MMOD pin
is connected to VSS level, the input pins are connected to VDD level, and a 32.768 kHz square wave
of VDD and VSS amplitude is input to the XI pin.
- The supply current during HALT mode, IDD5(IDD6), is measured under the following conditions:
After all I/O pins are set to input mode and the oscillation is set to <HALT mode>, the MMOD pin
is connected to VSS level, the input pins are connected to VDD level and an 32.768 kHz square wave
of VDD and VSS amplitude is input to the XI pin.
- The supply current during STOP mode, IDD7(IDD8), is measured under the following conditions:
After the oscillation is set to <STOP mode>, the MMOD pin is connected to VSS level, the input pins
are connected to VDD level, and the OSC1 and XI pins are unconnected.
I - 22
Electrical Characteristics
Page 41
Chapter 1 Overview
ParameterSymbolConditionsUnit
Input pin 1 MMOD
Input high voltage
9
Input low voltage
10
Input leak age cur r ent
11
Input pin 2 P21 (at used as ACZ)
Input high voltage 1V
12
Input low voltage 1
13
Input high voltage 2
14
Input low voltage 2
15
Input leak age cur r ent
16
Rising timet
17
V
V
18
V
V
V
IH1
IL1
I
LK1
DHH
DLH
DHL
DLL
I
LK2
IN
V
DD
Figure 1-5-5
VIN=0 V to V
rs
Figure 1-5-5
fs
=0 V to V
=3.3 V
DD
DD
Ta = -40 oC to +85 oC
MINTYPMAX
0.8V
DD
0
2.9V
V
SS
1.1
V
SS
30
30Falling t imet
VDD=1.8 V to 3.6 V VSS=0 V
Rating
V
DD
0.2V
DD
10
±
DD
2.1
V
DD
0.4
10
±
V
AV
µ
V
A
µ
s
µ
Input voltage level 1
Input voltage level 2
( Input )
( Output )
trs
t
fs
Figure 1-5-5 AC Zero-Cross Detector
DD
V
V
DHH
V
DLH
V
DHL
V
DLL
V
SS
Electrical Characteristics
I - 23
Page 42
Chapter 1 Overview
Ta=-40 oC t o +85 oC
=1.8 V to 3.6 V VSS=0 V
V
DD
Param eterSym bolConditionsUnit
I nput pin 3 P27 (NRST)
I nput high volt age
19
Input low voltageV
20
I nput high currentI
21
V
IH3
IL3
VDD=3.3 V,V
IH3
Pull-up resistor is built-in
IN=VSS
I/O pin 4 PA0 to PA6
I nput high volt age
22
Input low voltageV
23
I nput leakage currentVIN=0 V to V
24
I nput high currentI
25
Input low currentI
26
Output high voltage
27
Output l ow voltage
28
V
IH4
IL4
LK4
V
=3.3 V,VIN=V
IH4
V
OH4
V
DD
Pull -up resistor is ON
VDD=3.3 V,VIN=V
IL4
Pull-down resistor is ON
V
=3.3 V, IOH=-2.0 mA
DD
=3.3 V, IOL=2.0 mA
V
DD
OL4
DD
SS
DD
I/O pin 5 P00 to P06, P10 to P14, P20 to P24, P50 to P54, P60 to P67
Rating
MINTYPMAX
0.8V
DD
0
0.2V
-30-100-300
0.8V
DD
0
-30
30
0.2V
-100
100
2.7
(Schmitt trigger input)
V
DD
V
DD
2I
±
-300
300
0.4
DD
DD
V
A
µ
V
A
µ
V
I nput high volt ageV
29
IH5
0.8V
DD
V
DD
V
Input low voltage
30
I nput leakage current
31
I nput high current
32
Output high voltageV
33
V
IL5
VIN=0 V to V
I
LK5
VDD=3.3 V,VIN=V
I
IH5
Pull -up resistor is ON
V
=3.3 V, IOH=-2.0 mA
OH5
DD
DD
0
SS
-30
2.7
0.2V
10
±
-100-300
DD
A
µ
V
Output l ow voltageV
34
OL5VDD
=3.3 V, IOL=2.0 mA
0.4
I/O pin 6 P70 to P77 (Schmitt trigger input)
I nput high volt ageV
35
IH6
0.8V
DD
V
DD
V
Input low voltage
36
I nput leakage currentI
37
I nput high currentI
38
Input low currentI
39
Output high voltageV
40
V
IL6
=0 V to V
V
LK6
IH6
OH6VDD
IN
=3.3 V,VIN=V
V
DD
Pull -up resistor is ON
VDD=3.3 V,VIN=V
IL6
Pull-down resistor is ON
=3.3 V, IOH=-2.0 mA2.7
DD
SS
DD
0
-30
30
0.2V
10
±
-100-300
100300
DD
A
µ
V
41
OL6VDD
=3.3 V, IOL=2.0 mA
0.4Output l ow voltageV
I - 24
Electrical Characteristics
Page 43
Chapter 1 Overview
I/O pin 7 P80 to P87
Inpu t high v oltageV
42
Inpu t low voltageV
43
Inpu t leakage curr e ntI
44
Inpu t high curren tI
45
Output high voltageV
46
Output low v o lt a geV
47
Output low voltage (LE D)
48
IH7
IL7
LK7
IH7
OH7VDD
OL7VDD
V
OLL7VDD
Ta=-40
VIN=0 V to V
VDD=3.3 V,VIN=V
o
C to +85 oC
DD
SS
Pull-up r esistor is ON
=3.3 V, IOH=-2.0 mA
=3.3 V, IOL=2.0 mA
=3.3 V, I
=15.0 mA1.0
OLL
VDD=1.8 V to 3.6 V VSS=0 V
Rating
MINTYPMAX
0.8V
0
DD
V
0.2V
10
±
DD
DD
-30V-100-300
2.7
0.4
UnitParam eterSym bolConditions
V
A
µ
Electrical Characteristics
I - 25
Page 44
Chapter 1 Overview
1-5-4A/D Converter Characteristics *2
Ta=-40 oC to +85 oC
= 3.3 V VSS=0 V
V
DD
Param eterSymbolConditions
Resolution
1
Non-linearity error 1
2
Dif ferential non-linearity
3
error 1
Non-linerarit y error
4
Dif ferential non-linearity
5
error 2
Zero transition voltage
6
Ful l-scale transition
7
voltage
8
A/D conversion time
9
10
S ampl ing time
11
12
Reference voltage
13
V
V
REF+
REF-
V
= 3.3 V,VSS = 0 V
DD
V
= 3.3 V,V
REF+
T
= 800 ns
AD
V
= 3.3 V,VSS = 0 V
DD
V
= 3.3 V,V
REF+
T
= 15.26 µs
AD
V
= 3.3 V,VSS = 0 V
DD
V
= 3.3 V,V
REF+
T
= 800 ns
AD
= 800 ns
T
AD
T
= 15.26 µs
AD
T
= 1.0 µs
AD
TAD = 15.26 µs
*1
*1
REF-
REF-
REF-
= 0 V
= 0 V
= 0 V
Rating
MINTYPMAX
2580
3220
3275
9.6
183
2
30.5
V
REF-
V
SS
V
0.5
10
±
±
±
±
18
DD
Unit
Bits
3
3
LSB
5
5
mV
s
µ
V
Analog inp ut voltageV
14
Analog inp ut leakage
15
current
Reference voltage pin
16
input leakage curr ent
Ladder resistanceR
17
unselected channel
V
= 0 V to V
ADIN
Lader resistor OFF
V
REF-
<
laddVDD
= 3.3 V20
V
REF+
DD
V
DD
<
REF-
*1 Set the potential difference between VREF+ and VREF- over 2 V.
*2 The value is measured with A/D Converter, not with D/A Converter.
V
REF+
2
±
10
±
5080k
A
µ
Ω
I - 26
Electrical Characteristics
Page 45
1-5-5D/A Converter Characteristics *2
Ta = -40 oC to +85 oC
V
= 3.3 V V
DD
Chapter 1 Overview
= 0 V
SS
ParameterSymbol
Resolution *1
1
Reference voltage low lev el
2
Reference voltage high level
3
Zero-scale output voltage *1V
4
Full- scale output voltage *1V
5
A n alog output resistance
(minimum reference resistance)*1R
6
Non-linearity e r r o rN
7
Diff erenc t ial non-linearit y error
8
*1
9 Settling time *1T
V
V
D
Conditions
REF-
REF+
V
= 3.3 V, V
REF+
ZS
D7 to D0=ALL"L"
V
= 3.3 V, V
REF+
FS
D7 to D0=ALL"H"
OUT
V
LE
NLE
SET
= 3.3 V, V
REF+
= 3.3 V, V
V
REF+
External capacitor CL = 35 pF
All bits are set to ON or OFF
REF-
REF-
REF-
REF-
= 0 V
= 0 V
= 0 V
= 0 V
Rating
MINTYPMAX
8
0
2.0
3.20
7.0
0.0
3.29
11.015.0k
0.5
±
0.5
±
0.5
V
DD
0.05
1.0
±
1.5
±
2.0
Unit
Bits
V
Ω
LSB
s
µ
*1 The standard value is guaranteed under condition of VDD=VREF+=3.3 V, VREF-=0.0 V .
*2 The value is measured with D/A Converter, not with A/D Converter.
Precautions
I - 27
Page 46
Chapter 1 Overview
1-6Precautions
1-6-1General Usage
Connection of VDD pin, and VSS pin
All VDD pins should be connected directly to the power supply and all Vss pins should be connected to
ground in the external. The following shows the correct connections and the incorrect connections. Please
consider the LSI chip orientation before mounting it on the printed circuit board. Incorrect connection may
lead a fusion and break a micro controller.
Cautions for Operation
(1)If you install the product close to high-field emissions (under the cathode ray tube, etc), shield
the package surface to ensure normal performance.
(2)Please consider the operation temperature. The guaranteed operation temperature differs on each
model. For example, if temperature is over the operating condition, its operation may be executed
wrongly.
(3)Please consider the operation voltage. The guaranteed operation voltage differs on each model.
-If the operation voltage is over the operation range, it can be shortened the length of its life.
-If the operation voltage is below the operating range, its operation may be executed wrongly.
I - 28
Electrical Characteristics
Page 47
Chapter 1 Overview
1-6-2Unused Pins
Unused Pins (only for input)
Insert 10 kΩ to 100 kΩ resistor to unused pins (only for input) for pull-up or pull-down. If the input is
unstable, Pch transistor and Nch transistor of input inverter are on, and through current goes to the input
circuit. That increases current consumption and causes power supply noise.
Input
Input
Pch
Nch
Input
10 kΩ to 100 kΩ
Input pin
Input pin
Figure 1-6-1 Unused Pins (only for input)
Current
Input pin
10 kΩ to 100 kΩ
Through current
0Input voltage
Input inverter organization
Input inverter characteristics
Figure 1-6-2 Input Inverter Organization and Characteristics
3
(V
DD=3 V)
Precautions
I - 29
Page 48
Chapter 1 Overview
Unused pins (for I/O)
Unused I/O pins should be set according to pins' condition at reset. If the output is high impedance (Pch
/ Nch transistor : output off) at reset, to stabilize input, set 10 kΩ to 100 kΩ resistor to be pull-up or pulldown. If the output is on at reset, set them open.
Output control
Data
Input
Data
Input
Nch
Output OFF
Output OFF
10 kΩ to 100 kΩ
10 kΩ to 100 kΩ
Output control
Data
Input
Data
Input
Output OFF
10 kΩ to 100 kΩ
Output OFF
Nch
10 kΩ to 100 kΩ
I - 30
Figure 1-6-3 Unused I/O pins (high impedance output at reset)
Precautions
Page 49
Chapter 1 Overview
1-6-3Power Supply
The Relation between Power Supply and Input Pin Voltage
Input pin voltage should be supplied only after power supply is on. If the input pin voltage is applied
supplies before power supply is on, a latch up occurs and causes the destruction of micro controller by a
large current flow.
Input
Forward current generates
Input protection resistance
P
(V
DD
)
N
Figure 1-6-4 Power Supply and Input Pin Voltage
The Relation between Power Supply and Reset Input Voltage
After power supply is on, reset pin voltage should be low for sufficient time, ts, before rising , in order to
be recognized as a reset signal.
Power voltage
Voltage
Reset Input Voltage
Reset pin
low level
0
Time
ts
[ Chapter 2. 2-8 Reset ]
Figure 1-6-5 Power Supply and Reset Input Voltage
t
Precautions
I - 31
Page 50
Chapter 1 Overview
1-6-4Power Supply Circuit
Cautions for Setting Power Supply Circuit
The CMOS logic microcontroller is high speed and high density. So, the power circuit should be designed, taking into consideration of AC line noise, ripple caused by LED driver. Figure 1-6-6 shows an
example for emitter follower type power supply circuit.
An example for Emitter Follower Type Power Supply Circuit
Set condensors for noise-filter near
microcontroller power pins.
V
DD
+
For Noise-filter
Microcontroller
LED port
V
SS
LED
Figure 1-6-6 An Example for Emitter follower type Power Supply Circuit
I - 32
Precautions
Page 51
1-7Package Dimension
Package Code : LQFP064-P-1414
Units : mm
Chapter 1 Overview
Package Dimension
I - 33
Page 52
Chapter 1 Overview
Package Code : TQFP064-P-1010C
Units : mm
I - 34
Precautions
Page 53
Chapter 2 CPU Basics
2
2
11
Page 54
Chapter 2 CPU Basics
2-1Overview
The MN101C CPU has a flexible optimized hardware configuration. It is a high speed CPU with a simple
and efficient instruction set. Specific features are as follows:
1. Minimized code sizes with instruction lengths based on 4-bit increments
The series keeps code sizes down by adopting a basic instruction length of one byte and variable
instruction lengths based on 4-bit increments.
2. Minimum execution instruction time is one system clock cycle.
3. Minimized register set that simplifies the architecture and supports C language
The instruction set has been determined, depending on the size and capacity of hardware, after
an analysis of embedded application programing code and creation code by C language compiler.
Therefore, the set is simple instruction using the minimal register set required for C language
compiler. [
Inter-register operation Min. 2 cycles
Load / store Min. 2 cycles
Conditional branch 2 to 3 cycles
Address 18-bit (max.)
Data 8-bit
Minimum bus cycle 1 system clock cy cle
STOP mode
HALT mode
Data : 8-bit x 4
A ddress : 16-bit x 2
PC : 19-bit
PSW : 8-bit
SP : 16-bit
Basic portion : 1 byte (min.)
Extended portion : 0.5- byte x n
(0 < n < 9)
II - 2
Overview
Page 55
2-1-1Block Diagram
Stack pointer
SP
ABUS
BBUS
Address registers
A0
A1
Program
counter
Incrementer
ALU
Data registers
D0
D1
D2
D3
Processor status word
PSW
T1
T2
Instruction execution
Instruction decoder
Clock
generator
controller
Chapter 2 CPU Basics
Source oscillation
Clock generat or
Instruction
queue
Program address
Internal ROM
Bus controller
RAM busROM bus
Internal RAM
Operand address
Uses a clock oscillat or circuit dr iven by an external c ry sta l or c er amic r esonator to supply c loc k signals
to CP U bloc k s.
Interrupt
controller
Interrupt bus
Peripheral expansion bus
Internal peripheral
functions
Generat es addresses for the instruc t ions to be inserted int o the instruct ion queue. Normally
Program counter
incremented by sequencer indication, but may be set to br anc h destinat ion address or ALU oper at ion
result when branch instruct ions or inter r upt s occur .
Instruction queueStores up to 2 by tes of pre-f et ched instructions.
Instruction decoder
Instruction execut ion
controller
ALU
Decodes the instruction queue, sequentially generates the control signals needed for instruction
ex ec ution, and executes the instruction by controlling the bloc k s within t he chip.
Controls CPU block operations in response to the result decoded by the instruction decoder and
interrupt requests.
Executes arithmetic operations, logic operations, shift operations, and c alculat es operand addresses
for r egister relative indirect addr essing mode.
Int er nal RO M, RAMAssigned to the execution program, data and stack r egion.
A ddr ess register
Stor es the addresses specifying memory f or dat a transfer. S tores the base address for register relative
indirect addressing mode.
Data registerHolds data for oper at ions. Two 8-bit registers can be connected t o f or m a 16-bit r egister.
Int er rupt controllerDetects interr upt r equests from peripheral f unctions and requests CPU shift to int er r upt processing.
Bus controller
Internal peripheral
functi ons
Controls connect ion of CPU int er nal bus and CPU ex ternal bus. Inc ludes bus usage arbitrat ion
functi on.
Includes peripheral func t ions (timer, serial inter f ac e, A/D c onverter, D / A conv er ter, etc.) Peripheral
functions vary with model.
Figure 2-1-1 Block Diagram and Function
Overview
II - 3
Page 56
Chapter 2 CPU Basics
2-1-2CPU Control Registers
This LSI locates the peripheral circuit registers in memory space (x'03F00' to x'03FFF') with memorymapped I/O. CPU control registers are also located in this memory space.
CPU mode control registerII - 21,25
Memory control registerII - 16
R/W
ROM correct ion control registerII - 32
R/W
Bank register for source addressII - 28
R/W
Bank register for destination addressII - 28
R/W
Oscillation frequency control registerII - 25
R/W
R/WROM correct ion address setting r egisterII - 33, 34
For debugger -
Non - maskable interrupt control registerIII - 16
R/W
R/WMaskable interrupt control registerIII - 17 to 37
Reserved ( For reading interrupt vector dat a on int er r upt pr oc ess)-
-
[ Chapter 3 ]
[ Chapter 3 ]
R/W : Readable / Writable*1 a part of bit is only readable
II - 4
Overview
Page 57
Chapter 2 CPU Basics
byte
2-1-3Instruction Execution Controller
The instruction execution controller consists of four blocks: memory, instruction queue, instruction registers, and instruction decoder.
Instructions are fetched in 1-byte units, and temporarily stored in the 2-byte instruction queue. Transfer
is made in 1-byte or half-byte units from the instruction queue to the instruction register to be decoded by
the instruction decoder.
Pipeline process means that reading and decoding are executed at the same time on different instructions, then instructions are executed without stopping. Pipeline process makes instruction execution
continual and speedy. This process is executed with instruction queue and instruction decoder.
Instruction queue is buffer that fetches the second instruction in advance. That is controlled to fetch the
next instruction when instruction queue is empty at each cycle on execution. At the last cycle of instruction execution, the first word (operation code) of executed instruction is stored to instruction register. At
that time, the next operand or operation code is fetched to instruction queue, so that the next instruction
can be executed immediately, even if register direct (da) or immediate (imm) is needed at the first cycle
of the next instruction execution. But on some other instruction such as branch instruction, instruction
queue becomes empty on the time that the next operation code to be executed is stored to instruction
register at the last cycle. Therefore, only when instruction queue is empty, and direct address (da) or
immediate data (imm) are needed, instruction queue keeps waiting for a cycle.
Instruction queue is controlled automatically by hardware so that there is no need to be controlled by
software. But when instruction execution time is estimated, operation of instruction queue should be into
consideration. Instruction decoder generates control signal at each cycle of instruction execution by
micro program control. Instruction decoder uses pipeline process to decode instruction queue at one
cycle before control signal is needed.
2-1-5 Registers for Address
Registers for address include program counter (PC), address registers (A0, A1), and stack pointer (SP).
Program Counter (PC)
This register gives the address of the currently executing instruction. It is 19 bits wide to provide access
to a 256 KB address space in half byte(4-bit increments). The LSB of the program counter is used to
indicate half byte instruction. The program counter after reset is stored from the value of vector table at
the address of 4000.
180
PC
Program
counter
II - 6
Overview
Page 59
Chapter 2 CPU Basics
Address Registers (A0, A1)
These registers are used as address pointers specifying data locations in memory. They support the
operations involved in address calculations (i.e. addition, subtraction and comparison). Those pointers
are 2 bytes data. Transfers between these registers and memory are always in 16-bit units. Either odd or
even address can be transferred. At reset, the value of address register is undefined.
15
0
A0
Address Registers
A1
Stack Pointer (SP)
This register gives the address of the byte at the top of the stack. It is decremented during push operations and incremented during pop operations. Ar reset, the value of SP is undefined.
0
Stack Pointer
15
SP
2-1-6Registers for Data
Registers for data include four data registers (D0, D1, D2, D3).
Data Registers (D0, D1, D2, D3)
Data registers D0 to D3 are 8-bit general-purpose registers that support all arithmetic, logical and shift
operations. All registers can be used for data transfers with memory.
The four data registers may be paired to form the 16-bit data registers DW0 (D0+D1) and DW1 (D2+D3).
At reset, the value of Dn is undefined.
Data
registers
15
D1
D3
87
D0
D2
0
DW0
DW1
Overview
II - 7
Page 60
Chapter 2 CPU Basics
2-1-7Processor Status Word
Processor status word (PSW) is an 8-bit register that stores flags for operation results, interrupt mask
level, and maskable interrupt enable. PSW is automatically pushed onto the stack when an interrupt
occurs and is automatically popped when return from the interrupt service routine.
76543210
PSW
Reserved
NFZF
CFVFIM0IM1MIE
IM1 to 0
( At reset : 0 0 0 0 0 0 0 0 )
Zero flag
ZF
Operation result is not "0".0
Operation result is "0".
1
Carry flag
CF
A carry or a borrow from MSB
0
did not occur.
A carry or a borrow from MSB
1
occured.
Negative flag
NF
MSB of operation results is "0".
0
MSB of operation results is "1".
1
Overflow flag
VF
Overflow did not occur.0
Overflow occured.
1
Interrupt mask level
II - 8
Overview
Controls maskable interrupt acceptance.
MIE
0
1
Reserved
Figure 2-1-3 Processor Status Word(PSW)
Maskable interrupt enable
All maskable interrupts are
disabled.
(xxxLVn,xxxIE) for each interrupt
are enabled.
Set always "0".
Page 61
Chapter 2 CPU Basics
Zero Flag (ZF)
Zero flag (ZF) is set to "1", when all bits are '0' in the operation result. Otherwise, zero flag is cleared to
"0".
Carry Flag (CF)
Carry flag (CF) is set to "1", when a carry from or a borrow to the MSB occurs. Carry flag is cleared to
"0", when no carry or borrow occurs.
Negative Flag (NF)
Negative flag (NF) is set to "1" when MSB is '1' and reset to "0" when MSB is '0'. Negative flag is used
to handle a signed value.
Overflow Flag (VF)
Overflow flag (VF) is set to "1", when the arithmetic operation results overflow as a signed value. Otherwise, overflow flag is cleared to "0".
Overflow flag is used to handle a signed value.
Interrupt Mask Level (IM1 and IM0)
Interrupt mask level (IM1 and IM0) controls the maskable interrupt acceptance in accordance with the
interrupt factor interrupt priority for the interrupt control circuit in the CPU. The two-bit control flag
defines levels '0' to '3'. Level 0 is the highest mask level. The interrupt request will be accepted only
when the level set in the interrupt level flag (xxxLVn) of the interrupt control register (xxxICR) is higher
than the interrupt mask level. When the interrupt is accepted, the level is reset to IM1-IM0, and interrupts
whose mask levels are the same or lower are rejected during the accepted interrupt processing.
Table 2-1-3 Interrupt Mask Level and Interrupt Acceptance
Interrupt mask level
Prior i tyAccep table interr upt leve ls
IM1IM0
Mask lev el 000HighNon-maskable inter r upt ( NMI) only
Mask level 101.NM I, Level 0
Mask level 210.NMI, Level 0 to 1
Mask level 311LowNMI, Level 0 t o 2
Maskable Interrupt Enable (MIE)
Maskable interrupt enable flag (MIE) enables/disables acceptance of maskable interrupts by the CPU's
internal interrupt acceptance circuit. A '1' enables maskable interrupts; a '0' disables all maskable interrupts regardless of the interrupt mask level (IM1-IM0) setting in PSW.
This flag is not changed by interrupts.
Overview
II - 9
Page 62
Chapter 2 CPU Basics
2-1-8Addressing Modes
The MN101C77G series supports the nine addressing modes.
Each instruction uses a combination of the following addressing modes.
1) Register direct
2) Immediate
3) Register indirect
4) Register relative indirect
5) Stack relative indirect
6) Absolute
7) RAM short
8) I/O short
9) Handy
These addressing modes are well-suited for C language compilers. All of the addressing modes can be
used for data transfer instructions. In modes that allow half-byte addressing, the relative value can be
specified in half-byte (4-bit) increments, so that instruction length can be shorter. Handy addressing
reuses the last memory address accessed and is only available with the MOV and MOVW instructions.
Combining handy addresssing with absolute addressing reduces code size. For transfer data between
memory, 7 addressing modes ; register indirect, register relative indirect, stack relative indirect, absolute, RAM short, I/O short, handy can be used. For operation instruction, register direct and immediate
can be used. Refer to instruction's manual for the MN101C series.
This LSI is designed for 8-bit data access. It is possible to tranfer data in 16-bit increments
with odd or all even addresses.
II - 10
Overview
Page 63
Table 2-1-4 Addressing Modes
Addressing modeEffective addressExplanation
Chapter 2 CPU Basics
Register direct
Immediate
Register indirect
Register relative
indirect
Stack relative
indirect
Dn/DWn
An/SP
PSW
imm4/imm8
imm16
(An)
(d8, An)
(d16, An)
(d4, PC)
(branch instructions only)
(d7, PC)
(branch instructions only)
(d11, PC)
(branch instructions only)
(d12, PC)
(branch instructions only)
(d16, PC)
(branch instructions only)
(d4, SP)
(d8, SP)
17
17
17
17
17
15
15
15
15
15
-
-
An
An+d8
An+d16
PC+d4
PC+d7
PC+d11
PC+d12
PC+d16
SP+d4
SP+d8
0
0
0
0 H
0 H
0 H
0 H
0 H
0
0
Directly specifies the register. Only internal
registers can be specified.
Directly specifies the operand or mask
value appended to the instruction code.
Specifies the address using an address
register.
Specifies the address using an address
register with 8-bit displacement.
Specifies the address using an address
register with 16-bit displacement.
Specifies the address using the program
counter with 4-bit displacement and H bit.
* 1
Specifies the address using the program
counter with 7-bit displacement and H bit.
* 1
Specifies the address using the program
counter with 11-bit displacement and H bit.
* 1
Specifies the address using the program
counter with 12-bit displacement and H bit.
* 1
Specifies the address using the program
counter with 16-bit displacement and H bit.
* 1
Specifies the address using the stack
pointer with 4-bit displacement.
Specifies the address using the stack
pointer with 8-bit displacement.
Absolute
RAM short
I/O short
Handy
(d16, SP)
(abs8)
(abs12)
(abs16)
(abs18)
(branch instructions only)
(abs8)
(io8)
(HA)
17
15
15
15
SP+d16
7
11
abs12
abs16
abs18
7
IOTOP+io8
-
abs8
abs8
0
0
0
0
0 H
0
0
Specifies the address using the stack
pointer with 16-bit displacement.
Specifies the address using the operand
value appended to the instruction code.
Optimum operand length can be used to
specify the address.
* 1
Specifies an 8-bit offset from the address
x'00000'.
Specifies an 8-bit offset from the top address
(x'03F00') of the special function register area.
Reuses the last memory address accessed
and is only available with the MOV and
MOVW instructions. Combined use with
absolute addressing reduces code size.
H: half-byte bit
* 1
Overview
II - 11
Page 64
Chapter 2 CPU Basics
2-2Memory Space
2-2-1Memory Mode
ROM is the read only area and RAM is the memory area which contains readable/writable data. In
addition to these, peripheral resources such as memory-mapped special registers are allocated. The
MN101C series supports single chip mode in its memory model.
Table 2-2-1 Memory Mode Setup
Memory modeMM OD pin
Single c hip modeL0-
MMOD pin should be fixed to "L" level.
Set the CS1EXT flag of the memory area control register (AREACTR) to "0" in single-chip
mode.
EXM EM flag inEXADV3 to 1 flag in
(MEMCTR register )(EXADV r egist er )
II - 12
Memory Space
Page 65
Chapter 2 CPU Basics
2-2-2Single-chip Mode
In single-chip mode, the system consists of only internal memory. This is the optimized memory mode and
allows construction of systems with the highest performance.
The single-chip mode uses only internal ROM and internal RAM. The MN101C series devices offer up to 12
KB of RAM and up to 240 KB of ROM. This LSI offers 3 KB of RAM and 48 KB of ROM.
x'00000'
abs 8 addressing
access area
Data
Special function registers
Internal
RAM space
*
CS9
3 KB
256 bytes
256 bytes
x'00100'
x'00C00'
x'03F00'
48 KB
192 KB
128 bytes
64 bytes
x'04000'
x'04080'
x'040C0'
x'10000'
x'20000'
x'3FFFF'
Interrupt
vector table
Subroutine
vector table
Instruction code/
table data
Reserved
MMOD pin = L
Internal
ROM space
*
CS0
Figure 2-2-1 Single-chip Mode
* Differs depending upon the model. [ Table 2-2-2. Internal ROM/ Internal RAM ]
Internal ROMInternal RAM
Model
Addres sbytesAddres sbytes
MN101C77CX '04000' to X'0FFFF'48 KX'00000' to X '00BFF'3 K
MN101CF77GX'04000' to X'23FFF'128 KX '0000 0' to X'01 7FF'6 K
Table 2-2-2. Internal ROM / Internal RAM
Memory Space
II - 13
Page 66
Chapter 2 CPU Basics
2-2-3Special Function Registers
The MN101C series locates the special function registers (I/O spaces) at the addresses x'03F00' to
x'03FFF' in memory space. The special function registers of this LSI are located as shown below.
Note) Do not access to the reserved registers with instructions.
NMICR
TM7ICR
TBICR
Reserved
03FFX
03FEX
Page 67
Chapter 2 CPU Basics
2-3Bus Interface
2-3-1Bus Controller
The MN101C series provides separate buses to the internal memory and internal peripheral circuits to
reduce bus line loads and thus realize faster operation.
There are three such buses: ROM bus, RAM bus, and peripheral expansion bus (I/O bus). They connect
to the internal ROM, internal RAM, and internal peripheral circuits respectively. The bus control block
controls the parallel operation of instruction read and data access. A functional block diagram of the bus
controller is given below.
Instruction
queue
Internal ROM
Program addressOperand address
ROM bus
AD
Bus controller
Address decode
RAM bus
AD
Internal RAM
Bus
arbitor
Memory control register
Memory mode setting
Bus access (wait)
control
Peripheral
extension bus
AD
Internal
peripheral functions
Interrupt
control
Interrupt
bus
Figure 2-3-1 Functional Block Diagram of the Bus Controller
Bus Interface
II - 15
Page 68
Chapter 2 CPU Basics
2-3-2Control Registers
Bus interface is controlled by these 8 bytes of registers : the memory control register (MEMCTR),
memory area control register (AREACTR) and bus mode control register (CSMDn).
Memory Control Register (MEMCTR)
MEMCTR
70
IOW0
IOW1
5
6431
IVBM
EXMEM
EXWH
2
IRWE
EXW1
EXW0
( At reset : 1 1 0 0 1 0 1 1 )
EXW1 to 0Fixed wait cycles
0 0
0 1
1 0
1 1
IRWE
EXWH
Software write enable flag for interrupt request flag
Software write disable
Even if data is written to each interrupt control
register (xxxICR), the state of the interrupt
request flag (xxxIR) will not change.
Software write enable
Fixed wait cycle mode or handshake mode
Handshake mode
Fixed wait cycle mode
Don't care
Don't care
100 ns
150 ns
200 ns
250 ns
EXMEM
IVBM
IOW1 to 0
Set always to "0"
Base address setting for interrupt vector table
0
Interrupt vector base = x'04000'
Interrupt vector base = x'00100'
Figure 2-3-3 Memory Area Control Register (AREACTR : x'03F03', R/W)
In CS0 area, MMOD pin selects internal ROM/external memory. In CS9 area, only external memory can
be selected as internal memory is not available.
The MN101CF77 contains internal memory in CSI area. Therefore, set the CS1EXT flag of the
memory area control register (AREACTR) to "0" . When CS1EXT flag is not set to "0", the data
cannot be accessed to 112KB (x'04000' to x'1FFFF' ) of internal ROM space.
Figure 2-3-4 Bus Mode Control Register (CSMDn : x'03F05' to x'03F09', R/W)
Select 101C bus mode for the area (CS1 to CS8) where internal memory is set with the
memory area control register.
Only 101C bus mode is available in CS0 memory area, and only CSIC bus mode is available
in CS9 memory area.
For the area where CSIC bus mode is selected with the bus mode control register (CSMDn),
set always more than fixed 2 wait cycle and do not use fixed 0 or 1 wait cycle.
Bus Interface
Page 71
Chapter 2 CPU Basics
2-4Standby Function
2-4-1Overview
This LSI has two sets of system clock oscillator (high speed oscillation, low speed oscillation) for two
CPU operating modes (NORMAL and SLOW), each with two standby modes (HALT and STOP). Power
consumption can be decreased with using those modes.
Reset
CPU operation mode
Interrupt
NORMAL mode
NORMAL
OSC: Oscillation
XI: Oscillation
Program 3
IDLE
OSC: Oscillation
XI: Oscillation
Program1
Program 2
SLOW
OSC: Halt
XI: Oscillation
SLOW mode
:CPU halt: Wait period for oscillation stabilization is inserted OSC: High-frequency oscillation clock
XI: Low-frequency oscillation clock (32 kHz)
Program 5
Interrupt
Program 4
Interrupt
Program 5
Interrupt
Program 4
STANDBY mode
HALT 0
OSC: Oscillation
Xl: Oscillation
HALT mode
HALT 1
OSC: Halt
XI: Oscillation
STOP0
OSC: Halt
XI : Halt
STOP mode
STOP1
OSC: Halt
XI: Halt
Figure 2-4-1 Transition Between Operation Modes
Standby Functions
II - 19
Page 72
Chapter 2 CPU Basics
HALT Modes (HALT0, HALT1)
− The CPU stops operating. But both of the oscillators remain operational in HALT0 and only the highfrequency oscillator stops operating in HALT1.
− An interrupt returns the CPU to the previous CPU operating mode that is, to NORMAL from HALT0 or
to SLOW from HALT1.
STOP Modes (STOP0, STOP1)
− The CPU and both of the oscillators stop operating.
− An interrupt restarts the oscillators and, after allowing time for them to stabilize, returns the CPU to the
previous CPU operating mode - that is, to NORMAL from STOP0 or to SLOW from STOP1.
SLOW Mode
− This mode executes the software using the low-frequency clock. Since the high-frequency oscillator is
turned off, the device consumes less power while executing the software.
IDLE Mode
− This mode allows time for the high-frequency oscillator to stabilize when the software is changing from
SLOW to NORMAL mode.
To reduce power dissipation in STOP and HALT modes, it is necessary to check the stability of both the
output current from pins and port level of input pins. For output pins, the output level should match the
external level or direction control should be changed to input mode. For input pins, the external level
should be fixed.
This LSI has two system clock oscillation circuits. OSC is for high-frequency operation (NORMAL mode)
and XI is for low-frequency operation (SLOW mode). Transition between NORMAL and SLOW modes or
to standby mode is controlled by the CPU mode control register (CPUM). Reset and interrupts are the
return factors from standby mode. A wait period is inserted for oscillation stabilization at reset and when
returning from STOP mode, but not when returning from HALT mode. High/low-frequency oscillation
mode is automatically returned to the same state as existed before entering standby mode.
To stabilize the synchronization at the moment of switching clock speed between high speed
oscillation (fosc) and low speed oscillation (fx), fosc should be set to 2.5 times or higher
frequency than fx.
II - 20
Standby Functions
Page 73
Chapter 2 CPU Basics
2-4-2CPU Mode Control Register
Transition from one mode to another mode is controlled by the CPU mode control register (CPUM).
The procedure for transition from NORMAL to HALT or STOP mode is given below.
(1)If the return factor is a maskable interrupt, set the MIE flag in the PSW to "1" and set the interrupt
mask (IM) to a level permitting acceptance of the interrupt.
(2)Clear the interrupt request flag (xxxIR) in the maskable interrupt control register (xxxICR) , set the
interrupt enable flag (xxxIE) for the return factor, and set the IE flag in the PSW.
(3)Set CPUM to HALT or STOP mode.
Set the IRWE flag of the memory control register (MEMCTR) to clear interrupt request flag
by software.
System clock (fs) is changed depending on CPU operation mode.
In NORMAL mode, HALT0 mode, fs is based on fosc (high speed oscillation). In SLOW
mode, IDLE mode, HALT1 mode, fs is based on fx (low speed oscillation).
[ Chapter 2. 2-5 Clock Switching ]
Standby Functions
II - 21
Page 74
Chapter 2 CPU Basics
2-4-3Transition between SLOW and NORMAL
This LSI has two CPU operating modes, NORMAL and SLOW. Transition from SLOW to NORMAL requires
passing through IDLE mode.
A sample program for transition from NORMAL to SLOW mode is given below.
Program 1
MOV x'3', D0; Set SLOW mode.
MOV D0, (CPUM)
Transition from NORMAL to SLOW mode, when the low-frequency clock has fully stabilized, can be
done by writing to the CPU mode control register. In this case, transition through IDLE is not needed.
For transition from SLOW to NORMAL mode, the program must maintain the idle state until high-frequency clock oscillation is fully stable. In IDLE mode, the CPU operates on the low-frequency clock.
For transition from SLOW to NORMAL, oscillation stabilization waiting time is required same
as that after reset. Software must count that time.
We recommend selecting the oscillation stabilization time after consulting with oscillator
manufacturers.
Sample program for transition from SLOW to NORMAL mode is given below.
Program 2
MOVx'01', D0; Set IDLE mode.
MOVD0, (CPUM)
Program 3
MO Vx'0B', D0; A loop to keep approx. 6.7 ms with low-frequency clock (32 kHz)
LOOPADD-1, D0; operation when changed to high-frequency clock (20 MHz).
BNELOOP;
SUBD0, D0;
MOV D0, (CPUM); Set NORMAL mode.
II - 22
Standby Functions
Page 75
Chapter 2 CPU Basics
2-4-4Transition to STANDBY Modes
The program initiates transitions from a CPU operating mode to the corresponding STANDBY (HALT/
STOP) modes by specifying the new mode in the CPU mode control register (CPUM). Interrupts initiate
the return to the former CPU operating mode.
Before initiating a transition to a STANDBY mode, however, the program must
(1)Set the maskable interrupt enable flag (MIE) in the processor status word (PSW) to '0' to disable
all maskable interrupts temporarily.
(2)Set the interrupt enable flags (xxxIE) in the interrupt control registers (xxxICR) to '1' or '0' to
specify which interrupts do and do not initiate the return from the STANDBY mode. Set MIE '1' to
enable those maskable interrupts.
NORMAL/SLOW
mode
Disable all interrupts
Enable interrupt which
will trigger return
Set HALT/STOP
mode
Clear MIE flag in the PSW and all interrupt enable flags (xxx IE)
in the maskable interrupt control register.
Set the xxx IE of the return factor,
and set MIE flag in the PSW.
Processing inside parentheses () is handled by hardware.
When returning from STOP
mode, wait for oscillation to
(
stabilize
NORMAL/SLOW
mode
Interrupt acceptance cycle
)
Watchdog timer
HALT: restarts counting
(
STOP: enabled
)
HALT/STOP
mode
Watchdog timer
HALT: stop counting
(
STOP: reset
Return factor interrupt
occured
)
Figure 2-4-3 Transition to/from STANDBY Mode
If the interrupt is enabled but interrupt priority level of the interrupt to be used is not equal to
or higher than the mask level in PSW before transition to HALT or STOP mode, it is impossible to return to CPU operation mode by maskable interrupt.
Standby Functions
II - 23
Page 76
Chapter 2 CPU Basics
Transition to HALT modes
The system transfers from NORMAL mode to HALT0 mode, and from SLOW mode to HALT1 mode.
The CPU stops operating, but the oscillators remain operational. There are two ways to leave a HALT
mode: a reset or an interrupt. A reset produces a normal reset; an interrupt, an immediate return to the
CPU state prior to the transition to the HALT mode. The watchdog timer, if enabled, resumes counting.
Program 4
MOVx'4', D0; Set HALT mode.
MOVD0, (CPUM)
NOP; After written in CPUM, some NOP
NOP; instructions (three or less) are
NOP; executed.
Transition to STOP mode
The system transfers from NORMAL mode to STOP0 mode, and from SLOW mode to STOP1 mode. In
both cases, oscillation and the CPU are both halted. There are two ways to leave a STOP mode: a reset
or an interrupt.
Program 5
MOVx'8', D0; Set STOP mode
MOVD0, (CPUM)
NOP; After written in CPUM, some NOP
NOP; instructions (three or less) are
NOP; executed.
Right after the instruction of the transition to HALT, STOP mode, NOP instruction should be
inserted 3 times.
II - 24
Standby Functions
Page 77
Chapter 2 CPU Basics
2-5Clock Switching
This LSI can select the best operation clock for system by switching clock cycle division factor by
program. Division factor is determined by both flags of the CPU mode control register (CPUM) and the
Oscillator frequency control register (OSCMD). At the highest-frequency, CPU can be operated in the
same clock cycle to the external clock hence providing wider operating frequency range.
OSCMD
CPUM
7654321
------
SOSC2DS
0
Reserved
( At reset : - - - - - - 0 0 )
Reserved
SOSC2DS
0
1
Set "0", always.
Low-frequency Clock
Standard (Input the oscillation clock cycle)
Divided (Input the oscillation clock cycle
divided by 2)
Figure 2-5-1 Oscillator Frequency Control Register (OSCMD : x'03F2D', R/W)
7654321
SOSCDBL
HALT
OSC1OSCSEL1 OSCSEL0 OSCDBLSTOP
0
OSC0
( At reset : 0 0 0 0 0 0 0 0 )
OSCDBL
Standard (Input the oscillation clock cycle
0
divided by 2)
2x-speed (Input the oscillation clock cycle)
1
Internal System Clock
OSCSEL1OSCSEL0
0
0
1
1
SOSCDBL
Standard (Input the oscillation clock cycle
0
divided by 2)
2x-speed (Input the oscillation clock cycle)
1
NORMAL modeSLOW mode
0
1
0
1
Low Speed Oscillation Clock
1
4
16
64
Figure 2-5-2 CPU Mode Control Register (CPUM : x'03F00', R/W)
Clock Switching
Division factor
1
4
16
16
II - 25
Page 78
Chapter 2 CPU Basics
CPU
High-frequency
Low-frequency
4
.
2
.
fx
SOSC2DS
OSCSEL1 OSCSEL0 OSCDBL
0002
0011
0108
0114
10032
10116
11064
11164
Figure 2-5-4 Setting Division Factor at NORMAL mode
fosc
1
0
Figure 2-5-3 Clock Switching Circuit
by combination of OSCSEL and OSCDBL
.
.
2
2
11
0
11
1
OSCDBL
0
1
SOSCDBL
High-frequency (OS C ) Input
0
1
OSC0
Division factor for
(NORMAL mode)
.
.
4
16
00
01
1*
System Clock
.
OSCSEL[1:0]
fs
Division factor for
OSCSEL1 OSCSEL0 SOSCDBL SOSC2DS
00002
00014
00101
00112
01104
Figure 2-5-5 Setting Division Factor at SLOW mode
by combination of OSCSEL and SOSC2DS
On clock switching, set each flag of OSCDBL, OSCSEL, SOSCSEL and OSC0, individually.
Even if those flags are mapped on the same special functions register, set twice.
Set the OSC0 flag to "0" (NORMAL mode) before switching of division factor for
low-frequency input.
Set the division factor in SLOW mode only to 1 to 4 division and do not set other values.
Low-frequency (X I / XO) Input
(SLOW mode)
II - 26
Clock Switching
Page 79
Chapter 2 CPU Basics
2-6Bank Function
2-6-1Overview
CPU of MN101C00 series has basically 64 KB memory address space. On this LSI, address space can be
expanded up to 4 banks (256 KB) based on units of 64 KB, by bank function.
2-6-2Bank Setting
Bank function can be used by setting the proper bank area to the bank register for source address
(SBNKR) or the bank register for destination address (DBNKR). At reset, both of the SBNKR register
and the DBNKR register indicate bank 0. Bank function is valid after setting any value except "00" to the
SBNKR register or the DBNKR register.
When the both registers of SBNKR and DBNKR are operated at interrupt processing, pushing onto the
stack or popping are necessary.
Table 2-6-1 Address Range
SBA1SBA0
(DBA1)(DBA0)
00Bank 0x'00000' to x'0FFFF'
01Bank 1x'10000' to x'1FFFF'
10Bank 2x'20000' to x'2FFFF'
11Bank 3x'30000' to x'3FFFF'
When bank area is changed at interrupt processing, pushing onto the stack or popping must
be done by program, if it necessary.
The stack area should be set in the area of bank 0, always. Furnished C compiler does not
support bank function.
During bank function is valid, I/O short instruction should be used for access to the special
function register area (x'03F00' to x'03FFF'). For access to the memory space x'13F00' to
x'13FFF', x'23F00' to x'23FFF' and x'33F00' to x'33FFF', both instructions of register indirect
and register relative indirect should be used. [
Bank areaAddress range
Chapter 2 2-1-8. Addressing Modes]
Bank Function
II - 27
Page 80
Chapter 2 CPU Basics
Bank Register for Source Address
The SBNKR register is used to specify bank area for loading instruction from memory to register. Once
this register is specified, bank control is valid for all addressing modes except I/O short instruction and
stack relative indirect instruction.
[ Chapter 2 2-1-8. Addressing modes ]
SBNKR
7654321
SBA1------SBA0
0
( At reset : - - - - - - 0 0 )
SBA1
0
0
1
1
SBA
0
1
0
1
Bank for source address selection
0
bank 0
bank 1
bank 2
bank 3
Figure 2-6-1 Bank Register for Source Address (SBNKR:x'03F0A', R/W)
Bank Register for Destination Address
The DBNKR register is used to specify bank area for storing instruction from register to memory. Once
this register is specified, bank control is valid for all addressing modes except I/O short instruction,stack
relative indirect instruction and bit manipulation instruction.
[ Chapter 2 2-1-8. Addressing modes ]
DBNKR
7654321
DBA1------DBA0
0
( At reset : - - - - - - 0 0 )
DBA1
0
0
1
1
DBA
0
1
0
1
Bank for destination address selection
0
bank0
bank1
bank2
bank3
Figure 2-6-2 Bank Register for Destination Address (DBNKR:x'03F0B', R/W)
Read, modify, write instruction such as bit manipulation (BSET, BCLR, BTST) depend on the
value of the SBNKR register, both of for reading and writing.
II - 28
Bank Function
Page 81
Chapter 2 CPU Basics
2-6-3Bank Memory Space
When bank function is used, the memory space, where CPU can access as data, shows as the following
hatched part.
Single Chip Mode
In single chip mode used internal ROM and internal RAM, an expanded bank area (bank 1, 2 and a part
of bank 3) is in the memory space of internal ROM. In the expanded bank area, reading out of table data
is enable, but rewrite is disable.
16 KB
48 KB
64 KB
64 KB
64
KB
256 bytes
256 bytes
128 bytes
64 bytes
00000
00100
00C00
03F00
04000
04080
040C0
10000
20000
30000
abs8 addressing
access area
Data
Peripheral I/O
Interrupt
vector table
Subroutine
vector table
Instruction code
table data
Internal RAM
(3
KB
)
I/O space
(Special Function Register)
Internal ROM
8 KB
)
(4
Read / Write
bank 0
Read
bank 1
bank 2
bank 3
3FFFF
Figure 2-6-3 Single Chip Mode
Differs depending upon the model. [ Table 2-2-2. Internal ROM/ Internal RAM ]
Bank Function
II - 29
Page 82
Chapter 2 CPU Basics
2-7ROM Correction
2-7-1Overview
This LSI can correct and change max. 3 parts in a program on mask ROM with ROM correction function.
The correct program is read from the external to the RAM space by using the external EEPROM or by
using the serial transmission. This function is valid to the system with the external EEPROM.
2-7-2Correction Sequence
Program is corrected as following steps.
(1) The instruction execution address is compared to the correction address.
(2) Program counter is branched indirectly to the RAM address (the head address of the correct pro gram) stored to the RC vector table (RCnV(L), RCnV(H)), after matching the above addresses.
This instruction needs 6 cycle.
(3) The corrected program at the RAM area is executed.
(4) Program counter is branched back to the program at ROM area.
RCnV(L)
RCnV(H)
When a match occurs, the program
counter branches indirectly to
the start address of the correct program.
Correct program
label 1
label 2_
NG Instruction
the head address to be corrected
JMP label2_
recover
Development data
from the external EEPROM
II - 30
internal ROMinternal RAM
Figure 2-7-1 ROM Correction
ROM Correction
Page 83
Chapter 2 CPU Basics
The ROM correction setup procedure is as follows.
(1) Set the head address of the program to be corrected to the ROM correction address setting
register (RCnAPH/M/L).
(2) Set the correct program at RAM area.
(3) Set the head address of the correct program to RC vector table (RCnV(L), RCnV(H)).
(4) Set the RCnEN flag of ROM correction control register (RCCTR) to enable the ROM correction.
When the instruction of the corrected program head address is the half-byte instruction, the
ROM correction checks the execution instruction of the half-byte. Therefore, set the address
by a byte to the ROM correction address setting register.
When the instruction of the corrected program last address is the half-byte instruction, the
recover address should be set by half byte.
ROM Correction
II - 31
Page 84
Chapter 2 CPU Basics
2-7-3ROM Correction Control Register
ROM correction control register (RCCTR) and ROM correction address setting register (RCnAPL,
RCnAPM, RCnAPH) control the ROM correction.
ROM correction control register (RCCTR) enables/disables the ROM correction function to 3 parts of the
program to be corrected. When the RCnEN flag is set, the ROM correction is activated. And when the
ROM address (the instruction execution address) reaches the set address to the ROM correction address setting register, it branches indirectly to the RAM address set on the RC vector table (RCnV(L),
RCnV(H)). Set the RCnEN flag after setting the ROM correction address setting register.
ROM Correction Control Register(RCCTR)
76543210
RCCTR
---
--
RC2EN
RC1EN RC0EN
( At reset : - - - - - 0 0 0 )
RC0EN
RC1EN
RC2EN
ROM correction control at 1st address
0
1
ROM correction control at 2nd address
0
1
ROM correction control at 3rd address
0
1
Disable
Enable
Disable
Enable
Disable
Enable
Figure 2-7-2 ROM Correction Control Regiser (RCCTR : x'03F0E', R/W)
II - 32
ROM Correction
Page 85
Chapter 2 CPU Basics
This register set the head address, which instructions to be corrected are stored to. Once the instruction
execution address reaches to the set value to this register, program counter branches indirectly to the
set address to the RC vector table (RCnV(L), RCnV(H)). When the ROM correction should be valid, set
the RCnEN flag of the ROM correction control register (RCCTR) after setting the address to this register.
Do not set the same address to more than two RCnAP (H/M/L) register. If there are several
registers set the same address, the order of priority is as follows :
RC0AP > RC1AP > RC2AP
Here is the correspondence of the ROM correction address setting register, a ROM correction control
flag of ROM correction control register and the RC rector table.
Table 2-7-1 Correspondence
ROM Correc tion address sett ing re gister
ROM correction
RegisterAddresscontr o l flagVe c torAddr ess
RC0APLx'3FC7'RC0V(L)x'0010'
RC0APMx'3FC8'
RC0EN
RC0APHx'3FC9'
RC1APLx'3FCA'RC1V(L)x'0014'
RC1APMx'3FCB'
RC1EN
RC1APHx'3FCC'
RC2APLx'3FCD'RC2V(L)x'0013'
RC2APMx'3FCE'
RC2EN
RC2APHx'3FCF'
RC-v ec t or table
RC0V(H)x'0012'
RC1V(H)x'0011'
RC2V(H)x'0015'
II - 34
ROM Correction
Page 87
Chapter 2 CPU Basics
2-7-4ROM Correction Setup Example
Initial Routine with ROM Correction
The following routine should be set to correct the program. Also store the ROM correction setup and the
correct program to the external EEPROM, in advance.
Here is the steps for ROM correction execution.
Initial Setup
Determine whether to use
ROM Correction
yes
Step 1
Develop the correct program of
the external EEPROM to RAM area
Step 2
Set the ROM correction
address setting register
and the RC vector table
Step 3
Enable the ROM correction operation
Main Program
no
Figure 2-7-12 Initial Routine for ROM Correction
ROM Correction
II - 35
Page 88
Chapter 2 CPU Basics
ROM Correction Setup Example
The setup procedure with ROM correction to correct 2 parts of the program is shown below.
For the step to execute the ROM correction, refer to figure 2-7-12. Initial Routine for ROM correction on
the previous page.
(STEP 1)Develop the correct program of the external EEPROM to RAM area.
Set value to the ROM correction address 0 setting register
09
01
B4
The head address of the development first correct program
06
FD
Set value to the ROM correction address 1 setting register
08
01
BC
The head address of the development second correct program
06
0A
00
85
The first correct program instruction code
93
C2
91
F0
For half-byte instruction adjustment
FF
0A
(no need to the real ROM)
14
85
93
The second correct program instruction code
02
90
00
(RC0AP)
(RC1AP)
(STEP 2)Set the ROM correction address setting register and the RC vector table.
[Setup for the first correction]
Set the head address of the program to be
corrected at first to the ROM correction address 0
setting register (RC0AP).
RC0APL = x'19'
RC0APM = x'09'
RC0APH = x'01'
Set the internal RAM address x'06B4' that stored the
first correct program to the RC vector table address
(RC0V(L), RC0V(H).
RC0V(L) = x'B4'
RC0V(H) = x'06'
II - 36
ROM Correction
The first program to be corrected (internal ROM)
The head address of the correction
Address
10916
10919
1091B
1091C
1091E
The first correct program (internal RAM)
Address
006B4
006B6
006B7
Data
D900A0
A005
58
8940
B4
The address for recover
The head address of the correction program
Data
A000
58
392C190
(the set value of RC0AP)
cbne0, d1, 1091E
mov50, d0
movd0, (a0)
bra10920
subd0, d0
(the set value of RC0V)
mov0, d0
movd0, (a0)
bra1091C
The addres for recover
Page 89
Chapter 2 CPU Basics
[Setup for the second correction]
Set the head address of the program to be
corrected at second to the ROM correction address 1
setting register (RC1AP).
Set the internal RAM address x'06BC' that stored the
second correct program to the RC vector table address
(RC1V(L), RC1V(H).
RC1V(L) = x'BC'
RC1V(H) = x'06'
The second correct program (internal RAM)
The head address of the correction program
Address
006BC
006BE
006BF
Data
A041
58
3920090
(the set value of RC1V)
mov14, d0
movd0, (a0)
jmp10900
The address for recover
(STEP 3)Set the bit 0 (RC0EN) and the bit 1 (RC1EN) of the ROM correction control register
(RCCTR) to "1".
After the main program is started, the instruction fetched address and the set address
to the ROM correction address setting register (RCnAP) are always compared, then
once they are matched program counter indirectly branches to the address in RAM
area, that are stored to the RC vector table (RCnV).
The correction program in RAM area is executed.
Program counter recovers to the program in ROM area.
ROM Correction
II - 37
Page 90
Chapter 2 CPU Basics
2-8Reset
2-8-1Reset operation
The CPU contents are reset and registers are initialized when the NRST pin is pulled to low.
Initiating a Reset
There are two methods to initiate a reset.
(1)Drive the NRST pin low.
NRST pin should be held "low" for more than OSC 4 clock cycles (200 ns at 20 MHz).
NRST pin
4 clock cycles
(200 ns at 20 MHz)
Figure 2-8-1 Minimum Reset Pulse Width
(2)Setting the P2OUT7 flag of the P2OUT register to "0" outputs low level at P27 (NRST) pin. And
transferring to reset by program (software reset) can be executed. If the internal LSI is reset
and register is initiated, the P2OUT7 flag becomes "1" and reset is released.
[ Chapter 4. 4-4-2 Registers ]
On MN101C77 series, the starting mode is NORMAL mode that high oscillation is the base
clock.
When NRST pin is connected to low power voltage detection circuit that gives pulse for
enough low level time at sudeen unconnected. And reset can be generated even if NRST pin
is held "low" for less than OSC 4 clock cycles, take notice of noise.
II - 38
Reset
Page 91
Chapter 2 CPU Basics
Sequence at Reset
(1)When reset pin comes to high level from low level, the innternal 14-bit counter (It can be used as
watchdog timer, too.) starts its operation by system clock. The period from starting its count from
its overflow is called oscillation stabilization wait time.
(2)During reset, internal register and special function register are initiated.
(3)After oscillation stabilization wait time, internal reset is released and program is started
from the address written at address X '4000' at interrupt rector table.
VDD
NRST
OSC2/XO
internal RST
Oscillation stabilization
wait time
Figure 2-8-2 Reset Released Sequence
Reset
II - 39
Page 92
Chapter 2 CPU Basics
2-8-2Oscillation Stabilization Wait time
Oscillation stabilization wait time is the period from the stop of oscillation circuit to the stablization for
oscillation. Oscillation stabilization wait time is automatically inserted at releasing from reset and at
recovering from STOP mode. At recovering from STOP mode the oscillation stabilization wait time control register (DLYCTR) is set to select the oscillation stabilization wait time. At releasing from reset,
oscillation stabilization wait time is fixed.
The timer that counts oscillation stabilization wait time is also used as a watchdog timer. That is used as
a runaway detective timer at anytime except at releasing from reset and at recovering from STOP mode.
Watchdog timer is initiated at reset and at STOP mode and starts counting from the initialize value
(x'0000') when system clock (fs) is as clock source. After oscillation stabilization wait time, it continues
counting as a watchdog timer. [ Chapter 9 Watchdog timer ]
Block Diagram of Oscillation Stabilization Wait Time (watchdog timer)
NRST
STOP
writeWDCTR
HALT
(sysclk)
fs
DLYCTR
DLYS0
DLYS1
DLYS2
BUZS0
BUZS1
BUZS2
BUZOE
WDCTR
WDEN
WDTS0
WDTS1
WDTC0
WDTC1
WDTC2
-
-
R
1/2 to 1/2
14
0
7
0
7
RR
1/215 to 1/2
20
14
fs/2
12
fs/2
10
fs/2
8
fs/2
fs/2
fs/2
fs/2
fs/2
fs/2
fs/2
fs/2
6
4
2
22
20
18
16
MUX
MUX
S
internal reset release
WDIRQ
Figure 2-8-3 Block Diagram of Osillation Stabilization Wait Time (watchdog timer)
II - 40
Reset
Page 93
Oscillation Stabilization Wait Time Control Register
24
3
DLYS1DLYS2BUZS0
DLYCTR
BUZOEBUZS2
567
BUZS1
Chapter 2 CPU Basics
01
-DLYS0
(At reset: 0 0 0 0 0 0 0 -)
DLYS1DLYS2
0
0
1
0
1
1
Note : After reset is released, the oscillation stabilization
wait period is fixed at fs/2
BUZS20BUZS1
0
1
0
1
1
BUZOE
Oscillation stabilization wait
DLYS0
period selection
0
1
0
1
0
1
0
1
BUZS0
0
1
0
1
0
1
0
1
14
fs/2
12
fs/2
10
fs/2
8
fs/2
6
fs/2
4
fs/2
2
fs/2
Reserved
14
.
Buzzer output
frequency selection
14
fosc/2
13
fosc/2
12
fosc/2
11
fosc/2
10
fosc/2
9
fosc/2
4
fx/2
3
fx/2
P06 output selection
0
1
P06 port data output
P06 buzzer output
Figure 2-8-4 Oscillation Stabilization Wait Time Control Register (DLYCTR : x'03F4D', R/W)
Control the Oscillation Stabilization Wait Time
At recovering from STOP mode, the bit 3-2 (DLYS1, DLYS0) of the oscillation stabilization wait time
control register can be set to select the oscillation stabilization wait time from 214, 210, 26, 22 x system
clock. The DLYCTR register is also used for controlling of buzzer functions.
[ Chapter 10 Buzzer ]
At releasing from reset, the oscillation stabilization wait time is fixed to "214 x system clock". System clock
is determined by the CPU mode control register (CPUM).
Reset
II - 41
Page 94
Chapter 2 CPU Basics
2-9Register Protection
2-9-1Overview
This LSI features a function to protect important register data. When this function is enabled, data is
rewritten only when write is done for several times to a register and other write is disabled. Registers with
this function are as follows.
CPU mode control register (CPUM: x'03F00')
Memory control register (MEMCTR: x'03F01')
2-9-2Setting of the Register Protection Function
Set the L0CKEN flag of the key control register (KEYCNT) to "1" to enable the register protection function.
24
567
KEYCNT
3
-------
01
LOCKEN
(At reset: - - - - - - - 0)
LOCKEN
Register protect function selection
Disable
0
Enable
1
Figure 2-9-1 Key Control Register (KEYCNT: x'03F2B', R/W)
2-9-3Rewrite Procedure
Write 03 to the CPUM register:
LOOPMOV x'**', (CPUM)
MOV x'03', (CPUM)
CBNE x'03', (CPUM), LOOP
** indicates Don't care
xInterrupts may change the procedure of the program and disable sequence writes. Make
sure that write is done properly or disable interrupts during write.
xWrite to a register is executed even when several writes, which include access to RAM
area (x'00000' to x'02FFF) are done.
II - 42
Register Protection
Page 95
Chapter 3Interrupts
3
Page 96
Chapter 3 Interrupts
3-1Overview
This LSI speeds up interrupt response with circuitry that automatically loads the branch address to the
corresponding interrupt service routine from an interrupt vector table : reset, non-maskable interrupts
(NMI), 16 maskable peripheral interrupts, and 5 external interrupts.
For interrupts other than reset, the interrupt processing sequence consists of interrupt request, interrupt
acceptance, and hardware processing. After the interrupt is accepted, the program counter (PC) and
processor status word (PSW) and handy addressing data (HA) are saved onto the stack. And an interrupts handler ends by restoring, using the POP instruction and other means, the contents of any registers used during processing and then executing the return from interrupt (RTI) instruction to return to the
point at which execution was interrupted. Max.12 machine cycles before execution, and max 11 machine
cycles after execution.
Each interrupt has an interrupt control register, which controls the interrupts. Interrupt control register
consists of the interrupt level field (LV1-0), interrupt enable flag (IE), and interrupt request flag (IR).
Interrupt request flag (IR) is set to "1" by an interrupt request, and cleared to "0" by the interrupt acceptance. This flag is managed by hardware, but can be rewritten by software.
Interrupt enable flag (IE) is the flag that enables interrupts in the group. There is no interrupt enable flag
in non-maskable interrupt (NMI). Once this interrupt request flag is set, it is accepted without any conditions. Interrupt enable flag is set in maskable interrupt. Interrupt enable flag (IE) of each maskable
interrupt is valid when the maskable interrupt enable flag (MIE flag) of PSW is "1".
Maskable interrupts have had vector numbers by hardware, but their priority can be changed by setting
interrupts level field. There are three hierarchical interrupt levels. If multiple interrupts have the same
priority, the one with the lowest vector number takes priority. Maskable interrupts are accepted when its
level is higher than the interrupt mask level (IM1-0) of PSW. Non-maskable interrupts are always accepted, regardless of the interrupt mask level.
III - 2
Overview
Page 97
3-1-1Functions
Chapter 3 Interrupts
Table 3-1-1 Interrupt Functions
Int err upt typeReset (interr upt)Non-maskable interruptM askable inter r upt
V ec tor number012 to 28
Table addressx'04000'x'04004'x '04008' to x'04070'
Star ting address
Interrupt level--
Int err upt factorExternal RST pin input
Generat ed oper ationDirect input to CPU core
A c c ept operationA lways acceptsA lways accept s
M ac hine c ycles until
acceptance
PSW stat us after acceptance
121212
A ll flags are clearedT he int er r upt mask level flag (xxxLVn) ar e set t o the
to " 0" .flag in PSW is cleared interrupt mask lev el (masking
A ddr ess specified by vect or addr ess
(set by software)
Error s detection,External pin input
PI interrupt
Input to CPU core from
non-maskable interrupt
contr ol register ( NMICR)interrupt control register
to " 00" .all interrupt r equests with the
Int ernal per ipheral
functi on
Input interrupt request
lev e l set in interrupt level flag
(xxxL Vn) of maskable
(xxxICR) t o CPU core.
A c c eptance only by the
interrupt control of t he r egister
■Interrupt Processing Sequence
For interrupts other than reset, the interrupt processing sequence consists of interrupt request, interrupt
acceptance, and hardware processing. The program counter (PC) and processor status word (PSW)
and handy addressing data (HA) are saved onto the stack, and execution branches to the address
specified by the corresponding interrupt vector.
An interrupt handler ends by restoring the contents of any registers used during processing and then
executing the return from interrupt (RTI) instruction to return to the point at which execution was interrupted.