www.DataSheet4U.com MICROCOMPUTER MN101C00 MN101C115/117 LSI User's Manual Pub. No. 21411-011E www.DataSheet4U.com 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 www.DataSheet4U.com (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 Control Law" is to be exported or taken out of Japan. (2) The contents of this book are subject to change without notice in matters of improved function. When finalizing your design,therefore,ask for the most up-to-date version in advance in order to check for any changes. (3) We are not liable for any damage arising out of the use of the contents of this book, or for any infringement of patents or any other rights owned by a third party. (4) No part of this book may be reprinted or reproduced by any means without written permission from our company. (5) This book deals with standard specifications. Ask for the latest individual Product Standards or Specifications in advance for more detailed information required for your design,purchasing and applications. 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 or Matsushita Electronics Corporation's Sales Department. How to Read This Manual The MN101C11x incorporates more than one ROM/RAM to meet a variety of applications. An EPROM version as well as a Mask ROM version is available so users can write a program by themselves. ROM 8K RAM MN101C115*1 256 16K MN101C117 512 16K MN101CP117 512 Under plannin *1 : Unit Byte ?@@?e ?@@?e ?@@?e ?@@?e ?? ?? ?? ?? ?? ?? ? ?? ?? ?? ?? ?? ?? ?? ? ?? ?? ?? ?? ?? ?? ?? ? ?? ?? ?? ?? ?? ?? ?? ? ?? ?? ?? ?? ?? ?? ?? ? ?? ?? ?? ?? ?? ?? ?? ? ?? ?? ?? ? ??? ?? ?? ?W2@@6T2@??? W&(?'@@ MN101C00 Series Command Manual MN101C00 Series Cross Assembler User's Manual MN101C00 Series C Compiler User's Manual Operation MN101C00 Series C Compiler User's Manual Language MN101C00 Series C Compiler User's Manual Library MN101C00 Series C Source Code Debugger User's Manual MN101C00 Series PanaX Series Installation Manual Where to Send Inquires Please send any inquires or questions concerning the contents of this manual to the Panasonic semiconductor design center closest to you. A list of addresses is provided at the end of this manual for your convenience. How to Read This Manual-3 ?? @@@?he O26Xe @@Y?e?O26X?e @@@@@@@@@@@@@@@@@@@@@)e ?@@@@@@@@@@@@@@@@@@@)?e ?I'Xg@Xh @Khf?O26X?e N)X?e?J@@h @@@@@@@@@@@@@@@@@@)?e ?@)KeO&Y?eO26Xe @@ @@H?e @@@@@@@@@@@@@@@@@@@@@)e @@ @@f @@@@@@@@@@@@@@@@@@f @@@@@@@@@@@@@@g @@ @@he@@g @@f?@@@e@@@?g @@he@@g @@f?@@He@@Y?O)X?e @@@@@@@@@@@@@@g @@?@@@@@@?e@@@@@@)?e @@he@@g @@f?@@?e@@h @@he@@g @@f?@@?e@@eO)X?e @@@@@@@@@@@@@@g @@?@@@@@@?e@@@@@@)?e @0M?e@@e?I4@g ?J@5f?@@?e@@h @@gO26Xe ?7@Hf?@5?e@@h @@@@@@@@@@@@@@@@@@@@@)e ?@5?'@@@@@H?e@@eO26Xe @@hf ?@H?V+MW@5f@@@@@@@)e @@hf J5fW&(Yf@@h @@hf .Ye?O&0Y?f@@h @@hf @0M?g@@h W&g O2@@6Kf O2@@6Kf O2@@6Kf ?O2@@@e ?W&@g ?@@(MI'@@?e ?@@(MI'@@?e ?@@(MI'@@?e ?W2@0Mf W&@@g J@(YeV'@Le J@(YeV'@Le J@(YeV'@Le W&(Mg .Y@@g 7@H?e?N@1e 7@H?e?N@1e 7@H?e?N@1e ?W&(Y?g @@g @@g@@e @@g@@e @@g@@e ?7@Hh @@g @@g@@e @@g@@e @@g@@e J@@=h @@g 7@S@@@6Kf @@g 3@L?e?J@@e N@)XeW&@@e 3@L?e?J@@e N@)XeW&@@e 3@L?e?J@@e N@)XeW&@@e @@(M?I'@@?e @@g @@H?eV'@Le @@g ?@@)KO&@@@e I4@@0Y@5e ?@@)KO&@@@e I4@@0Y@5e ?@@)KO&@@@e I4@@0Y@5e @@f?N@1e @@g ?J@He ?J@He ?J@He @@g@@e @@g W&5?e W&5?e W&5?e @@g@@e @@g ?W&(Y?e ?W&(Y?e ?W&(Y?e 3@L?e?J@5e @@g O&(Yf O&(Yf O&(Yf N@)XeW&@He ?@@?e @@g O2@0Y?f O2@0Y?f O2@0Y?f ?@@?e ?@@)KO&@@?e ?@@?e @@@@@@f ?@@0M?g ?@@0M?g ?@@0M?g ?@@?e I4@@0Mf W&g W2@@6Xf ?W&@g ?W&(MI')X?e W&@@g ?7@HeN@1?e .Y@@g J@5?e?3@Le @@g 7@H?e?N@1e @@g @@g@@e @@g @@g @@g@@e @@g@@e @@g @@g @@g@@e @@g@@e @@g @@g@@e @@g @@g 3@L?e?J@5e N@1?e?7@He @@g ?3@LeJ@5?e @@g ?V')KO&(Y?e @@@@@@f V4@@0Yf ?? ? ?? ? W&g ?O2@@@e W&f ? W2@@@@@(e ?W&@g ?W2@0Mf ?W&@f ? 7@@@@@0Ye W&@@g W&(Mg ?J@?h W&@@f ? .Y@@g ?W&(Y?g ?75?h ?W&@@@f ? @@g ?7@Hh J@Y?h W&(Y@@f ? @@g J@@=h ?@@?e? @@@@@6K?f ?W&(Y?@@f @@g W&(Ye@@f @@g 7@S@@@6Kf @@(M?I'@@?e ?@@?e?? I4@@@@f I'@@L?e?W&(Y?e@@f @@g ? ?V'@1?e @@g @@H?eV'@Le @@f?N@1e N@@?e?7@Yf@@f ?@@@@@@@@@@@e ?? @@g @@g@@e ?@@?e?@@@@@@@@@@@e @@g ?@5?e @@f ?? @@g @@g@@e 3@L?e?J@5e J@H?e @@f @@g N@)XeW&@He ?@6Xe?W&5f @@f ? @@g ?@@)KO&@@?e ?@@?e? ?3@)K?O&0Yf @@f @@@@@@f I4@@0Mf ?@@?e? ?V4@@@0Mg @@f ? ? ? ? ? ? ? W26Xf @@6Khe'6X?e 7 www.DataSheet4U.com Chapter 3 Port Functions 3-1 Overview ......................................................................................................................38 3-2 Port Control Registers ..................................................................................................41 3-2-1 Overview ........................................................................................................41 3-2-2 I/O Port Control Registers ..............................................................................45 3-3 I/O Port Configuration and Functions..........................................................................47 Chapter 4 Timer Functions 4-1 Overview ......................................................................................................................56 4-2 8-bit Timer Operation (timers 2, 3) ..............................................................................62 4-2-1 Overview ........................................................................................................62 4-2-2 Operation ........................................................................................................63 4-3 16-bit Timer Operation (timer 4)..................................................................................69 4-3-1 Overview ........................................................................................................69 4-3-2 Operation ........................................................................................................69 4-4 8-bit Timer Operation (timer 5)....................................................................................76 4-4-1 Overview ........................................................................................................76 4-4-2 Operation ........................................................................................................76 4-5 Time Base Operation....................................................................................................77 4-5-1 Overview ........................................................................................................77 4-5-2 Operation ........................................................................................................77 4-6 Watchdog Timer Operation ..........................................................................................78 4-6-1 Overview ........................................................................................................78 4-6-2 Setup and Operation .......................................................................................78 4-7 Remote Control Output Operation ...............................................................................79 4-7-1 Overview ........................................................................................................79 4-7-2 Setup and Operation .......................................................................................79 4-8 Buzzer Output ..............................................................................................................80 4-8-1 Buzzer Output Setup and Operation ...............................................................80 4-9 Timer Function Control Registers................................................................................81 4-9-1 Overview ........................................................................................................81 4-9-2 Programmable Timer/Counters ......................................................................82 4-9-3 Timer Mode Registers ....................................................................................85 4-9-4 Timer Control Registers .................................................................................89 Chapter 5 Serial Functions 5-1 Overview ......................................................................................................................92 5-2 Synchronous Serial Interface .......................................................................................94 5-2-1 Overview ........................................................................................................94 5-2-2 Setup and Operation .......................................................................................94 5-2-3 Serial Interface Transfer Timing.....................................................................99 5-3 Half-duplex UART Serial Interface ...........................................................................101 5-3-1 Overview ......................................................................................................101 5-3-2 Setup and Operation .....................................................................................101 5-3-3 How to Use the Baud Rate Timer.................................................................105 5-4 Serial Interface Control Registers ..............................................................................106 5-4-1 Overview ......................................................................................................106 5-4-2 Transmit/Receive Shift Registers, Receive Data Buffer ..............................107 5-4-3 Serial Interface Mode Registers ...................................................................108 5-4-4 Serial Interface Control Register ..................................................................112 Chapter 6 A/D Conversion Functions www.DataSheet4U.com 6-1 Overview ....................................................................................................................114 6-2 A/D Conversion..........................................................................................................115 6-3 A/D Converter Control Registers ...............................................................................117 6-3-1 Overview.......................................................................................................117 6-3-2 A/D Control Register (ANCTR)...................................................................118 6-3-3 A/D Buffers (ANBUF) .................................................................................120 Chapter 7 AC Zero-Cross Circuit/Noise Filter 7-1 Overview ....................................................................................................................122 7-2 AC Zero-Cross Circuit Operation ..............................................................................123 7-2-1 Setup and Operation .....................................................................................123 7-3 Noise Filter.................................................................................................................124 7-3-1 Overview ......................................................................................................124 7-3-2 Example Input and Output Waveforms for Noise Filter...............................125 7-4 AC Zero-Cross Control Register................................................................................126 7-4-1 Overview ......................................................................................................126 7-4-2 Noise Filter Control Register (NFCTR) .......................................................127 www.DataSheet4U.com Appendices 8-1 EPROM Versions .......................................................................................................130 8-1-1 Overview ......................................................................................................130 8-1-2 Cautions on Use............................................................................................131 8-1-3 Erasing Written Data in Windowed Packages ..............................................132 (PX-AP101C11-SDC, PX-AP101C11-FBC) 8-1-4 Characteristics of EPROM Versions.............................................................133 8-1-5 Writing to Internal EPROM..........................................................................134 8-1-6 Cautions on Handling the ROM Writer........................................................136 8-1-7 Option Bit .....................................................................................................137 8-1-8 Writing Adapter Connection.........................................................................138 8-2 Instruction Sets...........................................................................................................141 8-3 Instruction Maps.........................................................................................................147 8-4 Special Function Registers .........................................................................................149 www.DataSheet4U.com ?? @@@?he O26Xe @@Y?e?O26X?e @@@@@@@@@@@@@@@@@@@@@)e ?@@@@@@@@@@@@@@@@@@@)?e ?I'Xg@Xh @Khf?O26X?e N)X?e?J@@h @@@@@@@@@@@@@@@@@@)?e ?@)KeO&Y?eO26Xe @@ @@H?e @@@@@@@@@@@@@@@@@@@@@)e @@ @@f @@@@@@@@@@@@@@@@@@f @@@@@@@@@@@@@@g @@ @@he@@g @@f?@@@e@@@?g @@he@@g @@f?@@He@@Y?O)X?e @@@@@@@@@@@@@@g @@?@@@@@@?e@@@@@@)?e @@he@@g @@f?@@?e@@h @@he@@g @@f?@@?e@@eO)X?e @@@@@@@@@@@@@@g @@?@@@@@@?e@@@@@@)?e @0M?e@@e?I4@g ?J@5f?@@?e@@h @@gO26Xe ?7@Hf?@5?e@@h @@@@@@@@@@@@@@@@@@@@@)e ?@5?'@@@@@H?e@@eO26Xe @@hf ?@H?V+MW@5f@@@@@@@)e @@hf J5fW&(Yf@@h @@hf .Ye?O&0Y?f@@h @@hf @0M?g@@h W&g O2@@6Kf O2@@6Kf O2@@6Kf ?O2@@@e ?W&@g ?@@(MI'@@?e ?@@(MI'@@?e ?@@(MI'@@?e ?W2@0Mf W&@@g J@(YeV'@Le J@(YeV'@Le J@(YeV'@Le W&(Mg .Y@@g 7@H?e?N@1e 7@H?e?N@1e 7@H?e?N@1e ?W&(Y?g @@g @@g@@e @@g@@e @@g@@e ?7@Hh @@g @@g@@e @@g@@e @@g@@e J@@=h @@g 7@S@@@6Kf @@g 3@L?e?J@@e N@)XeW&@@e 3@L?e?J@@e N@)XeW&@@e 3@L?e?J@@e N@)XeW&@@e @@(M?I'@@?e @@g @@H?eV'@Le @@g ?@@)KO&@@@e I4@@0Y@5e ?@@)KO&@@@e I4@@0Y@5e ?@@)KO&@@@e I4@@0Y@5e @@f?N@1e @@g ?J@He ?J@He ?J@He @@g@@e @@g W&5?e W&5?e W&5?e @@g@@e @@g ?W&(Y?e ?W&(Y?e ?W&(Y?e 3@L?e?J@5e @@g O&(Yf O&(Yf O&(Yf N@)XeW&@He ?@@?e @@g O2@0Y?f O2@0Y?f O2@0Y?f ?@@?e ?@@)KO&@@?e ?@@?e @@@@@@f ?@@0M?g ?@@0M?g ?@@0M?g ?@@?e I4@@0Mf W&g W2@@6Xf ?W&@g ?W&(MI')X?e W&@@g ?7@HeN@1?e .Y@@g J@5?e?3@Le @@g 7@H?e?N@1e @@g @@g@@e @@g @@g @@g@@e @@g@@e @@g @@g @@g@@e @@g@@e @@g @@g@@e @@g @@g 3@L?e?J@5e N@1?e?7@He @@g ?3@LeJ@5?e @@g ?V')KO&(Y?e @@@@@@f V4@@0Yf ?? ? ?? ? W&g ?O2@@@e W&f ? W2@@@@@(e ?W&@g ?W2@0Mf ?W&@f ? 7@@@@@0Ye W&@@g W&(Mg ?J@?h W&@@f ? .Y@@g ?W&(Y?g ?75?h ?W&@@@f ? @@g ?7@Hh J@Y?h W&(Y@@f ? @@g J@@=h ?@@?e? @@@@@6K?f ?W&(Y?@@f @@g W&(Ye@@f @@g 7@S@@@6Kf @@(M?I'@@?e ?@@?e?? I4@@@@f I'@@L?e?W&(Y?e@@f @@g ? ?V'@1?e @@g @@H?eV'@Le @@f?N@1e N@@?e?7@Yf@@f ?@@@@@@@@@@@e ?? @@g @@g@@e ?@@?e?@@@@@@@@@@@e @@g ?@5?e @@f ?? @@g @@g@@e 3@L?e?J@5e J@H?e @@f @@g N@)XeW&@He ?@6Xe?W&5f @@f ? @@g ?@@)KO&@@?e ?@@?e? ?3@)K?O&0Yf @@f @@@@@@f I4@@0Mf ?@@?e? ?V4@@@0Mg @@f ? ? ? ? ? ? ? W26Xf @@6Khe'6X?e 7 Internal ROM2 16,384x8-bit*3 Internal RAM2 512x8-bit Machine Cycles: High speed mode 0.10s/20MHz (4.5V to 5.5V) 0.25s/8MHz(2.7V to 5.5V) 1.00s/2MHz(2.0V to 5.5V) Low speed mode 125s/32KHz(2.0V to 5.5V)*4 Interrupts: 12 interrupts(11 interrupts except for 48-pin QFH package) The active edge can be selected for all external interrupts IRQ0 External interrupt (can be connected to noise filter) 2 Differs depending upon the model. [ 1-1-2 "Product Summary"] *3 Bit 8 of the last address for the built-in ROM of MN101C11X is an optional bit; therefore, this cannot be used as an ordinary ROM. *4 Exclusive for a 48-pin QFH product. IRQ1 External interrupt (can determine zero crossings, can be connected to noise filter) IRQ2 External interrupt IRQ3 External interrupt *4 TM2IRQ Timer 2 (8-bit timer) TM3IRQ Timer 3 (8-bit timer) TM4IRQ Timer 4 (16-bit timer) TM5IRQ Timer 5 (8-bit timer) TBIRQ Clock timer interrupts SC0IRQ Serial 0 (synchronous + simple UART ADIRQ A/D conversion complete NMI Overflow of watchdog timer Timer/Counters:five timers, all can generate interrupts Timer 2 8-bit timer Square wave output, 8-bit PWM output are possible, Clock source: fs, fs/4, fx*4, TM2IO pin input Timer 3 8-bit timer Square wave output, synchronous serial/UART baud rate timer Clock source: fosc, fs/4, fs/16, TM3IO pin input Remote control carrier can be generated. Hardware Functions 3 Chapter 1 Overview Timers 2 and 3 can be cascaded. Timer 4 16-bit timer Square wave output, 16-bit PWM output are possible. Clock source: fosc, fs/4, fs/16, TM4IO pin input Input capture function Time base timer Clock source: fosc, fs/4, fx*4, fx/213*4 or fosc/213 XIOat 32kHz, can be set to measure one minute intervals*4 Can operate independently as timer 5 (8-bit timer). Watchdog timer Selected by the mask option as fs/216, fs/218, or fs/220 Remote control Based on the timer output, a remote control carrier with duty ratio carrier output: of 1/2, 1/3 can be output. Buzzer output: Output frequency can be selected from fs/29, fs/210, fs/211 or fs/212. Serial interface: Synchronous/ Simple UART (half-duplex) Transfer clock: fs/2, fs/4, fs/16, 1/2 of timer 3 output When using timer 3, the transfer rates for a 12MHz oscillation are 19200/9600/4800/2400/1200/300 bps. MSB or LSB can be selected as the first bit for transfer. An arbitrary transfer size of 1 to 8 bits can be selected. www.DataSheet4U.com A/D converter: 10 bits x 8 channels LED driver function:8 pins Ports: 5 26 ports for 44-QFP 27 ports for 48-QFH 6 12 ports for 48-QFH 7 4 ports for 48-QFH I/O ports 25 ports (8 have dual functions)*5 LED (large current) driver ports: 8 ports (push-pull configuration) Input ports 11 ports (all have dual functions) *6 Number of pins with dual function for external interrupts: 3*7 (One of which can also be used for zero-cross input.) Number of pins with dual function for A/D input: 8 Operation mode input pin: 1 Reset input pin: 1 Operation modes: NORMAL mode SLOW mode*4 HALT mode STOP mode and switches operating clock*4 Package: 4 Hardware Functions 42-SDIP, 44-QFP, 48-QFH 1-3 Pins 1-3-1 Pin Diagram 1 42 2 41 3 40 4 39 5 38 6 7 8 9 10 11 12 13 14 15 16 17 MN101C117/115 TXD,SBO0,P00 RXD,SBI0,P01 SBT0,P02 BUZZER, P06 RMOUT,P10 P11 TM2IO,P12 TM3IO,P13 TM4IO,P14 IRQ0,P20 IRQ1,P21 IRQ2,P22 P60 P61 P62 P63 P64 P65 P66 P67 NRST, P27 - www.DataSheet4U.com Chapter 1 Overview 37 36 35 34 33 32 31 30 29 28 27 26 18 25 19 24 20 23 21 22 VSS OSC1 OSC2 VDD PA7,AN7 PA6,AN6 PA5,AN5 PA4,AN4 PA3,AN3 PA2,AN2 PA1,AN1 PA0,AN0 P80,LED0 P81,LED1 P82,LED2 P83,LED3 P84,LED4 P85,LED5 P86,LED6 P87,LED7 MMOD Figure 1-3-1 Pin Diagram (42-SDIP: TOP VIEW) Pins 5 P84,LED4 P85,LED5 P86,LED6 P87,LED7 MMOD P27,NRST P70 P67 P66 P65 P64 Chapter 1 Overview LED3,P83 LED2,P82 LED1,P81 LED0,P80 AN0,PA0 AN1,PA1 AN2,PA2 AN3,PA3 AN4,PA4 AN5,PA5 AN6,PA6 MN101C117/115 P63 P62 P61 P60 P22,IRQ2 P21,IRQ1,SENS P20,IRQ0 P14,TM4IO P13,TM3IO P12,TM2IO P11 AN7,PA7 VDD OSC2 OSC1 VSS NC TXD,SBO0,P00 RXD,SBI0,P01 SBT0,P02 BUZZER, P06 RMOUT,P10 www.DataSheet4U.com 44 43 42 41 40 39 38 37 36 35 34 1 33 2 32 3 31 4 30 5 29 6 28 7 - 27 8 26 9 25 10 24 11 23 12 13 14 15 16 17 18 19 20 21 22 Figure 1-3-2 Pin Diagram (44-QFP: TOP VIEW) 6 Pins P84,LED4 P85,LED5 P86,LED6 P87,LED7 MMOD P27,NRST P71 P70 P67 P66 P65 P64 LED3,P83 LED2,P82 LED1,P81 LED0,P80 NC AN0,PA0 AN1,PA1 AN2,PA2 AN3,PA3 AN4,PA4 AN5,PA5 AN6,PA6 48 47 46 45 44 43 42 41 40 39 38 37 1 36 2 35 3 34 4 33 5 32 6 31 30 7 - 29 8 28 9 27 10 26 11 25 12 13 14 15 16 17 18 19 20 21 22 23 24 MN101C117/115 P63 P62 P61 P60 P23,IRQ3 P22,IRQ2 P21,IRQ1,SENS P20,IRQ0 P14,TM4IO P13,TM3IO P12,TM2IO P11 AN7,PA7 VDD OSC2 OSC1 VSS XI XO TXD,SBO0,P00 RXD,SBI0,P01 SBT0,P02 BUZZER,P06 RMOUT,P10 www.DataSheet4U.com Chapter 1 Overview Figure 1-3-3 Pin Diagram (48-QFH: TOP VIEW) Pins 7 Chapter 1 Overview 1-3-2 Pin Function Summary *The pin numbers in the list correspond to the QFH package(Refer to Figure 1-3-3 Pin connection.) Be careful when using SDIP and QFP packages. Table 1-3-1 Pin Function Summary (1/4) Pin No. Name Type Dual Function Function Description 17 14 VSS VDD - Power supply pins Apply 2.0V to 5.5V to VDD and 0V to VSS. 16 15 OSC1 OSC2 Input Output Clock input pin Clock output pin Connect these oscillation pins to ceramic or crystal oscillators for highspeed clock operation. If the clock is an external input, connect it to OSC1 and leave OSC2 open. The chip will not operate with an external clock when using either the STOP or SLOW modes. 18 XI Input Clock input pin 19 XO Output Clock output pin 43 RST I/O Connect these oscillation pins to ceramic or crystal oscillators for lowspeed clock operation. If the clock is an external input, connect it to XI and leave XO open. The chip will not operate with an external clock when using the STOP mode. If these pins are not used, connect XI to VSS and leave XO open. *42-SDIP and 44-QFP packages have no pins of this kind. This pin resets the chip when power is turned on, is allocated as P27 and contains an internal pull-up resistor (Typ. 35 k). Setting this pin low initializes, the internal state of the device is initialized. Thereafter, setting the input to an"H"level release the reset The hardware waits for the system clock to stabilize, and then processes the reset interrupt. Also, if "0" is written to P27 and the reset is initiated by software, a low level will be output. The output has an n-channel open-drain configuration. If a capacitor is to be inserted between RST and VDD, it is recommended that a discharge diode be placed between RST and VDD. 20 to 23 P00 to P02 I/O P06 www.DataSheet4U.com 8 Pins P27 Reset pin SBO0(TXD), I/O port 0 SBI0(RXD), SBT0, DK (BUZZER) 4-bit CMOS tri-state I/O port. Each bit can be set individually as either an input or output by the P0DIR register. A pull-up resistor for each bit can be selected individually by the P0PLU register. At reset, the input mode is selected and pull-up resistors are disabled (high impedance output). www.DataSheet4U.com Chapter 1 Overview Table 1-3-1 Pin Function Summary (2/4) Pin No. Name Type Dual Function Function I/O port 1 Description 24 to 28 P10 to P14 I/O RMOUT, TM2IO to TM4IO 29 to 32 P20 to P23 Input IRQ0, Input port 2 IRQ1(SENS), IRQ2 to 3 43 P27 Input RST 33 to 40 P60 to P67 I/O I/O port 6 8-bit CMOS tri-state I/O port. Each bit can be set individually as either an input or output by the P6DIR register. A pull-up resistor for each bit can be selected individually by the P6PLU register. At reset, the input mode is selected and pull-up resistors for P60 to P67 are disabled (high impedance output). 41 to 42 P70 to P71 I/O I/O port 7 2-bit CMOS tri-state I/O port. Each individual bit can be switched to an input or output by the P7DIR register. A pull-up or pull-down resistor for each bit can be selected individually by the P7PLUD register. However, pull-up and pull-down resistors cannot be mixed. At reset, the input mode is selected and pull-up resistors are disabled (high impedance output). P70 and P71 pins do not exist for 42-SDIP package. P71 pin does not exist for 44-QFP package, either. 1 to 4 45 to 48 P80 to P87 I/O LED0 to 7 I/O port 8 8-bit CMOS tri-state I/O port. Each individual bit can be switched to an input or output by the P8DIR register. A pull-up resistor for each bit can be selected individually by the P8PLU register. When configured as outputs, these pins can drive LED segments, directly. At reset, the input mode is selected and pull-up resistors for P80 to P87 are disabled (high impedance output). 6 to 13 PA0 to PA7 Input AN0 to AN7 Input port 2 Input port A 5-bit CMOS tri-state I/O port. Each bit can be set individually as either an input or output by theP1DIR register. A pull-up resistor for each bit can be selected individually by the P1PLU register. At reset, the input mode is selected and pull-up resistors are disabled (high impedance output). 4-bit input port. A pull-up resistor for each bit can be selected individually by the P2PLU register. At reset, the input mode is selected and pull-up resistors are disabled (high impedance output). P23 pin does not exist for 42-SDIP, 44-QFP packages. Port P27 has an n-channel open-drain configuration. When "0" is written and the reset is initiated by software, a low level will be output. 8-bit input port. A pull-up or pull-down resistor for each bit can be selected individually by the PAPLUD register. However, pull-up and pulldown resistors cannot be mixed. At reset, the PA0 to PA7 input mode is selected and pull-up resistors are disabled. Pins 9 Chapter 1 Overview Table 1-3-1 Pin Function Summary (3/4) Pin No. Name Type Dual Function 20 TXD Output SBO0(P00) 21 RXD Input SBI0(P01) 20 SBO0 Output 21 SBI0 Input 22 SBT0 I/O 22 Buzzer In the serial interface in UART mode, these pins are configured as the receive data input pin and transmit data output pin. A push-pull or n-channel open-drain configuration can be selected for TXD by the SC0MD1 register. Pull-up resistors can be selected by the P0PLU register. The TXD and RXD pins are also allocated as P00 and P01 respectively. When not used as serial/UART pins, these can be used as normal I/O pins. TXD(P00) Serial interface transmit data output pin Transmit data output pin for serial interfaces 0. The output configuration, either CMOS push-pull or n-channel open-drain, and pull-up resistors can be selected by the software. Set these pins to the output mode by the P0DIR register. SBO0 is allocated as P00. This may be used as normal I/O pin when the serial interface is not used. RXD(P01) Serial interface receive data input pin Receive data input pin for serial interfaces 0. Pull-up resistor can be selected by the P0PLU register. Set these pins to the input mode by the P0DIR register. SBI0 is allocated as P01. This can be used as normal I/O pin when the serial interface is not used. P02 Serial interface clock I/O pin Clock I/O pin for serial interface 0. The output configuration, either CMOS push-pull or n-channel open-drain output, can be selected by the software. The direction of SBT0 is selected by the P0DIR register in accordance with the communication mode. Pull-up resistors can be selected by the P0PLU register. SBT0 is allocated as P02. This can be used as normal I/O pin when the serial interface is not used. P06 24 RMOUT I/O P10 26 to 28 TM2IO to TM4IO I/O P12 to P14 10 Pins Description UART transmit data output pin UART receive data input pin www.DataSheet4U.com I/O Function Buzzer output Piezoelectric buzzer driver pin. The driving frequency can be selected in the range of fs/2 to fs/2 by the DLYCTR register. Select output mode by the P0DIR register and select buzzer output by the DLYCTR register. When not used for buzzer output, this pin can be used as a normal I/O pin. Remote control transmit signal output pin Output pin for remote control transmit signal with a carrier signal. Can be used as a normal I/O pin when remote control is not used. Timer I/O pins Event counter clock input pins, overflow pulse output pins and PWM signal output pins for timer 2 to 4. To use these pins as event clock inputs, configure them as inputs by the P1DIR register. For overflow pulse and PWM output, configure these pins as outputs by the P1DIR register. When the pins are used as inputs, pull-up resistors can be specified by the P1PLU register. When not used for timer I/O, these can be used as normal I/O pins. Chapter 1 Overview Table 1-3-1 Pin Function Summary (4/4) Pin No. Name Type Dual Function Function Description Test mode switch input pin This pin sets the test mode. Must be set to L. P20, P21(SENS), P22,P23 External interrupt input pins The valid edge for these external interrupt input pins can be selected with the IRQnICR registers. IRQ1 is an external interrupt pin that is able to determine AC zero crossings. It can also be used as a normal external interrupt. When IRQ0 to 3 are not used for interrupts, these can be used as normal I/O pins. AN0 to AN7 Input PA0 to PA7 Analog input pins Analog input pins for an 8-channel, 10-bit A/D converter. When not used for analog input, these pins can be used as normal I/O pins. SENS IRQ1(P21) SENS is an input pin for an AC zero-cross detection circuit. The AC zeroAC zero-cross detection input pin cross circuit outputs a high level when the input is at an intermediate level. It outputs a low level at all other times. SENS is connected to the P21 input circuit and the IRQ1 interrupt circuit. When the AC zero-cross detection circuit is not used, this pin can be used as a normal P21 input. The P21IM flag of the FLOAT1 register sets which input is selected. 44 MMOD Input 29 to 32 IRQ0 to IRQ3 Input 6 to 13 30 Input www.DataSheet4U.com Pins 11 Chapter 1 Overview 1-4 Overview of Functions RAM 512 bytes 8-bit timer 2 External interrupt 8-bit timer 3 Serial interface 0 16-bit timer 4 Time base timer 5 A/D conversion Watchdog timer Port 6 RST MMOD VSS VDD OSC2 OSC1 XO ROM 16 KB Port 7 Port 1 Port 2 CPU MN101C00 Port 8 www.DataSheet4U.com System clock oscillator Sub-clock oscillator Port A TXD,SBO0,P00 RXD,SBI0,P01 SBT0,P02 P06 RMOUT,P10 P11 TM2IO,P12 TM3IO,P13 TM4IO,P14 IRQ0,P20 SENS,IRQ1,P21 IRQ2,P22 IRQ3,P23 RST,P27 AN7,PA7 AN6,PA6 AN5,PA5 AN4,PA4 AN3,PA3 AN2,PA2 AN1,PA1 AN0,PA0 Port 0 XI 1-4-1 Block Diagram Figure 1-4-1 Block Diagram of Functions) 12 Overview of Function P60 P61 P62 P63 P64 P65 P66 P67 P70 P71 P80,LED0 P81,LED1 P82,LED2 P83,LED3 P84,LED4 P85,LED6 P86,LED6 P87,LED7 Chapter 1 Overview 1-5 Electrical Characteristics Contents Model MN101C117/115 Classification CMOS integrated circuit Use General purpose Function CMOS, 8-bit, single-chip microcomputer This LSI manual describes standard specifications. Before using the LSI, please obtain product specifications from the sales office. 1-5-1 Absolute Maximum Ratings Parameter Symbol 2 3 Rating Unit 1 Supply voltage VDD -0.3 to +7.0 V 2 Input clamp current (SENS) IC -500 to 500 A 3 Input pin voltage VI -0.3 to VDD+0.3 V 4 Output pin voltage VO -0.3 to VDD+0.3 V 5 I/O pin voltage VIO1 -0.3 to VDD+0.3 V www.DataSheet4U.com P8 I OL1 (peak) 30 Except P8 I OL2 (peak) 20 All pins I OH (peak) -10 I OL1 (avg) 20 Average output Other than P8 I OL2 (avg) current*1 15 I OH (avg) -5 6 7 Peak output current 8 9 10 P8 11 All pins mA 12 Tolerable loss PD 400 mW 13 Ambient operating temperature Topr -40 to 85 C 14 Storage temperature Tstg -55 to +125 C Note: 1 Applicable even for an interval of 100ms. Insert at least one bypass capacitor of 0.1 F or more between a power source pin and GND to prevent from latchup. *3 Absolute maximum ratings indicate the allowable limit to which applied voltage does not damage a chip, not guarantee the operation. *2 Electrical Characteristics 13 Chapter 1 Overview 1-5-2 Operating Conditions Ta=-40 to +85C VDD=2.0 to 5.5V VSS=0V Parameter Symbol Rating Conditions MIN TYP Unit MAX Supply voltage 1 VDD1 fosc 20.0MHz 4.5 5.5 2 VDD2 fosc 8.39MHz 2.7 5.5 VDD3 fosc 2.00MHz 2.0 5.5 fx = 32.768kHz 2.0 5.5 STOP mode 1.8 5.5 Supply voltage 3 during operation 4 VDD4 5 Voltage to maintain RAM data VDD5 Operating speed *1 V 2 6 7 tc1 VDD=4.5 to 5.5V 0.100 tc2 VDD=2.7 to 5.5V 0.238 VDD=2.0 to 5.5V 1.00 VDD=2.0 to 5.5V 40 125 VDD=4.5 to 5.5V 1.0 20.0 Instruction execution time 8 tc3 9 tc4 * 1 s Crystal oscillator 1 Fig. 1-5-1 10 Crystal frequency fxtal 1 11 C11 20 C12 20 www.DataSheet4U.com External capacitors 12 pF 13 Internal feedback resistor RF10 Crystal oscillator 2 Fig. 1-5-2* k 32.768 kHz fxtal 2 15 C21 20 C22 20 16 17 Internal feedback resistor RF20 Note: 700k Typ MN101C pF 4.0 M *1. Only for 48-QFH package 2 t c1, t c2, t c3: OSC1 is the CPU clock t c4: XI is the CPU clock OSC1 XI 4.0M Typ fxtal1 MN101C OSC2 C12 14 700 1 14 Crystal frequency External capacitors MHz C11 fxtal2 XO C22 C21 The instruction cycle is twice the clock cycle. The feedback resistor is built-in. The instruction cycle is four times the clock cycle. The feedback resistor is built-in. Figure 1-5-1 Crystal Oscillator 1 Figure 1-5-2 Crystal Oscillator 2 *1 Electrical Characteristics Chapter 1 Overview Parameter Symbol Rating Conditions MIN TYP Unit MAX External clock input 1 OSC1 (OSC2 is unconnected) 18 Clock frequency fOSC 19 High level pulse width twh 1 1 20 Low level pulse width twl 1 21 Rise time twr 1 1.0 20.0 20.0 30.0 20.0 30.0 Fig. 1-5-3 ns 5.0 Fig. 1-5-3 22 Fall time MHz ns twf 1 5.0 External clock input 2 XI (XO is unconnected)*2 23 Clock frequency 24 High level pulse width fx 32.768 twh 2 twl 2 26 Rise time twr 2 Fig. 1-5-4 s 3.5 20 Fig. 1-5-4 27 Fall time twf 2 kHz 3.5 1 25 Low level pulse width 100 ns 20 1 Set the clock duty ratio to 45 to 55%. *2 Applicable only for 48-pin QFH package www.DataSheet4U.com Electrical Characteristics 15 Chapter 1 Overview 0.9VDD 0.1VDD twh1 twr1 twl1 twf1 Figure 1-5-3 OSC1 Timing Chart www.DataSheet4U.com 0.9VDD 0.1VDD twh2 twr2 Figure 1-5-4 XI Timing Chart 16 Electrical Characteristics twl2 twf2 Chapter 1 Overview 1-5-3 DC Characteristics Ta=-40 to +85C VDD=2.0 to 5.5V VSS=0V Parameter Symbol Rating Conditions MIN Supply current (no load at output) 1 Supply current 2 during operation 3 4 Supply current during HALT mode 5 6 Supply current during STOP mode 7 Notes: 1 MAX 25 60 mA IDD2 IDD3 TYP 1 fosc=20.0MHz,VDD=5V IDD1 Unit fosc=8.39MHz,VDD=5V *2 IDD5 *2 10 25 fx =32.768kHz,VDD=3V 100 fx =32.768kHz,VDD=3V 8 Ta=25 ?W2@6X ?7, the MMOD pin is fixed at VSS, the input pins are www.DataSheet4U.com fixed at VDD, and a 20MHz (8.39MHz) square wave of amplitude VDD,VSS is input to the OSC1 pin. The supply current during operation, IDD3, is measured under the following conditions: After all I/O pins are set to input mode and the oscillation is set to , the MMOD pin is fixed at VSS, the input pins are fixed at VDD, and a 32.768kHz square wave of amplitude VDD,VSS 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 , the MMOD pin is fixed at VSS, the input pins are fixed at VDD, and an 32.768kHz square wave of amplitude VDD,VSS is input to the XI pin. The supply current during STOP mode IDD7(IDD8) is measured under the following conditions: After the oscillation mode is set to , the MMOD pin is fixed at VSS, the input pins are fixed at VDD, and the OSC1 and XI pins are *2 unconnected. The items IDD5(IDD6) and IDD7(IDD8) are applicable only for 48-pin QFH package. Electrical Characteristics 17 Chapter 1 Overview Ta=-40 to +85C VDD=2.0 to 5.5V VSS=0V Parameter Symbol Rating Conditions MIN TYP Unit MAX Input pin 1 MMOD 8 Input high voltage 1 VIH1 9 Input high voltage 2 VIH2 10 Input low voltage 1 VIL1 11 Input low voltage 2 VIL2 VDD=4.5 to 5.5V 12 Input leakage current ILK1 VIN = 0 to VDD VDD=4.5 to 5.5V 0.8VDD VDD V 0.7VDD VDD V 0 0.2VDD V 0 0.3VDD V 10 A Input pin 2 P20, P22~P23 (Schmitt trigger input) 13 Input high voltage VIH3 0.8VDD VDD V 14 Input low voltage VIL3 0 0.2VDD V 15 Input leakage current ILK3 VIN=0 to VDD 10 A IIH3 VDD=5V, VIN=1.5V Pull-up resistor ON -300 A 16 Input high current -30 -100 Input pin 3--1 P21 (Schmitt trigger input) 17 Input high voltage VIH4 0.8VDD VDD V 18 Input low voltage VIL4 0 0.2VDD V 19 Input leakage current ILK4 VIN=0 to VDD 10 A IIH4 VDD=5V, VIN=1.5V Pull-up resistor ON -300 A 20 Input high current www.DataSheet4U.com -30 -100 Input pin 3--2 P21 (when used as SENS) 21 Input high voltage 1 VDHH 22 Input low voltage 1 VDLH 23 Input high voltage 2 4.5 VDD VSS 3.5 VDHL 1.5 VDD 24 Input low voltage 2 VDLL VSS 0.5 25 Input leakage current ILK10 VIN=0V to VDD IC10 VDD=5.0V VIN>VDD, VIN<0V 26 Input clamp current 18 Electrical Characteristics VDD=5.0V Fig. 1-5-5 V V 10 A 400 Chapter 1 Overview SENS pin 27 trs Rise time 30 Fig. 1-5-5 28 tfs Fall time s 30 trs tfs VDD VDHH VDLH Input voltage level 1 (Input) VDHL VDLL VSS Input voltage level 2 (Output) www.DataSheet4U.com Figure 1-5-5 Operation of AC Zero-Cross Detection Circuit Ta=-40 to +85C VDD=2.0 to 5.5V VSS=0V Parameter Symbol Rating Conditions MIN TYP Unit MAX Input pin 4 PA0~PA7 29 Input high voltage 1 VIH5 30 Input high voltage 2 VIH6 31 Input low voltage 1 VIL5 32 Input low voltage 2 VIL6 VDD=4.5 to 5.5V 33 Input leakage current ILK5 VIN=0 to VDD 34 Input high current IIH5 VDD=5V, VIN=1.5V Pull-up resistor ON IIL5 VDD=5V, VIN=3.5V Pull-down resistor ON 35 Input low current VDD=4.5 to 5.5V 0.8VDD VDD V 0.7VDD VDD V 0 0.2VDD V 0 0.3VDD V 2 A -30 -100 -300 A 80 180 400 A Electrical Characteristics 19 Chapter 1 Overview Ta=-40 to +85C VDD=2.0 to 5.5V VSS=0V Parameter Symbol Rating Conditions MIN TYP Unit MAX I/O pin 5 P27 (RST) 36 Input high voltage VIH7 0.9VDD VDD V 37 Input low voltage VIL7 0 0.2VDD V 38 Input leakage current ILK7 VIN = 0 to VDD 10 A Iih VDD=5V, VIN=1.5V Pull-up resistor built in -300 A 39 Input high current -30 -100 I/O pin 6 P00 to P06, P10 to P14 (Schmitt trigger input) 40 Input high voltage VIH8 0.8VDD VDD V 41 Input low voltage VIL8 0 0.2VDD V 42 Input leakage current ILK8 VIN=0 to VDD 10 A 43 Input high current IIH8 VDD=5V, VIN=1.5V Pull-up resistor ON -300 A 44 Output high voltage VOH8 VDD = 5V, IOH = -0.5mA 45 Output low voltage VOL8 VDD = 5V, IOL = 1.0mA -30 -100 4.5 V 0.5 V 0.8VDD VDD V 0.7VDD VDD V 0 0.2VDD V 0 0.3VDD V 10 A -300 A I/O pin 7 , P60 to P67 46 Input high voltage 1 VIH9 47 Input high voltage 2 VIH10 48 Input low voltage 1 VIL9 49 Input low voltage 2 VIL10 50 Input leakage current ILK9 VIN=0 to VDD 51 Input high current IIH9 VDD=5V, VIN=1.5V Pull-up resistor ON 52 Output high voltage VOH9 VDD = 5V, IOH = -0.5mA 53 Output low voltage VOL9 VDD = 5V, IOL = 1.0mA www.DataSheet4U.com VDD=4.5 to 5.5V VDD=4.5 to 5.5V -30 -100 4.5 V 0.5 V 0.8VDD VDD V 0.7VDD VDD V 0 0.2VDD V 0 0.3VDD V 10 A I/O pin 8 P70 to P71 54 Input high voltage 1 VIH11 55 Input high voltage 2 VIH12 56 Input low voltage 1 VIL11 57 Input low voltage 2 VIL12 VDD=4.5 to 5.5V 58 Input leakage current ILK11 VIN = 0 to VDD 59 Input high current IIH11 VDD=5V, VIN=1.5V Pull-up resistor ON 60 Input low current IIL11 61 Output high voltage 62 Output low voltage 20 VDD=4.5 to 5.5V -30 -100 -300 A VDD=5V, VIN=3.5V Pull-down resistor ON 30 100 300 A VOH11 VDD = 5V, IOH = -0.5mA 4.5 VOL11 VDD = 5V, IOL = 1.0mA Electrical Characteristics V 0.5 V www.DataSheet4U.com Chapter 1 Overview Ta=-40 to +85C VDD=2.0 to 5.5V VSS=0V Parameter Symbol Rating Conditions MIN TYP Unit MAX I/O pin 9 P80~P87 63 Input high voltage 1 VIH13 64 Input high voltage 2 VIH14 65 Input low voltage 1 VIL113 66 Input low voltage 2 VIL14 VDD=4.5 to 5.5V 67 Input leakage current ILK13 VIN=0 to VDD 68 Input high current IIH13 VDD=5V, VIN=1.5V Pull-up resistor ON -30 69 Output high voltage VOH13 VDD = 5V, IOH = -0.5mA 4.5 70 Output low voltage VOL13 VDD = 5V, IOL = 15mA VDD=4.5 to 5.5V 0.8VDD VDD V 0.7VDD VDD V 0 0.2VDD V 0 0.3VDD V 10 A -300 A -100 V 1.0 V 1-5-4 A/D Converter Characteristics Ta=-40 to+85C VDD=2.0 to 5.5V VSS=0V Rating Parameter Symbol Conditions Unit MIN 1 Resolution 2 Nonlinear error 1 3 Differential linear error 1 4 Nonlinear error 2 5 Differential linear error 2 6 Zero traction voltage 7 Full-scale transition voltage 8 9 11 Bits VDD = 5.0V, VSS = 0V VREF+=5.0V, VREF-=0V TAD = 800ns 3 LSB 3 LSB VDD = 5.0V, VSS = 0V VREF-=5.0V, VREF-=0V fx = 32.768kHz 5 LSB 5 LSB 30 100 mV 30 100 mV VDD = 5.0V, VSS = 0V VREF+=5.0V, VREF-=0V TAD = 800ns Sampling time 12 Analog input leakage current 9.6 s fx = 32.768kHz fOSC = 8MHz 10 MAX 10 TAD = 800ns A/D conversion time TYP fx = 32.768kHz When VDAIN = 0 to 5V is off 1.0 183 s 36 s 30.5 s 2 A Electrical Characteristics 21 Chapter 1 Overview 1-6 Option 1-6-1 ROM Option The product equipped with this LSI or an EPROM with this LSI controls the oscillation mode after resetting as well as the runaway-detection watchdog timer, using bits 2 to 0 of the last address of the built-in ROM. Option bits 7 - 6 - 5 4 - PKG SEL2 3 2 1 0 PKG WDSEL2 WDSEL1 NSSTRT SEL1 Selection of oscillation mode after resetting NSSTRT 0 SLOW mode 1 NORMAL mode www.DataSheet4U.com WDSEL2 WDSEL1 Watchdog timer cycle setting 0 1 0 fs/2 16 1 fs/2 18 fs/2 20 PKGSEL2 PKGSEL1 0 1 SDIP042-P-0600 0 QFP044-P-1010 QFH048-P-0707 1 Figure 1-6 ROM Option ( Address:X'7FFF' ) 22 Option Packages www.DataSheet4U.com Chapter 1 Overview 1-6-2 Option Form Date: SE No. Model Name MN101C Customer Approval 1. Oscillation mode Type A Type B Note: Type A: Operation begins from the reset cycle in the NORMAL mode. Type B: Operation begins from the reset cycle in the SLOW mode. 2. Watchdog timer period setting Detection Period 16 Selection 3. Package selection Package fs/2 SDIP042-P-0600 fs/218 QFP044-P-1010 20 fs/2 Selection QFH048-P-0707 Not used Contents of mask option are subject to change. When placing an order for masks, please request the most recent option list from the sales office. Option of this product is used a part of the built-in ROM. When placing an order for programme, please sed data on the address of the option. Chapter 1 Overview 23 Chapter 1 Overview 1-7 Outline Drawings Package code: SDIP042-P-0600 Unit: mm www.DataSheet4U.com Body Material: Epoxy Resin Lead Material:Fe Ni Lead Finish Method:Soldering dip Figure 1-7-1 42-SDIP The external dimensions of the package are subject to change. Before using this product, please obtain product specifications from the sales office. 24 External Dimensions Chapter 1 Overview Package code: QFP044-P-1010 Unit: mm www.DataSheet4U.com Body Material: Epoxy Resin Lead Material:Fe Ni Lead Finish Method:Soldering dip Figure 1-7-2 44-QFP The external dimensions of the package are subject to change. Before using this product, please obtain product specifications from the sales office. External Dimensions) 25 Chapter 1 Overview Package code: QFH048-P-0707 Unit: mm www.DataSheet4U.com Material: Epoxy Resin Lead Material:Fe Ni-42 Alloy Lead Finish Method:Soldering dip Figure 1-7-3 48-QFH The external dimensions of the package are subject to change. Before using this product, please obtain product specifications from the sales office. 26 External Dimensions ?? @@@?he O26Xe @@Y?e?O26X?e @@@@@@@@@@@@@@@@@@@@@)e ?@@@@@@@@@@@@@@@@@@@)?e ?I'Xg@Xh @Khf?O26X?e N)X?e?J@@h @@@@@@@@@@@@@@@@@@)?e ?@)KeO&Y?eO26Xe @@ @@H?e @@@@@@@@@@@@@@@@@@@@@)e @@ @@f @@@@@@@@@@@@@@@@@@f @@@@@@@@@@@@@@g @@ @@he@@g @@f?@@@e@@@?g @@he@@g @@f?@@He@@Y?O)X?e @@@@@@@@@@@@@@g @@?@@@@@@?e@@@@@@)?e @@he@@g @@f?@@?e@@h @@he@@g @@f?@@?e@@eO)X?e @@@@@@@@@@@@@@g @@?@@@@@@?e@@@@@@)?e @0M?e@@e?I4@g ?J@5f?@@?e@@h @@gO26Xe ?7@Hf?@5?e@@h @@@@@@@@@@@@@@@@@@@@@)e ?@5?'@@@@@H?e@@eO26Xe @@hf ?@H?V+MW@5f@@@@@@@)e @@hf J5fW&(Yf@@h @@hf .Ye?O&0Y?f@@h @@hf @0M?g@@h W&g O2@@6Kf O2@@6Kf O2@@6Kf ?O2@@@e ?W&@g ?@@(MI'@@?e ?@@(MI'@@?e ?@@(MI'@@?e ?W2@0Mf W&@@g J@(YeV'@Le J@(YeV'@Le J@(YeV'@Le W&(Mg .Y@@g 7@H?e?N@1e 7@H?e?N@1e 7@H?e?N@1e ?W&(Y?g @@g @@g@@e @@g@@e @@g@@e ?7@Hh @@g @@g@@e @@g@@e @@g@@e J@@=h @@g 7@S@@@6Kf @@g 3@L?e?J@@e N@)XeW&@@e 3@L?e?J@@e N@)XeW&@@e 3@L?e?J@@e N@)XeW&@@e @@(M?I'@@?e @@g @@H?eV'@Le @@g ?@@)KO&@@@e I4@@0Y@5e ?@@)KO&@@@e I4@@0Y@5e ?@@)KO&@@@e I4@@0Y@5e @@f?N@1e @@g ?J@He ?J@He ?J@He @@g@@e @@g W&5?e W&5?e W&5?e @@g@@e @@g ?W&(Y?e ?W&(Y?e ?W&(Y?e 3@L?e?J@5e @@g O&(Yf O&(Yf O&(Yf N@)XeW&@He ?@@?e @@g O2@0Y?f O2@0Y?f O2@0Y?f ?@@?e ?@@)KO&@@?e ?@@?e @@@@@@f ?@@0M?g ?@@0M?g ?@@0M?g ?@@?e I4@@0Mf W&g W2@@6Xf ?W&@g ?W&(MI')X?e W&@@g ?7@HeN@1?e .Y@@g J@5?e?3@Le @@g 7@H?e?N@1e @@g @@g@@e @@g @@g @@g@@e @@g@@e @@g @@g @@g@@e @@g@@e @@g @@g@@e @@g @@g 3@L?e?J@5e N@1?e?7@He @@g ?3@LeJ@5?e @@g ?V')KO&(Y?e @@@@@@f V4@@0Yf ?? ? ?? ? W&g ?O2@@@e W&f ? W2@@@@@(e ?W&@g ?W2@0Mf ?W&@f ? 7@@@@@0Ye W&@@g W&(Mg ?J@?h W&@@f ? .Y@@g ?W&(Y?g ?75?h ?W&@@@f ? @@g ?7@Hh J@Y?h W&(Y@@f ? @@g J@@=h ?@@?e? @@@@@6K?f ?W&(Y?@@f @@g W&(Ye@@f @@g 7@S@@@6Kf @@(M?I'@@?e ?@@?e?? I4@@@@f I'@@L?e?W&(Y?e@@f @@g ? ?V'@1?e @@g @@H?eV'@Le @@f?N@1e N@@?e?7@Yf@@f ?@@@@@@@@@@@e ?? @@g @@g@@e ?@@?e?@@@@@@@@@@@e @@g ?@5?e @@f ?? @@g @@g@@e 3@L?e?J@5e J@H?e @@f @@g N@)XeW&@He ?@6Xe?W&5f @@f ? @@g ?@@)KO&@@?e ?@@?e? ?3@)K?O&0Yf @@f @@@@@@f I4@@0Mf ?@@?e? ?V4@@@0Mg @@f ? ? ? ? ? ? ? W26Xf @@6Khe'6X?e 7 [WDEN clear period] x 4 When software resetting is not triggered by WDT interrupt, hardware resetting (low level output at the reset terminal) takes place at the next WDT interrupt. 78 Watchdog Timer Operation www.DataSheet4U.com Chapter 4 Timer Functions 4-7 Remote Control Output Operation 4-7-1 Overview A remote control carrier pulse can be generated using the overflow of timer 3. Two duty ratios of 1/2 or 1/3 can be selected. 4-7-2 Setup and Operation (1) (2) (3) (4) (5) Set the RMOEN flag of the remote control carrier output control register (RMCTR)to "0" so that the remote control carrier output is switched off. Set timer 3 to select the base period of the remote control carrier (the width that the remote control carrier output pulse is held at a high level). Set the RMDTY0 flag of the RMCTR register to select the carrier duty. Set the P10 output data to "0" and set P10 to the output mode. And select the remote control carrier output by setting the TMORM flag of the RMCTR register to "0". The RMOEN flag of the RMCTR register controls whether the remote control carrier output is on or off. Even if the carrier output is at a high level, and the RMOEN flag is set to "0" (off), the carrier waveform will be maintained by the synchronous circuit Set bit 0 of the P1OMD register to "1" at the same time the remote control output is switched on, and to "0" at the same time the remote control output is switched off. Base period set by TM3 RMOEN Output on Output off RMOUT (1/3 duty) Figure 4-7-1 Remote Control Carrier Output Waveform Remote Control Output Operation 79 Chapter 4 Timer Functions 4-8 Buzzer Output 4-8-1 Buzzer Output Setup and Operation The square wave having a frequency 1/29 to 1/212 of the system clock can be output from the P06/BUZZER pin. (1) (2) (3) (4) www.DataSheet4U.com 80 Buzzer Output Set the BUZOE flag of the oscillation stabilization wait control register (DLYCTR) to "0" so that the buzzer output is turned off. Set the buzzer output frequency with the BUZCK1 and BUZCK0 flags of the DLYCTR. Set the BUZOE flag of the DLYCTR register to "1" and set P06 to the buzzer output mode. The BUZOE flag of the DLYCTR register controls whether the buzzer output is ON or OFF. www.DataSheet4U.com Chapter 4 Timer Functions 4-9 Timer Function Control Registers 4-9-1 Overview 19 registers control the timers. See table 4-9-1. Table 4-9-1 Timer Control Registers Name Address R/W Function TM2OC X'03F72' R/W TM2BC X'03F62' R TM2MD X'03F82' R/W Timer 2 mode register TM3OC X'03F73' R/W Compare register 3 Compare register 2 Binary counter 2 TM3BC X'03F63' R TM3MD X'03F83' R/W Binary counter 3 Timer 3 mode register TM4OCL X'03F74' R/W Compare register 4 (lower 8 bits) TM4OCH X'03F75' R/W Compare register 4 (upper 8 bits) TM4BCL X'03F64' R Binary counter 4 (lower 8 bits) TM4BCH X'03F65' R Binary counter 4 (upper 8 bits) TM4ICL X'03F66' R Input capture register (lower 8 bits) TM4ICH X'03F67' R Input capture register (upper 8 bits) TM4MD X'03F84' R/W Timer 4 mode register TM5OC X'03F78' R/W Compare register 5 TM5BC X'03F68' R Binary counter 5 TM5MD X'03F88' R/W Timer 5 mode register WDCTR X'03F02' R/W Watchdog timer control register DLYCTR X'03F03' R/W Oscillation stabilization wait control register RMCTR X'03F89' R/W Remote control carrier output control register R/W: Readable and writable R: Read only Overview 81 Chapter 4 Timer Functions 4-9-2 Programmable Timer/Counters Timers 2~5 all contain a programmable 8-bit timer/counter (16-bit in timer 4). Programmable timer/counters consist of a compare register and a binary counter. (1) Compare register 2 (TM2OC) 7 6 5 4 3 2 1 0 TM2OC7 TM2OC6 TM2OC5 TM2OC4 TM2OC3 TM2OC2 TM2OC1 TM2OC0 (at reset: undefined) Figure 4-9-1 Compare Register 2 (TM2OC: X'03F72', R/W) (2) Binary counter 2 (TM2BC) 7 6 5 4 3 2 1 0 TM2BC7 TM2BC6 TM2BC5 TM2BC4 TM2BC3 TM2BC2 TM2BC1 TM2BC0 (at reset: 00000000) www.DataSheet4U.com Figure 4-9-2 Binary Counter 2 (TM2BC: X'03F62', R) (3) Compare register 3 (TM3OC) 7 6 5 4 3 2 1 0 TM3OC7 TM3OC6 TM3OC5 TM3OC4 TM3OC3 TM3OC2 TM3OC1 TM3OC0 (at reset: undefined) Figure 4-9-3 Compare Register 3 (TM3OC: X'03F73', R/W) (4) Binary counter 3 (TM3BC) 7 6 5 4 3 2 1 0 TM3BC7 TM3BC6 TM3BC5 TM3BC4 TM3BC3 TM3BC2 TM3BC1 TM3BC0 (at reset: 00000000) Figure 4-9-4 Binary Counter 3 (TM3BC: X'03F63', R) 82 Timer Function Control Registers Chapter 4 Timer Functions (5) Compare register 4 (TM4OCL) (lower 8 bits) 7 6 5 4 3 2 1 0 TM4OCL7 TM4OCL6 TM4OCL5 TM4OCL4 TM4OCL3 TM4OCL2 TM4OCL1 TM4OCL0 (at reset: undefined) Figure 4-9-5 Compare Register 4 (TM4OCL: X'03F74', R/W) (6) Compare register 4 (TM4OCH) (upper 8 bits) 7 6 5 4 3 2 1 0 TM4OCH7 TM4OCH6 TM4OCH5 TM4OCH4 TM4OCH3 TM4OCH2TM4OCH1 TM4OCH0 (at reset: undefined) Figure 4-9-6 Compare Register 4 (TM4OCH: X'03F75', R/W) (7) Binary counter 4 (TM4BCL) (lower 8 bits) 7 6 5 4 3 2 1 0 TM4BCL7 TM4BCL6 TM4BCL5 TM4BCL4 TM4BCL3 TM4BCL2 TM4BCL1 TM4BCL0 (at reset: 00000000) www.DataSheet4U.com Figure 4-9-7 Binary Counter 4 (TM4BCL: X'03F64', R) (8) Binary counter 4 (TM4BCH) (upper 8 bits) 7 6 5 4 3 2 1 0 TM4BCH7 TM4BCH6 TM4BCH5 TM4BCH4 TM4BCH3 TM4BCH2 TM4BCH1 TM4BCH0 (at reset: 00000000) Figure 4-9-8 Binary Counter 4 (TM4BCH: X'03F65', R) Timer Function Control Registers 83 Chapter 4 Timer Functions (9) Input capture register (TM4ICL) (lower 8 bits) 7 6 5 4 3 2 1 0 TM4ICL7 TM4ICL6 TM4ICL5 TM4ICL4 TM4ICL3 TM4ICL2 TM4ICL1 TM4ICL0 (at reset: undefined) Figure 4-9-9 Input Capture Register (TM4ICL: X'03F66', R) (10) Input capture register (TM4ICH) (upper 8 bits) 7 6 5 4 3 2 1 0 TM4ICH7 TM4ICH6 TM4ICH5 TM4ICH4 TM4ICH3 TM4ICH2 TM4ICH1 TM4ICH0 (at reset: undefined) Figure 4-9-10 Input Capture Register (TM4ICH: X'03F67', R) (11) Compare register 5 (TM5OC) 7 6 5 4 3 2 1 0 TM5OC7 TM5OC6 TM5OC5 TM5OC4 TM5OC3 TM5OC2 TM5OC1 TM5OC0 (at reset: undefined) www.DataSheet4U.com Figure 4-9-11 Compare Register 5 (TM5OC: X'03F78', R/W) (12) Binary counter 5 (TM5BC) 7 6 5 4 3 2 1 0 TM5BC7 TM5BC6 TM5BC5 TM5BC4 TM5BC3 TM5BC2 TM5BC1 TM5BC0 (at reset: 00000000) Figure 4-9-12 Binary Counter 5 (TM5BC: X'03F68', R) 84 Timer Function Control Registers www.DataSheet4U.com Chapter 4 Timer Functions 4-9-3 Timer Mode Registers Four readable and writable 6-byte timer mode registers. Control timers 2, 3, 4, 5, and the time base. (1) Timer 2 mode register (TM2MD) TM2MD 7 6 5 4 - - - TM2EN 3 2 1 0 (at reset: ---00XXX) TM2PWM TM2CK2 TM2CK1 TM2CK0 TM2CK2 TM2CK1 TM2CK0 X 0 0 1 1 1 Clock source selection 0 fs 1 fs/4 0 fx * 1 TM2IO input 0 Synchronous fx * 1 Synchronous TM2IO input * 48QFH package only TM2PWM TM2 operation mode selection 0 Normal timer operation 1 PWM operation TM2EN TM2 count control 0 Halt the count 1 Operate the count Figure 4-9-13 Timer 2 Mode Register (TM2MD: X'03F82', R/W) Timer Function Control Registers 85 Chapter 4 Timer Functions (2) Timer 3 mode register (TM3MD) TM3MD 7 6 5 - - - 4 3 2 TM3EN TM3PWM TM3CK2 1 0 TM3CK1 TM3CK0 (at reset: ---00XXX) TM3CK2 TM3CK1 fosc 1 fs/4 0 fs/16 1 TM3IO input 0 x Cascade connection with timer 2 1 1 Synchronous TM3IO input 0 1 TM3PWM P13 output selection during TM2 PWM operation 0 Timer 3 output 1 Timer 2 PWM output TM3EN www.DataSheet4U.com Clock source selection 0 0 1 TM3CK0 TM3 count control 0 Halt the count 1 Operate the count Figure 4-9-14 Timer 3 Mode Register (TM3MD: X'03F83', R/W) 86 Timer Function Control Registers Chapter 4 Timer Functions (3) Timer 4 mode register (TM4MD) TM4MD 7 6 - TM4EN 5 4 TM4PWM T4ICTS1 3 2 1 0 T4ICTS0 TM4CK2 TM4CK1 TM4CK0 (at reset: -0000XXX) TM4CK2 TM4CK1 0 0 1 TM4CK0 Clock source selection 0 fosc 1 fs/4 0 fs/16 1 1 TM4IO input Synchronous TM4IO input 1 1 T4ICTS1 T4ICTS0 TM4 input capture trigger selection 0 Disable input capture operation 1 IRQ0 0 IRQ1 1 IRQ2 0 1 TM4PWM TM4 operation mode selection www.DataSheet4U.com 0 16-bit timer operation 1 PWM operation TM4EN TM4 count control 0 Halt the count 1 Operate the count Figure 4-9-15 Timer 4 Mode Register (TM4MD: X'03F84', R/W) Timer Function Control Registers 87 Chapter 4 Timer Functions (4) Timer 5 mode register (TM5MD) 7 TM5MD 6 TM5CLRS TM5IR2 5 4 3 2 1 0 TM5IR1 TM5IR0 TM5CK3 TM5CK2 TM5CK1 TM5CK0 (at reset: 0XXXXXX0) TM5CK0 Time base timer clock source selection 0 fosc 1 (Use Prohibited) fx * * 48QFH package only TM5CK3 TM5CK2 X 0 0 1 1 TM5IR2 TM5IR1 www.DataSheet4U.com 0 0 1 1 x TM5CK1 Timer 5 clock source selection 0 fosc 1 fs/4 0 (Use Prohibited) 1 0 Output of time base timer (Use Prohibited) 1 Synchronous time base timer output Time base timer TM5IR0 interrupt period selection 0 1/27 of the clock source 1 1/28 of the clock source 0 1 1/29 of the clock source 1/210 of the clock source x 1/213 of the clock source TM5CLRS Binary counter 5 clear selection flag 0 Enable initialization of TM5BC during a write to TM5OC 1 Disable initialization of TM5BC during a write to TM5OC If TM5CLRS=0, TM5IRQ is disabled. Figure 4-9-16 Timer 5 Mode Register (TM5MD: X'03F88', R/W) 88 Timer Function Control Registers www.DataSheet4U.com Chapter 4 Timer Functions 4-9-4 Timer Control Registers (1) Watchdog timer control register (WDCTR) WDCTR 7 6 5 4 3 2 1 0 - - - - - - - WDEN (at reset: -------0) WDEN Watchdog timer enable 0 Clear watchdog timer/disable operation 1 Enable WDT timer Figure 4-9-17 Watchdog Timer Control Register (WDCTR: X'03F02', R/W) (2) Oscillation stabilization wait control register (DLYCTR) 7 DLYCTR 6 5 BUZOE BUZCK1 BUZCK0 4 3 2 - - - 1 0 DLYS1 DLYS0 (at reset: 0XX---00) DLYS1 DLYS0 Oscillation stabilization wait period setting 0 1/214 of the system clock (fs) 1 1/210 of the system clock (fs) 1 0 1/26 of the system clock (fs) 1 1 Disable use 0 After reset is released, the oscillation stabilization wait period is fixed at 1/215. BUZCK1 BUZCK0 0 1 Buzzer output frequency selection 0 1/212 of the system clock (fs) 1 1/211 of the system clock (fs) 0 1/210 of the system clock (fs) 1 1/29 of the system clock (fs) BUZOE P06 output selection 0 P06 port output 1 P06 buzzer output Figure 4-9-18 Oscillation Stabilization Wait Counter Control Register (DLYCTR: X'03F03', R/W) Timer Function Control Registers 89 Chapter 4 Timer Functions (3) Remote control carrier output control register (RMCTR) RMCTR 7 6 5 4 3 2 1 0 - - - - RMOEN - RMDTY0 - (at reset: ---00XX0) Must be set to "0." Remote control carrier output duty selection RMDTY0 0 1/2 duty 1 1/3 duty Must be set to "0." RMOEN Enable remote control carrier output 0 Output low level 1 Output remote control carrier Must be set to "0." Figure 4-9-19 Remote Control Carrier Control Register (RMCTR: X'03F89', R/W) www.DataSheet4U.com 90 Timer Function Control Registers ?? @@@?he O26Xe @@Y?e?O26X?e @@@@@@@@@@@@@@@@@@@@@)e ?@@@@@@@@@@@@@@@@@@@)?e ?I'Xg@Xh @Khf?O26X?e N)X?e?J@@h @@@@@@@@@@@@@@@@@@)?e ?@)KeO&Y?eO26Xe @@ @@H?e @@@@@@@@@@@@@@@@@@@@@)e @@ @@f @@@@@@@@@@@@@@@@@@f @@@@@@@@@@@@@@g @@ @@he@@g @@f?@@@e@@@?g @@he@@g @@f?@@He@@Y?O)X?e @@@@@@@@@@@@@@g @@?@@@@@@?e@@@@@@)?e @@he@@g @@f?@@?e@@h @@he@@g @@f?@@?e@@eO)X?e @@@@@@@@@@@@@@g @@?@@@@@@?e@@@@@@)?e @0M?e@@e?I4@g ?J@5f?@@?e@@h @@gO26Xe ?7@Hf?@5?e@@h @@@@@@@@@@@@@@@@@@@@@)e ?@5?'@@@@@H?e@@eO26Xe @@hf ?@H?V+MW@5f@@@@@@@)e @@hf J5fW&(Yf@@h @@hf .Ye?O&0Y?f@@h @@hf @0M?g@@h W&g O2@@6Kf O2@@6Kf O2@@6Kf ?O2@@@e ?W&@g ?@@(MI'@@?e ?@@(MI'@@?e ?@@(MI'@@?e ?W2@0Mf W&@@g J@(YeV'@Le J@(YeV'@Le J@(YeV'@Le W&(Mg .Y@@g 7@H?e?N@1e 7@H?e?N@1e 7@H?e?N@1e ?W&(Y?g @@g @@g@@e @@g@@e @@g@@e ?7@Hh @@g @@g@@e @@g@@e @@g@@e J@@=h @@g 7@S@@@6Kf @@g 3@L?e?J@@e N@)XeW&@@e 3@L?e?J@@e N@)XeW&@@e 3@L?e?J@@e N@)XeW&@@e @@(M?I'@@?e @@g @@H?eV'@Le @@g ?@@)KO&@@@e I4@@0Y@5e ?@@)KO&@@@e I4@@0Y@5e ?@@)KO&@@@e I4@@0Y@5e @@f?N@1e @@g ?J@He ?J@He ?J@He @@g@@e @@g W&5?e W&5?e W&5?e @@g@@e @@g ?W&(Y?e ?W&(Y?e ?W&(Y?e 3@L?e?J@5e @@g O&(Yf O&(Yf O&(Yf N@)XeW&@He ?@@?e @@g O2@0Y?f O2@0Y?f O2@0Y?f ?@@?e ?@@)KO&@@?e ?@@?e @@@@@@f ?@@0M?g ?@@0M?g ?@@0M?g ?@@?e I4@@0Mf W&g ?O2@@@e ?W&@g ?W2@0Mf W&@@g W&(Mg .Y@@g ?W&(Y?g @@g ?7@Hh @@g J@@=h @@g @@g 7@S@@@6Kf @@(M?I'@@?e @@g @@g @@H?eV'@Le @@f?N@1e @@g @@g@@e @@g @@g @@g@@e 3@L?e?J@5e @@g N@)XeW&@He @@g ?@@)KO&@@?e @@@@@@f I4@@0Mf www.DataSheet4U.com ?? ? ?? ? W&g O2@6X?f ? O2@6X?f ?W&@g W2@@@@)Xf W2@@@@)Xf ? W&@@g 7(M?I'@1f 7(M?I'@1f ? .Y@@g (Ye?N@@f (Ye?N@@f ? ?J@5f @@g ?J@5f @@g W&(Yf ?@@?e?? W&(Yf @@g ?W&@g @@g ?&@@)Xf ?@@?e?? ?W&@g ?&@@)Xf @@g ?I')X?e ? ?I')X?e @@g N@1?e N@1?e ?? @@g ?@@?e ?@@?e @@g ?@@?e ?@@?e ?? @@g ?@5?e ?@5?e @@g @6X?eJ@H?e @6X?eJ@H?e ? @@g 3@)K?O&@f ?@@?e? 3@)K?O&@f @@@@@@f V4@@@0M?f ?@@?e? V4@@@0M?f ? ? ? ? ? ? ? W&g ?W&@g W&@@g .Y@@g @@g @@g @@g @@g @@g @@g @@g @@g @@g @@g @@g @@@@@@f W26Xf @@6Khe'6X?e 7 MOV (d16,An),Dm mem8(d16+An)Dm - - - - 7 4 0010 0110 1ADm MOV (d8,SP),Dm mem8(d8+SP)Dm - - - - 5 3 0010 0110 01Dm MOV (d16,SP),Dm mem8(d16+SP)Dm - - - - 7 4 0010 0110 00Dm MOV (abs8),Dm mem8(abs8)Dm - - - - 4 2 0100 01Dm MOV (abs12),Dm mem8(abs12)Dm - - - - 5 2 0100 00Dm MOV (abs16),Dm mem8(abs16)Dm - - - - 7 4 0010 1100 00Dm MOV Dn,(d16,Am) Dnmem8(d16+Am) - - - - 7 4 0010 0111 1aDn MOV Dn,(d8,SP) Dnmem8(d8+SP) - - - - 5 3 0010 0111 01Dn MOV Dn,(d16,SP) Dnmem8(d16+SP) - - - - 7 4 0010 0111 00Dn MOV Dn,(abs8) Dnmem8(abs8) - - - - 4 2 0101 01Dn MOV Dn,(abs12) Dnmem8(abs12) - - - - 5 2 0101 00Dn MOV Dn,(abs16) Dnmem8(abs16) - - - - 7 4 0010 1101 00Dn 36 MOV imm8,(io8) imm8mem8(IOTOP+io8) - - - - 6 3 0000 0010 37 MOV imm8,(abs8) imm8mem8(abs8) - - - - 6 3 0001 0100 <#8. ...> MOV imm8,(abs12) imm8mem8(abs12) - - - - 7 3 0001 0101 <#8. ...> MOV imm8,(abs16) imm8mem8(abs16) - - - - 9 5 0011 1101 1001 <#8. MOV Dn,(HA) Dnmem8(HA) - - - - 2 2 1101 00Dn MOVW (An),DWm mem16(An)DWm - - - - 2 3 1110 00Ad MOVW (An),Am mem16(An)Am - - - - 3 4 0010 1110 10Aa MOVW (d4,SP),DWm mem16(d4+SP)DWm - - - - 3 3 MOVW (d4,SP),Am mem16(d4+SP)Am - - - - 3 MOVW (d8,SP),DWm mem16(d8+SP)DWm - - - - MOVW (d8,SP),Am mem16(d8+SP)Am - - - MOVW (d16,SP),DWm mem16(d16+SP)DWm - - MOVW (d16,SP),Am mem16(d16+SP)Am - MOVW (abs8),DWm mem16(abs8)DWm MOVW (abs8),Am 25 ...> 27 1 .... .... 27 28 ...> 2 28 3 29 29 ...> 30 30 31 31 ...> 32 ...> 1 .... .... 32 33 ...> 2 33 3 34 34 ...> 35 35 36 37 38 38 ...> 39 40 4 40 1110 011d 2 41 3 1110 010a 2 41 5 4 0010 1110 011d 3 42 - 5 4 0010 1110 010a 3 42 - - 7 5 0010 1110 001d 43 - - - 7 5 0010 1110 000a 43 - - - - 4 3 1100 011d mem16(abs8)Am - - - - 4 3 1100 010a MOVW (abs16),DWm mem16(abs16)DWm - - - - 7 5 0010 1100 011d 45 MOVW (abs16),Am mem16(abs16)Am - - - - 7 5 0010 1100 010a 45 MOVW DWn,(Am) DWnmem16(Am) - - - - 2 3 1111 00aD MOVW An,(Am) Anmem16(Am) - - - - 3 4 0010 1111 10aA MOVW DWn,(d4,SP) DWnmem16(d4+SP) - - - - 3 3 MOVW An,(d4,SP) Anmem16(d4+SP) - - - - 3 MOVW DWn,(d8,SP) DWnmem16(d8+SP) - - - - MOVW An,(d8,SP) Anmem16(d8+SP) - - - MOVW DWn,(d16,SP) DWnmem16(d16+SP) - - MOVW An,(d16,SP) Anmem16(d16+SP) - MOVW DWn,(abs8) DWnmem16(abs8) MOVW An,(abs8) 44 44 46 4 46 1111 011D 2 47 3 1111 010A 2 47 5 4 0010 1111 011D 3 48 - 5 4 0010 1111 010A 3 48 - - 7 5 0010 1111 001D 49 - - - 7 5 0010 1111 000A 49 - - - - 4 3 1101 011D Anmem16(abs8) - - - - 4 3 1101 010A MOVW DWn,(abs16) DWnmem16(abs16) - - - - 7 5 0010 1101 011D 51 MOVW An,(abs16) Anmem16(abs16) - - - - 7 5 0010 1101 010A 51 MOVW DWn,(HA) DWnmem16(HA) - - - - 2 3 1001 010D MOVW An,(HA) Anmem16(HA) - - - - 2 3 1001 011A MOVW imm8,DWm sign(imm8)DWm - - - - 4 2 0000 110d <#8. ...> 5 53 MOVW imm8,Am zero(imm8)Am - - - - 4 2 0000 111a <#8. ...> 6 53 MOVW imm16,DWm imm16DWm - - - - 6 3 1100 111d <#16 .... Note: "Page" refers to the corresponding page in the Instruction Manual. 50 50 52 52 .... 54 ...> 1 d8 sign extended 2 d4 zero extended 3 d8 zero extended 4 A=An, a=Am 5 #8 sign extended 6 #8 zero extended Instruction Set 141 Chapter 10 Appendices MN101C00 SERIES INSTRUCTION SET Group PUSH POP EXT Mnemonic Operation Affected Flag CodeCycle Repeat Expand 1 VF NF CF ZF Size Machine Code 2 3 4 5 6 .... .... ...> 7 Notes Page 8 9 10 11 MOVW imm16,Am imm16Am - - - - 6 3 MOVW SP,Am SPAm - - - - 3 3 0010 0000 100a MOVW An,SP AnSP - - - - 3 3 0010 0000 101A MOVW DWn,DWm DWnDWm - - - - 3 3 0010 1000 00Dd MOVW DWn,Am DWnAm - - - - 3 3 0010 0100 11Da MOVW An,DWm AnDWm - - - - 3 3 0010 1100 11Ad MOVW An,Am AnAm - - - - 3 3 0010 0000 00Aa PUSH Dn SP-1SP,Dnmem8(SP) - - - - 2 3 1111 10Dn 58 PUSH An SP-2SP,Anmem16(SP) - - - - 2 5 0001 011A 58 POP Dn mem8(SP)Dn,SP+1SP - - - - 2 3 1110 10Dn 59 POP An mem16(SP)An,SP+2SP - - - - 2 4 0000 011A EXT Dn,DWm sign(Dn)DWm - - - - 3 3 0010 1001 000d 0011 0011 DnDm 1101 111a <#16 54 55 55 1 56 56 57 2 57 59 3 60 Arithmetic instructions ADD www.DataSheet4U.com ADD Dn,Dm Dm+DnDm 3 2 ADD imm4,Dm Dm+sign(imm4)Dm 3 2 61 6 61 1000 00Dm <#4> ADD imm8,Dm Dm+imm8Dm 4 2 ADDC ADDC Dn,Dm Dm+Dn+CFDm 3 2 0011 1011 DnDm ADDW ADDW DWn,DWm DWm+DWnDWm 3 3 0010 0101 00Dd ADDW DWn,Am Am+DWnAm 3 3 0010 0101 10Da ADDW imm4,Am Am+sign(imm4)Am 3 2 1110 110a <#4> ADDW imm8,Am Am+sign(imm8)Am 5 3 0010 1110 110a <#8. ...> ADDW imm16,Am Am+imm16Am 7 4 0010 0101 011a <#16 .... ADDW imm4,SP SP+sign(imm4)SP - - - - 3 2 1111 1101 <#4> ADDW imm8,SP SP+sign(imm8)SP - - - - 4 2 1111 1100 <#8. ADDW imm16,SP SP+imm16SP - - - - 7 4 0010 1111 1100 <#16 .... .... ...> ADDW imm16,DWm DWm+imm16DWm 7 4 0010 0101 010d <#16 .... .... ...> ADDUW ADDUW Dn,Am Am+zero(Dn)Am 3 3 0010 1000 1aDn ADDSW ADDSW Dn,Am Am+sign(Dn)Am 3 3 0010 1001 1aDn 70 SUB SUB Dn,Dm(when DnDm) Dm-DnDm 3 2 0010 1010 DnDm 71 SUB Dn,Dn Dn-DnDn 2 1 1000 01Dn SUB imm8,Dm Dm-imm8Dm 5 3 0010 1010 DmDm <#8. SUBC SUBC Dn,Dm Dm-Dn-CFDm 3 2 SUBW SUBW DWn,DWm DWm-DWnDWm 3 3 0010 0100 00Dd SUBW DWn,Am Am-DWnAm 3 3 0010 0100 10Da SUBW imm16,DWm DWm-imm16DWm 7 4 0010 0100 010d <#16 .... .... ...> SUBW imm16,Am Am-imm16Am 7 4 0010 0100 011a <#16 .... .... ...> MULU MULU Dn,Dm DmDnDWk 3 8 0010 1111 111D DIVU DIVU Dn,DWm DWm/DnDWm-I...DWm-h 3 9 0010 1110 111d CMP CMP Dn,Dm Dm-Dn...PSW 3 2 0011 0010 DnDm CMP imm8,Dm Dm-imm8...PSW 4 2 1100 00Dm <#8. CMP imm8,(abs8) mem8(abs8)-imm8...PSW 6 3 0000 0100 CMP imm8,(abs12) mem8(abs12)-imm8...PSW 7 3 0000 0101 82 CMPW imm16,Am Am-imm16...PSW 6 3 1101 110a <#16 .... .... ...> 83 CMPW 0 0 0 0 1 0000 10Dm <#8. 62 ...> 63 1 64 64 .... 6 65 7 65 66 ...> ...> 6 66 7 67 67 68 8 69 71 ...> 72 73 0010 1011 DnDm 1 74 74 75 75 4 5 76 77 78 78 ...> <#8. 79 ...> ...> <#8. ...> .... <#8. ...> 79 80 ...> 1 81 81 2 82 Logical instructions AND OR XOR Dm&DnDm 0 0 3 2 Dm&imm8Dm 0 0 4 2 0001 11Dm <#8. ...> 84 AND imm8,PSW PSW&imm8PSW 5 3 0010 1001 0010 <#8. ...> 85 OR Dn,Dm DmIDnDm 0 0 3 2 0011 0110 DnDm OR imm8,Dm DmIimm8Dm 0 0 4 2 0001 10Dm <#8. ...> OR imm8,PSW PSWIimm8PSW 5 3 0010 1001 0011 <#8. ...> XOR Dn,Dm Dm^DnDm 0 0 3 2 0011 1010 DnDm XOR imm8,Dm Dm^imm8Dm 0 0 5 3 0011 1010 DmDm <#8. Note: "Page" refers to the corresponding page in the Instruction Manual. 142 84 AND Dn,Dm AND imm8,Dm Instruction Set 0011 0111 DnDm 86 86 87 9 1 D=DWn, d=DWm 2 A=An, a=Am 3 d=DWm 4 D=DWk 88 88 ...> 5 D=DWm 6 #4 sign extended 7 #8 sign extended 8 Dn zero extended 9 mn www.DataSheet4U.com Chapter 10 Appendices MN101C00 SERIES INSTRUCTION SET Group Mnemonic Operation Affected Flag CodeCycle Repeat Expand 1 VF NF CF ZF Size Machine Code 2 3 4 5 6 7 Notes Page 8 9 10 11 NOT NOT Dn _ DnDn 0 3 2 0010 0010 10Dn 89 ASR ASR Dn Dn.msbtemp,Dn.lsbCF 0 - 3 2 0010 0011 10Dn 90 0 0 3 2 0010 0011 11Dn 91 3 2 0010 0010 11Dn 92 5 5 0011 1000 0bp. >1Dn,tempDn.msb LSR LSR Dn Dn.lsbCF,Dn>>1Dn 0Dn.msb ROR ROR Dn Dn.Isbtemp,Dn>>1Dn 0 CFDn.msb,tempCF Bit manipulation instructions BSET BSET (io8)bp ...> 93 4 1011 0bp. 93 7 6 0011 1100 0bp. 1mem8(abs16)bp BCLR BCLR (io8)bp ...> 95 4 1011 1bp. 95 7 6 0011 1100 1bp. .... ...> 96 0mem8(abs16)bp BTST BTST imm8,Dm Dm&imm8...PSW 0 0 5 3 0010 0000 11Dm <#8. BTST (abs16)bp mem8(abs16)&bpdata...PSW 0 0 7 5 0011 1101 0bp. - - - - 4 2/3 1000 1010 - - - 4 2/3 1000 1011 97 Branch instructions Bcc BEQ label 1 98 2 98 3 99 if(ZF=0), PC+3PC BEQ label if(ZF=1), PC+4+d7(label)+HPC if(ZF=0), PC+4PC BEQ label ...H if(ZF=0), PC+5PC BNE label if(ZF=0), PC+3+d4(label)+HPC - 1 100 if(ZF=1), PC+3PC BNE label if(ZF=0), PC+4+d7(label)+HPC - 2 100 if(ZF=1), PC+4PC BNE label if(ZF=0), PC+5+d11(label)+HPC - ...H 3 101 if(ZF=1), PC+5PC BGE label if((VF^NF)=0),PC+4+d7(label)+HPC - 2 102 if((VF^NF)=1),PC+4PC BGE label if((VF^NF)=0),PC+5+d11(label)+HPC - ...H 3 102 if((VF^NF)=1),PC+5PC BCC label if(CF=0),PC+4+d7(label)+HPC - 2 103 if(CF=1), PC+4PC BCC label if(CF=0), PC+5+d11(label)+HPC - ...H 3 103 if(CF=1), PC+5PC BCS label if(CF=1),PC+4+d7(label)+HPC - 2 104 if(CF=0), PC+4PC BCS label if(CF=1), PC+5+d11(label)+HPC - ...H 3 104 if(CF=0), PC+5PC BLT label if((VF^NF)=1),PC+4+d7(label)+HPC - 2 105 if((VF^NF)=0),PC+4PC BLT label if((VF^NF)=1),PC+5+d11(label)+HPC - ...H 3 105 if((VF^NF)=0),PC+5PC BLE label if((VF^NF)|ZF=1),PC+4+d7(label)+HPC - 2 106 if((VF^NF)|ZF=0),PC+4PC BLE label if((VF^NF)|ZF=1),PC+5+d11(label)+HPC - ...H 3 106 if((VF^NF)|ZF=0),PC+5PC BGT label if((VF^NF)|ZF=0),PC+5+d7(label)+HPC - 2 107 if((VF^NF)|ZF=1),PC+5PC Note: "Page" refers to the corresponding page in the Instruction Manual. 1 d4 sign extended 2 d7 sign extended 3 d11 sign extended Instruction Set 143 www.DataSheet4U.com Chapter 10 Appendices MN101C00 SERIES INSTRUCTION SET Group Bcc Mnemonic BGT label Operation Affected Flag CodeCycle Repeat Expand 1 VF NF CF ZF Size Machine Code 2 3 4 5 ...H - - - 6 3/4 0010 0011 0001 BRA label PC+4+d7(label)+HPC - - - - 4 3 1000 1001 <#8. ...> <#8. ...> <#8. ...> <#8. ...> <#8. ...> <#8. ...> <#8. ...> <#8. ...> if(Dm=imm8),PC+6PC CBNE imm8,Dm,label if(Dm=imm8),PC+8+d11(label)+HPC / 3 119 if(Dm=imm8),PC+8PC CBNE imm8,(abs8),label if(mem8(abs8)=imm8),PC+9+d7(label)+HPC / 2 120 if(mem8(abs8)=imm8),PC+9PC CBNE imm8,(abs8),label if(mem8(abs8)=imm8),PC+10+d11(label)+HPC / 3 120 if(mem8(abs8)=imm8),PC+10PC CBNE imm8,(abs16),label if(mem8(abs16)=imm8),PC+11+d7(label)+HPC / 2 121 if(mem8(abs16)=imm8),PC+11PC CBNE imm8,(abs16),label if(mem8(abs16)=imm8),PC+12+d11(label)+HPC / ...H 3 121 if(mem8(abs16)=imm8),PC+12PC TBZ TBZ (abs8)bp,label if(mem8(abs8)bp=0),PC+7+d7(label)+HPC 0 2 122 if(mem8(abs8)bp=1),PC+7PC TBZ (abs8)bp,label if(mem8(abs8)bp=0),PC+8+d11(label)+HPC 0 ...H 3 122 if(mem8(abs8)bp=1),PC+8PC Note: "Page" refers to the corresponding page in the Instruction Manual. 144 Instruction Set 1 d4 sign extended 2 d7 sign extended 3 d11 sign extended Chapter 10 Appendices MN101C00 SERIES INSTRUCTION SET Group TBZ Mnemonic TBZ (io8)bp,label Affected Flag CodeCycle Repeat Expand 1 VF NF CF ZF Size Operation if(mem8(IOTOP+io8)bp=0),PC+7+d7(label)+HPC 0 Machine Code 2 3 4 5 6 7 Notes Page 8 9 10 11 1 123 0 7 6/7 0011 0100 0bp. 0010 0001 00A1 - - - - 5 6 0001 000H - - - - 6 7 0001 001H 131 - - - - 2 1 0000 0000 132 128 5 128 129 (PC+3).bp15~8mem8(SP+1) (PC+3).Hmem8(SP+2).bp7, 0mem8(SP+2).bp6~2, (PC+3).bp17~16mem8(SP+2).bp1~0 0PC.bp17~16 AnPC.bp15~0,0PC.H www.DataSheet4U.com JSR label SP-3SP,(PC+5).bp7~0mem8(SP) 3 129 (PC+5).bp15~8mem8(SP+1) (PC+5).Hmem8(SP+2).bp7, 0mem8(SP+2).bp6~2, (PC+5).bp17~16mem8(SP+2).bp1~0 PC+5+d12(label)+HPC JSR label SP-3SP,(PC+6).bp7~0mem8(SP) ...> 4 130 0011 1001 1aaH 5 130 (PC+6).bp15~8mem8(SP+1) (PC+6).Hmem8(SP+2).bp7, 0mem8(SP+2).bp6~2, (PC+6).bp17~16mem8(SP+2).bp1~0 PC+6+d16(label)+HPC JSR label SP-3SP,(PC+7).bp7~0mem8(SP) (PC+7).bp15~8mem8(SP+1) (PC+7).Hmem8(SP+2).bp7, 0mem8(SP+2).bp6~2, (PC+7).bp17~16mem8(SP+2).bp1~0 abs18(label)+HPC JSRV (tbl4) SP-3SP,(PC+3).bp7~0mem8(SP) (PC+3).bp15~8mem8(SP+1) (PC+3).Hmem8(SP+2).bp7 0mem8(SP+2).bp6~2, (PC+3).bp17~16mem8(SP+2).bp1~0 mem8(x'004080+tbl4<<2)PC.bp7~0 mem8(x'004080+tbl4<<2+1)PC.bp15~8 mem8(x'004080+tbl4<<2+2).bp7PC.H mem8(x'004080+tbl4<<2+2).bp1~0 PC.bp17~16 NOP NOP PC+2PC Note: "Page" refers to the corresponding page in the Instruction Manual. 1 d7 sign extended 2 d11 sign extended 3 d12 sign extended 4 d16 sign extended 5 aa=abs18.1716 Instruction Set 145 Chapter 10 Appendices MN101C00 SERIES INSTRUCTION SET Group RTS Mnemonic RTS Operation mem8(SP)(PC).bp70 Flag CodeCycle Repeat Expand 1 VF NF CF ZF Size Machine Code 2 3 4 5 6 7 Notes Page 8 9 10 11 - - - - 2 7 0000 0001 133 2 11 0000 0011 134 - - - - 3 2 0010 0001 1rep mem8(SP+1)(PC).bp158 mem8(SP+2).bp7(PC).H mem8(SP+2).bp10(PC).bp1716 SP+3SP RTI RTI mem8(SP)PSW mem8(SP+1)(PC).bp70 mem8(SP+2)(PC).bp158 mem8(SP+3).bp7(PC).H mem8(SP+3).bp10(PC).bp1716 mem8(SP+4)HA-l mem8(SP+5)HA-h SP+6SP Control instruction REP REP imm3 imm3RPC Note: "Page" refers to the corresponding page in the Instruction Manual. 1 135 1 Number of repeats is 0 when imm3=0. www.DataSheet4U.com Ver2.0(1997.9.26) 146 Instruction Set Chapter 10 Appendices 8-3 Instruction Map MN101C00 SERIES INSTRUCTION MAP 1st nibble\2nd nibble 0 1 RTS 2 3 4 5 6 7 8 9 A B C D E F 0 NOP 1 JSR d12(label) JSR d16(label) MOV #8,(abs8)/(abs12) PUSH An 2 When the extension code is b'0010' 3 When the extension code is b'0011' 4 MOV (abs12),Dm MOV (abs8),Dm MOV (An),Dm 5 MOV Dn,(abs12) MOV Dn,(abs8) MOV Dn,(Am) 6 MOV (io8),Dm MOV (d4,SP),Dm MOV (d8,An),Dm 7 MOV Dn,(io8) MOV Dn,(d4,SP) MOV Dn,(d8,Am) 8 ADD #4,Dm SUB Dn,Dn BGE d7 BRA d7 BEQ d7 BNE d7 BCC d7 BCS d7 BLT d7 BLE d7 9 BEQ d4 A MOV Dn,Dm / MOV #8,Dm B BSET (abs8)bp MOV #8,(io8) RTI BNE d4 CMP #8,(abs8)/(abs12) POP An ADD #8,Dm MOVW #8,DWm MOVW #8,Am OR #8,Dm AND #8,Dm MOVW DWn,(HA) MOVW An,(HA) BGE d11 BRA d11 BEQ d11 BNE d11 BCC d11 BCS d11 BLT d11 BLE d11 BCLR (abs8)bp C CMP #8,Dm MOVW (abs8),Am MOVW (abs8),DWm CBEQ #8,Dm,d7 CMPW #16,DWm MOVW #16,DWm D MOV Dn,(HA) MOVW An,(abs8) MOVW DWn,(abs8) CBNE #8,Dm,d7 CMPW #16,Am MOVW #16,Am E MOVW (An),DWm MOVW (d4,SP),Am MOVW (d4,SP),DWm POP Dn ADDW #4,Am F MOVW DWn,(Am) MOVW An,(d4,SP) MOVW DWn,(d4,SP) PUSH Dn ADDW #8,SP ADDW #4,SP JSRV (tbl4) BRA d4 www.DataSheet4U.com Extension code: b'0010' 2nd nibble\3rd nibble 1 0 2 3 4 5 0 MOVW An,Am CMPW An,Am 1 JMP (A0) JSR (A0) JMP (A1) JSR (A1) MOV PSW,Dm 6 7 8 9 A B C D E MOVW SP,Am MOVW An,SP BTST #8,Dm REP #3 2 BGT d7 BHI d7 BLS d7 BNC d7 BNS d7 BVC d7 BVS d7 NOT Dn ROR Dn 3 BGT d11 BHI d11 BLS d11 BNC d11 BNS d11 BVC d11 BVS d11 ASR Dn LSR Dn 4 SUBW DWn,DWm SUBW #16,DWm SUBW #16,Am SUBW DWn,Am MOVW DWn,Am 5 ADDW DWn,DWm ADDW #16,DWm ADDW #16,Am ADDW DWn,Am CMPW DWn,Am 6 MOV (d16,SP),Dm MOV (d8,SP),Dm MOV (d16,An),Dm 7 MOV Dn,(d16,SP) MOV Dn,(d8,SP) MOV Dn,(d16,Am) 8 MOVW DWn,DWm (NOPL @n=m) CMPW DWn,DWm 9 EXT Dn,DWm A SUB Dn,Dm / SUB #8,Dm B SUBC Dn,Dm AND #8,PSW OR #8,PSW MOV Dn,PSW F ADDUW Dn,Am ADDSW Dn,Am C MOV (abs16),Dm MOVW (abs16),Am MOVW (abs16),DWm CBEQ #8,Dm,d12 MOVW An,DWm D MOV Dn,(abs16) MOVW An,(abs16) MOVW DWn,(abs16) CBNE #8,Dm,d12 CBEQ #8,(abs8),d7/d11 CBNE #8,(abs8),d7/d11 E MOVW (d16,SP),Am MOVW (d16,SP),DWm MOVW (d8,SP),Am MOVW (d8,SP),DWm MOVW (An),Am ADDW #8,Am DIVU F MOVW An,(d16,SP) MOVW DWn,(d16,SP) MOVW An,(d8,SP) MOVW DWn,(d8,SP) MOVW An,(Am) ADDW #16,SP MULU Instruction Map 147 Chapter 10 Appendices Extension code: b'0011' 2nd nibble\3rd nibble 0 www.DataSheet4U.com 1 2 3 4 5 6 7 8 9 A 0 TBZ (abs8)bp,d7 TBZ (abs8)bp,d11 1 TBNZ (abs8)bp,d7 TBNZ (abs8)bp,d11 2 CMP Dn,Dm 3 ADD Dn,Dm 4 TBZ (io8)bp,d7 TBZ (io8)bp,d11 5 TBNZ (io8)bp,d7 TBNZ (io8)bp,d11 6 OR Dn,Dm 7 AND Dn,Dm 8 BSET (io8)bp BCLR (io8)bp 9 JMP abs18(label) JSR abs18(label) A XOR Dn,Dm / XOR #8,Dm B ADDC Dn,Dm C BSET (abs16)bp BCLR (abs16)bp D BTST (abs16)bp cmp #8,(abs16) mov #8,(abs16) E TBZ (abs16)bp,d7 TBZ (abs16)bp,d11 F TBNZ (abs16)bp,d7 TBNZ (abs16)bp,d11 B C D E F CBEQ #8,(abs16),d7/11 CBNE #8,(abs16),d7/11 Ver2.0(1997.9.26) 148 Instruction Map www.DataSheet4U.com Chapter 10 Appendices 8-4 Summary of Special Function Registers Bit Symbol Address Register X 3F00 CPUM X 3F01 MEMCTR X 3F02 WDCTR X 3F03 DLYCTR X 3F0E EXADV X 3F10 P0OUT X 3F11 P1OUT X 3F12 P2OUT X 3F13 Disables to use X 3F14 Disables to use X 3F15 Disables to use X 3F16 P6OUT X 3F17 P7OUT X 3F18 P8OUT X 3F1F Disables to use X 3F20 P0IN X 3F21 P1IN X 3F22 P2IN X 3F23 Disables to use Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 STOP HALT OSC1 OSC0 Must be set STOP HALT transfer request transfer request to "0" IOW1 IOW0 II/0 bus wait value set Oscillation control IRWE IVBA Reference page MN101C00 series LSI Manual 30 Specifies base address of interrupt vector table WDEN Watchdog timer table DLYS1 DLYS0 Sets oscillation stabilization wait period P0OUT6 P0OUT2 P0OUT1 89 89 P0OUT0 4145 Port 0 output P1OUT4 P1OUT3 P1OUT2 P1OUT1 P1OUT0 4145 Port 1 output P2OUT7 4145 Port 2 output P6OUT7 P6OUT6 P6OUT5 P6OUT4 P6OUT3 P6OUT2 P6OUT1 P6OUT0 4145 Port 6 output P8OUT7 P8OUT6 P8OUT5 P8OUT4 P8OUT3 P8OUT2 P8OUT1 P7OUT0 Port 7 output P8OUT0 4145 Port 8 output P0IN2 P0IN6 P0IN1 P0IN0 Port 0 input P1IN4 P1IN3 4145 P1IN2 P1IN1 P1IN0 P2IN1 P2IN0 Port 1 input P2IN2 Port 2input 4145 4145 4145 Summary of Special Function Registers 149 Chapter 10 Appendices Bit Symbol Address Register X 3F24 Disables to use X 3F25 Disables to use X 3F26 P6IN X 3F27 P7IN X 3F28 P8IN X 3F2A PAIN X 3F30 P0DIR Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 P6IN7 P6IN6 P6IN5 P6IN4 P6IN3 P6IN2 P6IN1 P6IN0 P8IN6 P8IN5 P8IN4 P8IN3 PAIN6 PAIN5 PAIN4 PAIN3 Disables to use X 3F34 Disables to use X 3F35 Disables to use X 3F36 P6DIR X 3F37 P7DIR X 3F38 P8DIR X 3F39 P1OMD X 3F3A PAIMD X 3F3C Disables to use X 3F40 P0PLU X 3F41 P1PLU PAIN2 PAIN1 PAIN0 4145 P0DIR1 P0DIR0 Port 0 I/O direction control P1DIR3 4145 4145 P0DIR2 P1DIR4 X 3F33 P8IN1 Port A input P0DIR6 P1DIR P8IN2 P7IN0 Port 7 input P8IN0 Port 8 input PAIN7 X 3F31 4145 Port 6 input P8IN7 Reference Page P1DIR2 P1DIR1 4145 P1DIR0 4145 Port 1 I/O direction control www.DataSheet4U.com P6DIR7 P6DIR6 P6DIR5 P6DIR4 P6DIR3 P8DIR7 P8DIR6 P8DIR5 P8DIR4 P8DIR3 P6DIR1 P6DIR0 4145 PAAIN4 PAAIN3 P12TCO PAAIN2 P10TCO 4146 PAAIN1 PAAIN0 4146 I/O port/Special function pin control P0PLU6 P0PLU2 P0PLU1 P0PLU0 Port 0 pull-up resistor ON/OFF control P1PLU4 P1PLU3 P1PLU2 4145 4145 I/O port/Special function pin control PAAIN5 Summary of Special Function Registers P8DIR2 P7DIR0 Port 7 I/O direction control P8DIR1 P8DIR0 Port 8 I/O direction control P14TCO P13TCO 150 P6DIR2 Port 6 I/O direction control P1PLU1 4145 P1PLU0 Port 1 pull-up resistor ON/OFF control 4245 Chapter 10 Appendices Bit Symbol Address Register X 3F42 P2PLU X 3F43 Disables to use X 3F44 Disables to use X 3F45 Disables to use Bit 7 P6PLU X 3F47 P7PLUD X 3F48 P8PLU X 3F4A PAPLUD X 3F4B FLOAT1 X 3F4C Disables to use Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 P2PLU2 P2PLU1 P2PLU0 Port 2 pull-up resistor ON/OFF control P6PLU7 X 3F46 Bit 6 P6PLU6 P6PLU5 P6PLU4 P6PLU3 P6PLU2 P6PLU1 P6PLU0 Port 6 pull-up resistor ON/OFF control Reference Page 4245 4245 P7PLUD0 Port pull-up pull down resistor ON/OFF control P8PLU7 P8PLU6 P8PLU5 P8PLU4 P8PLU3 P8PLU2 P8PLU1 4245 P8PLU0 4245 Port 8 pull-up resistor ON/OFF control PAPLUD7 PAPLUD6 PAPLUD5 PAPLUD4 PAPLUD3 PAPLUD2 PAPLUD1 PAPLUD0 P21M www.DataSheet4U.com SC0MD0 X 3F51 SC0MD1 X 3F52 SC0MD2 X 3F53 SC0MD3 X 3F54 SC0CTR X 3F55 SC0TRB X 3F56 SC0RXB X 3F57 Disables to use X 3F58 Disables to use PARDWN P7RDWN P21input Port A pullp Port 7 pullup mode selection pulldown sel. pulldown sel. SC0CE0 X 3F50 4245 Port A pull-up pull-down resistor ON/OFF control SC0CE1 P21M SC0DIR SC0STE SC0LNG2 SC0LNG1 SC0LNG0 Receive data input edge Start bit set up Synchrounou serial Transmit data output edge for transmit start edition select SC0CKM SC0CK1 Transfer bit count SC0CK0 SC0BRKF SC0ERE Select 1/8 period Clock source selection of freq. SC0BRKE SC0FM1 SC0FM0 SC0PM1 SC0PM0 SC0NPE Control break Specifies added bit status trans. Specifies frame mode Enables parity SC0IOM SC0SBOM SC0SBTM SC0SBOS SC0SBIS SC0SBTS SBI0/SBO0 SBO0pin pin connection selection SelectSBT SelectSBO ControlSBI SelectSBT0 pin format pin function input pin function SC0BSY SC0CMD SC0RXB5 SC0RXB4 SC0FEF SC0PEK SC0ORE Status of serial bus Detect parity error Detect framing error 108 SC0TRI Break status Error monitor Trans/rec interrup rec. monitor request flag Select sync. seroal UART 4246 Detect overrun error 109 110 111 112 SC0TRB7 SC0TRB6 SC0TRB5 SC0TRB4 SC0TRB3 SC0TRB2 SC0TRB1 SC0TRB0 Serial interface 0 transmit/receive shift register 107 SC0RXB7 SC0RXB6 SC0RXB5 SC0RXB4 SC0RXB3 SC0RXB2 SC0RXB1 SC0RXB0 Serial interface 0 receive data buffer 107 Summary of Special Function Registers 151 Chapter 10 Appendices Bit Symbol Address Register X 3F59 Disables to use X 3F5A Disables to use X 3F5B Disables to use X 3F5C Disables to use X 3F5D Disables to use X 3F60 Disables to use X 3F61 Bit 7 Bit 6 Bit 3 Bit 2 Bit 1 Bit 0 Reference Page - TM2BC5 TM2BC TM2BC4 TM2BC3 TM2BC2 TM2BC1 TM2BC0 82 Binary counter2 TM3BC7 TM3BC6 X 3F63 Bit 4 Disables to use TM2BC7 TM2BC6 X 3F62 Bit 5 TM3BC5 TM3BC4 TM3BC3 TM3BC TM3BC2 TM3BC1 TM3BC0 Binary counter3 www.DataSheet4U.com 82 TM4BCL7 TM4BCL6 TM4BCL5 TM4BCL4 TM4BCL3 TM4BCL2 TM4BCL1 TM4BCL0 X 3F64 X 3F65 Binary counter 4Lower 8 bits TM4BCL TM4BCH TM4BCH7 TM4BCH6 TM4BCH5 TM4BCH4 TM4BCH3 TM4BCH2 TM4BCH1 TM4BCH0 Binary counter4 (Upper 8 bits X 3F66 TM4ICL 83 TM4ICL7 TM4ICL6 TM4ICL5 TM4ICL4 TM4ICL3 TM4ICL2 TM4ICL1 TM4ICL0 Input capture registerLower 8 bits 83 84 TM4ICH7 TM4ICH6 TM4ICH5 TM4ICH4 TM4ICH3 TM4ICH2 TM4ICH1 TM4ICH0 X 3F67 TM4ICH X 3F68 TM5BC X 3F70 Disables to use - X 3F71 Disables to use - X 3F72 TM2OC X 3F73 TM3OC X 3F74 TM4OCL Input capture reigster(Upper 8 bits) TM5BC7 TM5BC6 TM5BC5 TM5BC4 TM5BC3 TM5BC2 TM5BC1 TM5BC0 Binary counter 5 84 84 TM2OC7 TM2OC6 TM2OC5 TM2OC4 TM2OC3 TM2OC2 TM2OC1 TM2OC0 Compare register 2 82 TM3OC7 TM3OC6 TM3OC5 TM3OC4 TM3OC3 TM3OC2 TM3OC1 TM3OC0 Compare register 3 82 TM4OCL7 TM4OCL6 TM4OCL5 TM4OCL4 TM4OCL3 TM4OCL2 TM4OCL1 TM4OCL0 152 Summary of Special Function Registers Compare register 4Lower 8 bits 83 Chapter 10 Appendices Bit Symbol Address Register X 3FE0 Disables to use X 3FE1 NMICR X 3FE2 IRQ0ICR X 3FE3 IRQ1ICR X 3FE4 Disables to use X 3FE5 Disables to use X 3FE6 TM2ICR X 3FE7 TBICR X 3FE8 SC0ICR X 3FE9 Disables to use X 3FEA ADICR X 3FEB IRQ2ICR X 3FEC IRQ3ICR X 3FED Disables to use X 3FEE TM3ICR Interrupt level flag for timer 3 interrupt Interrupt enable flag X 3FEF TM4ICR Interrupt level flag for timer 4 interrupt Interrupt enable flag X 3FF0 TM5ICR Interrupt level flag for timer 5 interrupt Interrupt enable flag X 3FF1 Disables to use X 3FF2 Disables to use Bit 7 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Reference Page WDIR 34 Watchdog interrupt request flag IRQ0LV1 IRQ0LV0 REDG0 IRQ0IE IRQ0IR Interrup level flag for external interrupt External interrupt valid edge flag Interrupt enable flag Interrupt request flag IRQ1LV1 IRQ1LV0 REDG1 IRQ1IE IRQ1IR Interrupt level flag for external interrupt External interrupt valud edge flag Interrupt enable flag Interrupt request flag TM2LV1 TM2LV0 Interrupt level flag for timer 2 interrupt TBLV1 www.DataSheet4U.com Bit 6 TBLV0 Interrupt level flag for time base interrupt SC0LV1 SC0LV0 Interrupt level flag for serial 0 interrupt ADLV1 TM2IE TM2IR Interrupt enable flag Interrupt request flag TBIE TBIR Interrupt enable flag Interrupt request flag SC0IE SC0IR Interrup enable flag Interrupt request flag ADIE ADLV0 Interrup level flag for A/D interrupt IRQ2LV1 IRQ2LV0 REDG2 Interrupt level flag for external interrupt External interrupt valid edge flag 34 34 35 35 35 ADIR 35 Interrupt enable flag Interrupt request flag IRQ2IE IRQ2IR Interrup enable flag Interrupt request flag 34 Interrupt request flag 35 Interrupt request flag 35 Interrupt request flag 35 TM3IE TM4IE TM5IE Summary of Special Function Registers 153 Chapter 10 Appendices Bit Symbol Address Register X 3FE0 Disables to use X 3FE1 NMICR X 3FE2 IRQ0ICR X 3FE3 IRQ1ICR X 3FE4 Disables to use X 3FE5 Disables to use X 3FE6 TM2ICR X 3FE7 TBICR X 3FE8 SC0ICR X 3FE9 Disables to use X 3FEA ADICR X 3FEB IRQ2ICR X 3FEC IRQ3ICR X 3FED Disables to use X 3FEE TM3ICR Interrupt level flag for timer 3 interrupt Interrupt enable flag X 3FEF TM4ICR Interrupt level flag for timer 4 interrupt Interrupt enable flag X 3FF0 TM5ICR Interrupt level flag for timer 5 interrupt Interrupt enable flag X 3FF1 Disables to use X 3FF2 Disables to use Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Reference Page WDIR 34 Watchdog interrupt request flag IRQ0LV1 IRQ0LV0 REDG0 IRQ0IE IRQ0IR Interrup level flag for external interrupt External interrupt valid edge flag Interrupt enable flag Interrupt request flag IRQ1LV1 IRQ1LV0 REDG1 IRQ1IE IRQ1IR Interrupt level flag for external interrupt External interrupt valud edge flag Interrupt enable flag Interrupt request flag TM2LV1 TM2LV0 Interrupt level flag for timer 2 interrupt TBLV1 TBLV0 Interrupt level flag for time base interrupt SC0LV1 SC0LV0 Interrupt level flag for serial 0 interrupt TM2IE TM2IR Interrupt enable flag Interrupt request flag TBIE TBIR Interrupt enable flag Interrupt request flag SC0IE SC0IR Interrup enable flag Interrupt request flag 34 34 35 35 35 www.DataSheet4U.com ADLV1 ADIE ADLV0 Interrup level flag for A/D interrupt IRQ2LV1 IRQ2LV0 REDG2 Interrupt level flag for external interrupt External interrupt valid edge flag ADIR 35 Interrupt enable flag Interrupt request flag IRQ2IE IRQ2IR Interrup enable flag Interrupt request flag 34 Interrupt request flag 35 Interrupt request flag 35 Interrupt request flag 35 TM3IE TM4IE 154 TM5IE Summary of Special Function Registers www.DataSheet4U.com MN101C115 / 117 LSI User's Manual August,1999 1st Edition 1st Printing Issued by Matsushita Electric Industrial Co., Ltd. Matsushita Electronics Corporation (c) Matsushita Electric Industrial Co., Ltd. (c) Matsushita Electronics Corporation www.DataSheet4U.com Semiconductor Company Matsushita Electronics Corporation Nagaokakyo, Kyoto, 617-8520 Japan Tel: (075) 951-8151 http://www.mec.panasonic.co.jp SALES OFFICES HONG KONG SALES OFFICE U.S.A. SALES OFFICE Panasonic Industrial Company [PIC] New Jersey Office: 2 Panasonic Way, Secaucus, New Jersey 07094 Tel: 201-392-6173 Fax: 201-392-4652 Milpitas Office: 1600 McCandless Drive, Milpitas, California 95035 Tel: 408-945-5630 Fax: 408-946-9063 Chicago Office: 1707 N. Randall Road, Elgin, Illinois 60123-7847 Tel: 847-468-5829 Fax: 847-468-5725 Atlanta Office: 1225 Northbrook Parkway, Suite 1-151, Suwanee, Georgia 30174 Tel: 770-338-6940 Fax: 770-338-6849 San Diego Office: 9444 Balboa Avenue, Suite 185 San Diego, California 92123 Tel: 619-503-2940 Fax: 619-715-5545 CANADA SALES OFFICE Panasonic Canada Inc. [PCI] 5700 Ambler Drive Mississauga, Ontario, L4W 2T3 Tel: 905-624-5010 Fax: 905-624-9880 GERMANY SALES OFFICE Panasonic Industrial Europe G.m.b.H. Munich Office: Hans-Pinsel-Strasse 2 85540 Haar Tel: 89-46159-156 Fax: 89-46159-195 [PIEG] U.K. SALES OFFICE Panasonic Industrial Europe Ltd. [PIEL] Electric component Group: Willoughby Road, Bracknell, Berkshire RG12 8FP Tel: 1344-85-3773 Fax: 1344-85-3853 FRANCE SALES OFFICE Panasonic Industrial Europe G.m.b.H. Paris Office: 270, Avenue de President Wilson 93218 La Plaine Saint-Denis Cedex Tel: 14946-4413 Fax: 14946-0007 [PIEG] ITALY SALES OFFICE Panasonic Industrial Europe G.m.b.H. Milano Office: Via Lucini N19, 20125 Milano Tel: 2678-8266 Fax: 2668-8207 [PIEG] Panasonic Shun Hing Industrial Sales (Hong Kong) Co., Ltd. [PSI(HK)] 11/F, Great Eagle Centre, 23 Harbour Road, Wanchai, Hong Kong. Tel: 2529-7322 Fax: 2865-3697 TAIWAN SALES OFFICE Panasonic Industrial Sales Taiwan Co.,Ltd. [PIST] Head Office: 6th Floor, Tai Ping & First Building No.550. Sec.4, Chung Hsiao E. Rd. Taipei 10516 Tel: 2-2757-1900 Fax: 2-2757-1906 Kaohsiung Office: 6th Floor, Hsien 1st Road Kaohsiung Tel: 7-223-5815 Fax: 7-224-8362 SINGAPORE SALES OFFICE Panasonic Semiconductor of South Asia 300 Beach Road # 16-01 The Concourse Singapore 199555 Tel: 390-3688 Fax: 390-3689 [PSSA] MALAYSIA SALES OFFICE Panasonic Industrial Company (Malaysia) Sdn. Bhd. Head Office: [PICM] Tingkat 16B Menara PKNS PJ No.17,Jalan Yong Shook Lin 46050 Petaling Jaya Selangor Darul Ehsan Malaysia Tel: 03-7516606 Fax: 03-7516666 Penang Office: Suite 20-17,MWE PLAZA No.8,Lebuh Farquhar,10200 Penang Malaysia Tel: 04-2625550 Fax: 04-2619989 Johore Sales Office: 39-01 Jaran Sri Perkasa 2/1,Taman Tampoi Utama,Tampoi 81200 Johor Bahru,Johor Malaysia Tel: 07-241-3822 Fax: 07-241-3996 CHINA SALES OFFICE Panasonic SH Industrial Sales (Shenzhen) Co., Ltd. [PSI(SZ)] 7A-107, International Business & Exhibition Centre, Futian Free Trade Zone, Shenzhen 518048 Tel: 755-359-8500 Fax: 755-359-8516 Panasonic Industrial (Shanghai) Co., Ltd. [PICS] 1F, Block A, Development Mansion, 51 Ri Jing Street, Wai Gao Qiao Free Trade Zone, Shanghai 200137 Tel: 21-5866-6114 Fax: 21-5866-8000 THAILAND SALES OFFICE Panasonic Industrial (Thailand) Ltd. [PICT] 252/133 Muang Thai-Phatra Complex Building,31st Fl.Rachadaphisek Rd.,Huaykwang,Bangkok 10320 Tel: 02-6933407 Fax: 02-6933423 080499