NOTES FOR CMOS DEVICES VOLTAGE APPLICATION WAVEFORM AT INPUT PIN Waveform distortion due to input noise or a reflected wave may cause malfunction. If the input of the CMOS device stays in the area between V (MAX) and V (MIN) due to noise, etc., the device may malfunction.
Page 4
NEC Electronics does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from the use of NEC Electronics products listed in this document or any other liability arising from the use of such products. No license, express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of NEC Electronics or others.
Page 5
This manual is intended to give users an understanding of the functions described in the Organization below. Organization The 78K0R/KG3 manual is separated into two parts: this manual and the instructions edition (common to the 78K0R Microcontroller Series). 78K0R/KG3 78K0R Microcontroller User’s Manual...
Page 6
U17792E Note 78K0R Microcontroller Self Programming Library Type01 User’s Manual U18706E Note This document is classified under engineering management. Contact an NEC Electronics sales representative. Documents Related to Development Tools (Software) (User’s Manuals) Document Name Document No. CC78K0R Ver. 2.00 C Compiler...
Page 7
Document No. SEMICONDUCTOR SELECTION GUIDE − Products and Packages − X13769X Semiconductor Device Mount Manual Note Quality Grades on NEC Semiconductor Devices C11531E NEC Semiconductor Device Reliability/Quality Control System C10983E Guide to Prevent Damage for Semiconductor Devices by Electrostatic Discharge (ESD) C11892E Note See the “Semiconductor Device Mount Manual”...
CONTENTS CHAPTER 1 OUTLINE ...........................18 μ Differences Between Conventional-Specification Products ( PD78F116x) and μ Expanded- Specification Products ( PD78F116xA) .............18 Features ............................19 Applications..........................20 Ordering Information .......................21 Pin Configuration (Top View)....................22 78K0R/Kx3 Microcontroller Lineup ..................25 Block Diagram ..........................26 Outline of Functions ........................27 CHAPTER 2 PIN FUNCTIONS ......................29 Pin Function List ........................29 Description of Pin Functions ....................35...
Page 9
3.1.5 Extended special function register (2nd SFR: 2nd Special Function Register) area ....66 3.1.6 Data memory addressing ......................67 Processor Registers ........................74 3.2.1 Control registers .........................74 3.2.2 General-purpose registers......................76 3.2.3 ES and CS registers........................78 3.2.4 Special function registers (SFRs) ....................79 3.2.5 Extended special function registers (2nd SFRs: 2nd Special Function Registers) .....85 Instruction Address Addressing ....................91 3.3.1...
Page 10
Settings of Port Mode Register and Output Latch When Using Alternate Function ..........................160 Cautions on 1-Bit Manipulation Instruction for Port Register n (Pn)........163 CHAPTER 5 EXTERNAL BUS INTERFACE ..................164 Functions of External Bus Interface ..................164 Registers Controlling External Bus Interface Functions ...........170 Setting Port Mode Register and Output Latch ..............173 Number of Instruction Wait Clocks for Data Access............174 Number of Instruction Execution Clocks and Instruction Wait Clocks for Fetch...
Page 11
Configuration of Timer Array Unit..................231 Registers Controlling Timer Array Unit ................236 Channel Output (TO0n pin) Control ..................257 7.4.1 TO0n pin output circuit configuration..................257 7.4.2 TO0n pin output setting ......................258 7.4.3 Cautions on channel output operation..................258 7.4.4 Collective manipulation of TO0n bits ..................262 7.4.5 Timer interrupt and TO0n pin output at count operation start ...........263 Channel Input (TI0n Pin) Control..................264...
Page 12
CHAPTER 10 CLOCK OUTPUT/BUZZER OUTPUT CONTROLLER..........344 10.1 Functions of Clock Output/Buzzer Output Controller ............344 10.2 Configuration of Clock Output/Buzzer Output Controller ..........345 10.3 Registers Controlling Clock Output/Buzzer Output Controller.........345 10.4 Operations of Clock Output/Buzzer Output Controller ............347 10.4.1 Operation as output pin ......................347 CHAPTER 11 A/D CONVERTER ......................348 11.1 Function of A/D Converter ....................348...
Page 13
13.5.3 Master transmission/reception....................439 13.5.4 Slave transmission ........................447 13.5.5 Slave reception.........................456 13.5.6 Slave transmission/reception....................462 13.5.7 Calculating transfer clock frequency..................471 13.5.8 Procedure for processing errors that occurred during 3-wire serial I/O (CSI00, CSI01, CSI10, CSI20) communication ......................473 13.6 Operation of UART (UART0, UART1, UART2, UART3) Communication......474 13.6.1 UART transmission ........................475 13.6.2...
Page 14
14.5.17 Communication operations .......................567 14.5.18 Timing of I C interrupt request (INTIIC0) occurrence..............575 14.6 Timing Charts .........................596 CHAPTER 15 MULTIPLIER........................603 15.1 Functions of Multiplier......................603 15.2 Configuration of Multiplier ....................604 15.3 Operation of Multiplier......................605 CHAPTER 16 DMA CONTROLLER ....................606 16.1 Functions of DMA Controller ....................606 16.2 Configuration of DMA Controller..................607 16.3...
Page 15
19.2 Standby Function Operation....................660 19.2.1 HALT mode ..........................660 19.2.2 STOP mode..........................665 CHAPTER 20 RESET FUNCTION ......................672 20.1 Register for Confirming Reset Source ................680 CHAPTER 21 POWER-ON-CLEAR CIRCUIT ..................681 21.1 Functions of Power-on-Clear Circuit ...................681 21.2 Configuration of Power-on-Clear Circuit................682 21.3 Operation of Power-on-Clear Circuit ...................682 21.4 Cautions for Power-on-Clear Circuit..................685...
Page 16
Boot swap function ........................733 25.9.2 Flash shield window function ....................735 CHAPTER 26 ON-CHIP DEBUG FUNCTION ..................736 26.1 Connecting QB-MINI2 to 78K0R/KG3 ...................736 26.2 On-Chip Debug Security ID ....................737 26.3 Securing of User Resources ....................737 CHAPTER 27 BCD CORRECTION CIRCUIT ..................739 27.1...
Page 17
A.4.1 When using flash memory programmers PG-FP5, FL-PR5, PG-FP4 and FL-PR4 ....897 A.4.2 When using on-chip debug emulator with programming function QB-MINI2 ......898 Debugging Tools (Hardware)....................898 A.5.1 When using in-circuit emulator QB-78K0RKX3 ................898 A.5.2 When using on-chip debug emulator with programming function QB-MINI2 ......899 Debugging Tools (Software) ....................899 APPENDIX B LIST OF CAUTIONS....................900 APPENDIX C REVISION HISTORY ....................935...
μ 1.1 Differences Between Conventional-Specification Products ( PD78F116x) and Expanded- μ Specification Products ( PD78F116xA) This manual describes the functions of the 78K0R/KG3 microcontroller products with conventional specifications μ μ PD78F116x) and expanded specifications ( PD78F116xA). μ The differences between the conventional-specification products ( PD78F116x) and expanded-specification μ...
CHAPTER 1 OUTLINE 1.2 Features μ Minimum instruction execution time can be changed from high speed (0.05 s: @ 20 MHz operation with high- μ speed system clock) to ultra low-speed (61 s: @ 32.768 kHz operation with subsystem clock) General-purpose register: 8 bits ×...
CHAPTER 1 OUTLINE 1.3 Applications Home appliances • Laser printer motors • Clothes washers • Air conditioners • Refrigerators Home audio systems Digital cameras, digital video cameras User’s Manual U17894EJ9V0UD...
CHAPTER 1 OUTLINE 1.7 Block Diagram Timer array Port 0 P00 to P06 unit (8 ch) TI00/P00 Ch 0 TO00/P01 Port 1 P10 to P17 Ch 1 TI01/TO01/P16 Port 2 P20 to P27 Ch 2 TI02/TO02/P17 Port 3 P30, P31 TI03/TO03/P31 Ch 3 Port 4...
CHAPTER 2 PIN FUNCTIONS 2.1 Pin Function List There are five types of pin I/O buffer power supplies: AV , AV , EV , EV , and V . The relationship REF0 REF1 between these power supplies and the pins is shown below. Table 2-1.
Page 30
CHAPTER 2 PIN FUNCTIONS (1) Port functions (1/2) Function Name Function After Reset Alternate Function Port 0. Input port TI00 7-bit I/O port. TO00 Input of P03 and P04 can be set to TTL input buffer. SO10/TxD1 Output of P02 to P04 can be set to N-ch open-drain output SI10/RxD1/SDA10 tolerance).
Page 31
CHAPTER 2 PIN FUNCTIONS (1) Port functions (2/2) Function Name Function After Reset Alternate Function Port 6. Input port SCL0 8-bit I/O port. SDA0 Output of P60 to P63 can be set to N-ch open-drain output (6 − V tolerance). −...
CHAPTER 2 PIN FUNCTIONS (2) Non-port functions (1/3) Function Name Function After Reset Alternate Function ANI0 to ANI7 Input A/D converter analog input Digital input P20 to P27 port ANI8 to ANI15 Input A/D converter analog input Digital input P150 to P157 port ANO0 Output...
Page 33
CHAPTER 2 PIN FUNCTIONS (2) Non-port functions (2/3) Function Name Function After Reset Alternate Function PCLBUZ0 Output Clock output/buzzer output Input port P140/INTP6 PCLBUZ1 P141/INTP7 − − − REGC Connecting regulator output (2.5 V) stabilization capacitance for internal operation. μ Connect to V via a capacitor (0.47 to 1 RTCDIV...
Page 34
CHAPTER 2 PIN FUNCTIONS (2) Non-port functions (3/3) Function Name Function After Reset Alternate Function TO00 Output 16-bit timer 00 output Input port TO01 16-bit timer 01 output P16/TI01/INTP5/EX30 TO02 16-bit timer 02 output P17/TI02/EX31 TO03 16-bit timer 03 output P31/TI03/INTP4 TO04 16-bit timer 04 output...
CHAPTER 2 PIN FUNCTIONS 2.2 Description of Pin Functions 2.2.1 P00 to P06 (port 0) P00 to P06 function as a 7-bit I/O port. These pins also function as timer I/O, serial interface data I/O, clock I/O, internal system clock output, and external wait signal input. Input to the P03 and P04 pins can be specified through a normal input buffer or a TTL input buffer in 1-bit units, using port input mode register 0 (PIM0).
CHAPTER 2 PIN FUNCTIONS CLKOUT This is an internal system clock output pin. (e) WAIT This is an external wait signal input pin. Caution To use P02/SO10/TxD1 and P04/SCK10/SCL10 as general-purpose ports, set serial communication operation setting register 02 (SCR02) to the default status (0087H). In addition, clear port output mode register 0 (POM0) to 00H.
CHAPTER 2 PIN FUNCTIONS TO01, TO02 These are the timer output pins of 16-bit timers 01 and 02. INTP5 This is an external interrupt request input pin for which the valid edge (rising edge, falling edge, or both rising and falling edges) can be specified. (k) RTCDIV This is a real-time counter clock (32 kHz, divided) output pin.
CHAPTER 2 PIN FUNCTIONS (2) Control mode P30 and P31 function as external interrupt request input, timer I/O, and real-time counter correction clock output. (a) INTP3, INTP4 These are the external interrupt request input pins for which the valid edge (rising edge, falling edge, or both rising and falling edges) can be specified.
CHAPTER 2 PIN FUNCTIONS (c) TOOL1 This is a clock output pin for a debugger. When the on-chip debug function is used, P41/TOOL1 pin can be used as follows by the mode setting on the debugger. 1-line mode: can be used as a port (P41). 2-line mode: used as a TOOL1 pin and cannot be used as a port (P41).
CHAPTER 2 PIN FUNCTIONS (2) Control mode P50 to P57 function as external expansion I/O. (a) EX8 to EX15 These are the external expansion I/O (multiplexed address/data bus, address bus, data bus) pins. 2.2.7 P60 to P67 (port 6) P60 to P67 function as an 8-bit I/O port. These pins also function as serial interface data I/O, clock I/O, read strobe signal output, write strobe signal output, and address strobe signal output.
CHAPTER 2 PIN FUNCTIONS (2) Control mode P70 to P77 function as key interrupt input, external interrupt request input, and external expansion output. (a) KR0 to KR7 These are the key interrupt input pins (b) INTP8 to INTP11 These are the external interrupt request input pins for which the valid edge (rising edge, falling edge, or both rising and falling edges) can be specified.
CHAPTER 2 PIN FUNCTIONS (1) Port mode P120 functions as a 1-bit I/O port. P120 can be set to input or output port using port mode register 12 (PM12). Use of an on-chip pull-up resistor can be specified by pull-up resistor option register 12 (PU12). P121 to P124 functions as a 4-bit input port.
CHAPTER 2 PIN FUNCTIONS 2.2.13 P140 to P145 (port 14) P140 to P145 function as a 6-bit I/O port. These pins also function as timer I/O, external interrupt request input, clock/buzzer output, serial interface data I/O, and clock I/O. Input to the P142 and P143 pins can be specified through a normal input buffer or a TTL input buffer in 1-bit units using port input mode register 14 (PIM14).
CHAPTER 2 PIN FUNCTIONS (k) SCL20 This is a serial clock I/O pin of serial interface for simplified I 2.2.14 P150 to P157 (port 15) P150 to P157 function as an 8-bit I/O port. These pins also function as A/D converter analog input. The following operation modes can be specified in 1-bit units.
CHAPTER 2 PIN FUNCTIONS 2.2.16 AV REF1 This is the D/A converter reference voltage input pin and the positive power supply pin of P110, P111, and the D/A converter. The voltage that can be supplied to AV varies as follows, depending on whether P110/ANO0 and P111/ANO1 REF1 are used as digital I/Os or analog outputs.
CHAPTER 2 PIN FUNCTIONS 2.2.20 V , EV , EV is the positive power supply pin for P121 to P124 and pins other than ports (excluding the RESET and FLMD0 pins). and EV are the positive power supply pins for ports other than P20 to P27, P110, P111, P121 to P124, and P150 to P157 as well as for the RESET and FLMD0 pins.
CHAPTER 2 PIN FUNCTIONS 2.3 Pin I/O Circuits and Recommended Connection of Unused Pins Table 2-4 shows the types of pin I/O circuits and the recommended connections of unused pins. Table 2-4. Connection of Unused Pins (1/3) Pin Name I/O Circuit Type Recommended Connection of Unused Pins P00/TI00 Input:...
Page 48
CHAPTER 2 PIN FUNCTIONS Table 2-4. Connection of Unused Pins (2/3) Pin Name I/O Circuit Type Recommended Connection of Unused Pins P50/EX8, P51/EX9 Input: Independently connect to EV , EV , EV , or EV via a resistor. P52/EX10 to P57/EX15 5-AG Output: Leave open.
Page 49
CHAPTER 2 PIN FUNCTIONS Table 2-4. Connection of Unused Pins (3/3) Pin Name I/O Circuit Type Recommended Connection of Unused Pins − − Make this pin the same potential as EV , EV , or V REF1 See 2.2.16 AV when using P110 and P111.
Page 50
CHAPTER 2 PIN FUNCTIONS Figure 2-1. Pin I/O Circuit List (1/2) Type 2 Type 5-AG DD0, Pull-up P-ch enable DD0, Data P-ch IN/OUT Output N-ch Schmitt-triggered input with hysteresis characteristics disable SS0, Input enable Type 2-W Type 5-AN DD0, , EV Pull-up P-ch enable...
Page 51
CHAPTER 2 PIN FUNCTIONS Figure 2-1. Pin I/O Circuit List (2/2) Type 11-G Type 13-R REF0 Data P-ch IN/OUT IN/OUT Output N-ch disable Data N-ch Output disable P-ch Comparator , EV N-ch Series resistor string voltage Input enable Type 12-G Type 37-B REF1 Data...
CHAPTER 3 CPU ARCHITECTURE 3.1 Memory Space Products in the 78K0R/KG3 can access a 1 MB memory space. Figures 3-1 to 3-7 show the memory maps. μ Figure 3-1. Memory Map ( PD78F1162, 78F1162A) F F F F F H...
Page 53
CHAPTER 3 CPU ARCHITECTURE μ Figure 3-2. Memory Map ( PD78F1163, 78F1163A) F F F F F H 1 7 F F F H Special function register (SFR) 256 bytes F F F 0 0 H F F E F F H General-purpose register 32 bytes F F E E 0 H...
Page 54
CHAPTER 3 CPU ARCHITECTURE μ Figure 3-3. Memory Map ( PD78F1164, 78F1164A) F F F F F H 1 F F F F H Special function register (SFR) 256 bytes F F F 0 0 H F F E F F H General-purpose register 32 bytes F F E E 0 H...
Page 55
CHAPTER 3 CPU ARCHITECTURE μ Figure 3-4. Memory Map ( PD78F1165, 78F1165A) F F F F F H 2 F F F F H Special function register (SFR) 256 bytes F F F 0 0 H F F E F F H General-purpose register 32 bytes F F E E 0 H...
Page 56
CHAPTER 3 CPU ARCHITECTURE μ Figure 3-5. Memory Map ( PD78F1166, 78F1166A) F F F F F H 3 F F F F H Special function register (SFR) 256 bytes F F F 0 0 H F F E F F H General-purpose register 32 bytes F F E E 0 H...
Page 57
CHAPTER 3 CPU ARCHITECTURE μ Figure 3-6. Memory Map ( PD78F1167, 78F1167A) F F F F F H 5 F F F F H Special function register (SFR) 256 bytes F F F 0 0 H F F E F F H General-purpose register 32 bytes F F E E 0 H...
Page 58
CHAPTER 3 CPU ARCHITECTURE μ Figure 3-7. Memory Map ( PD78F1168, 78F1168A) F F F F F H 7 F F F F H Special function register (SFR) 256 bytes F F F 0 0 H F F E F F H General-purpose register 32 bytes F F E E 0 H...
Page 59
CHAPTER 3 CPU ARCHITECTURE Remark The flash memory is divided into blocks (one block = 2 KB). For the address values and block numbers, see Table 3-1 Correspondence Between Address Values and Block Numbers in Flash Memory. 7 F F F F H Block FFH 7 F 8 0 0 H 7 F 7 F F H...
Page 60
CHAPTER 3 CPU ARCHITECTURE Correspondence between the address values and block numbers in the flash memory are shown below. Table 3-1. Correspondence Between Address Values and Block Numbers in Flash Memory (1/2) Address Value Block Address Value Block Address Value Block Address Value Block...
Page 61
CHAPTER 3 CPU ARCHITECTURE Table 3-1. Correspondence Between Address Values and Block Numbers in Flash Memory (2/2) Address Value Block Address Value Block Address Value Block Address Value Block Number Number Number Number 40000H to 407FFH 50000H to 507FFH 60000H to 607FFH 70000H to 707FFH 40800H to 40FFFH 50800H to 50FFFH...
CHAPTER 3 CPU ARCHITECTURE 3.1.1 Internal program memory space The internal program memory space stores the program and table data. 78K0R/KG3 products incorporate internal ROM (flash memory), as shown below. Table 3-2. Internal ROM Capacity <R> Part Number Internal ROM...
CHAPTER 3 CPU ARCHITECTURE 3.1.2 Mirror area μ PD78F1162 and 78F1162A mirror the data flash area of 00000H to 0FFFFH, to F0000H to FFFFFH. μ PD78F1163, 78F1163A, 78F1164, 78F1164A, 78F1165, 78F1165A, 78F1166, 78F1166A, 78F1167, 78F1167A, 78F1168, and 78F1168A mirror the data flash area of 00000H to 0FFFFH or 10000H to 1FFFFH, to F0000H to FFFFFH (the data flash area to be mirrored is set by the processor mode control register (PMC)).
3. When the PD78F1162 or 78F1162A is used, be sure to set bit 0 (MAA) of this register to 0. 3.1.3 Internal data memory space 78K0R/KG3 products incorporate the following RAMs. Table 3-4. Internal RAM Capacity Part Number Internal RAM μ...
CHAPTER 3 CPU ARCHITECTURE 3.1.4 Special function register (SFR) area On-chip peripheral hardware special function registers (SFRs) are allocated in the area FFF00H to FFFFFH (see Table 3-5 in 3.2.4 Special function registers (SFRs)). Caution Do not access addresses to which SFRs are not assigned. 3.1.5 Extended special function register (2nd SFR: 2nd Special Function Register) area On-chip peripheral hardware special function registers (2nd SFRs) are allocated in the area F0000H to F07FFH (see Table 3-6 in 3.2.5 Extended Special function registers (2nd SFRs: 2nd Special Function Registers)).
Several addressing modes are provided for addressing the memory relevant to the execution of instructions for the 78K0R/KG3, based on operability and other considerations. For areas containing data memory in particular, special addressing methods designed for the functions of special function registers (SFR) and general-purpose registers are available for use.
Page 68
CHAPTER 3 CPU ARCHITECTURE μ <R> Figure 3-10. Correspondence Between Data Memory and Addressing ( PD78F1163, 78F1163A) F F F F F H SFR addressing Special function register (SFR) F F F 2 0 H 256 bytes F F F 1 F H F F F 0 0 H Short direct F F E F F H...
Page 69
CHAPTER 3 CPU ARCHITECTURE μ <R> Figure 3-11. Correspondence Between Data Memory and Addressing ( PD78F1164, 78F1164A) F F F F F H SFR addressing Special function register (SFR) F F F 2 0 H F F F 1 F H 256 bytes F F F 0 0 H F F E F F H...
Page 70
CHAPTER 3 CPU ARCHITECTURE μ <R> Figure 3-12. Correspondence Between Data Memory and Addressing ( PD78F1165, 78F1165A) F F F F F H SFR addressing Special function register (SFR) F F F 2 0 H F F F 1 F H 256 bytes F F F 0 0 H F F E F F H...
Page 71
CHAPTER 3 CPU ARCHITECTURE μ <R> Figure 3-13. Correspondence Between Data Memory and Addressing ( PD78F1166, 78F1166A) F F F F F H SFR addressing Special function register (SFR) F F F 2 0 H F F F 1 F H 256 bytes F F F 0 0 H F F E F F H...
Page 72
CHAPTER 3 CPU ARCHITECTURE μ Figure 3-14. Correspondence Between Data Memory and Addressing ( PD78F1167, 78F1167A) <R> F F F F F H SFR addressing Special function register (SFR) F F F 2 0 H F F F 1 F H 256 bytes F F F 0 0 H F F E F F H...
Page 73
CHAPTER 3 CPU ARCHITECTURE μ Figure 3-15. Correspondence Between Data Memory and Addressing ( PD78F1168, 78F1168A) <R> F F F F F H SFR addressing Special function register (SFR) F F F 2 0 H F F F 1 F H 256 bytes F F F 0 0 H F F E F F H...
CHAPTER 3 CPU ARCHITECTURE 3.2 Processor Registers The 78K0R/KG3 products incorporate the following processor registers. 3.2.1 Control registers The control registers control the program sequence, statuses and stack memory. The control registers consist of a program counter (PC), a program status word (PSW) and a stack pointer (SP).
Page 75
CHAPTER 3 CPU ARCHITECTURE (d) Auxiliary carry flag (AC) If the operation result has a carry from bit 3 or a borrow at bit 3, this flag is set (1). It is reset (0) in all other cases. (e) In-service priority flags (ISP1, ISP0) This flag manages the priority of acknowledgeable maskable vectored interrupts.
CHAPTER 3 CPU ARCHITECTURE Figure 3-19. Data to Be Saved to Stack Memory PUSH PSW instruction PUSH rp instruction SP←SP−2 SP←SP−2 ↑ ↑ Register pair lower SP−2 SP−2 ↑ ↑ SP−1 SP−1 Register pair higher ↑ ↑ → → Interrupt, BRK instruction CALL, CALLT instructions (4-byte stack) (4-byte stack)
Page 77
CHAPTER 3 CPU ARCHITECTURE Figure 3-20. Configuration of General-Purpose Registers (a) Function name 16-bit processing 8-bit processing FFEFFH Register bank 0 FFEF8H Register bank 1 FFEF0H Register bank 2 FFEE8H Register bank 3 FFEE0H (b) Absolute name 16-bit processing 8-bit processing FFEFFH Register bank 0 FFEF8H...
CHAPTER 3 CPU ARCHITECTURE 3.2.3 ES and CS registers The ES register is used for data access and the CS register is used to specify the higher address when a branch instruction is executed. The default value of the ES register after reset is 0FH, and that of the CS register is 00H. Figure 3-21.
CHAPTER 3 CPU ARCHITECTURE 3.2.4 Special function registers (SFRs) Unlike a general-purpose register, each SFR has a special function. SFRs are allocated to the FFF00H to FFFFFH area. SFRs can be manipulated like general-purpose registers, using operation, transfer, and bit manipulation instructions.
Page 80
CHAPTER 3 CPU ARCHITECTURE Table 3-5. SFR List (1/5) Address Special Function Register (SFR) Name Symbol Manipulable Bit Range After Reset 1-bit 8-bit 16-bit √ √ − FFF00H Port register 0 √ √ − FFF01H Port register 1 √ √ −...
Page 81
CHAPTER 3 CPU ARCHITECTURE Table 3-5. SFR List (2/5) Address Special Function Register (SFR) Name Symbol Manipulable Bit Range After Reset 1-bit 8-bit 16-bit √ √ − FFF30H A/D converter mode register √ √ − FFF31H Analog input channel specification register √...
Page 82
CHAPTER 3 CPU ARCHITECTURE Table 3-5. SFR List (3/5) Address Special Function Register (SFR) Name Symbol Manipulable Bit Range After Reset 1-bit 8-bit 16-bit − − √ FFF90H Sub-count register RSUBC 0000H FFF91H − √ − FFF92H Second count register −...
Page 83
CHAPTER 3 CPU ARCHITECTURE Table 3-5. SFR List (4/5) Address Special Function Register (SFR) Name Symbol Manipulable Bit Range After Reset 1-bit 8-bit 16-bit − √ − FFFB0H DMA SFR address register 0 DSA0 − √ − FFFB1H DMA SFR address register 1 DSA1 −...
Page 84
CHAPTER 3 CPU ARCHITECTURE Table 3-5. SFR List (5/5) Address Special Function Register (SFR) Name Symbol Manipulable Bit Range After Reset 1-bit 8-bit 16-bit √ √ √ FFFEEH Priority specification flag register 11L PR11L PR11 √ √ FFFEFH Priority specification flag register 11H PR11H −...
CHAPTER 3 CPU ARCHITECTURE 3.2.5 Extended special function registers (2nd SFRs: 2nd Special Function Registers) Unlike a general-purpose register, each extended SFR (2nd SFR) has a special function. Extended SFRs are allocated to the F0000H to F07FFH area. SFRs other than those in the SFR area (FFF00H to FFFFFH) are allocated to this area.
Page 86
CHAPTER 3 CPU ARCHITECTURE Table 3-6. Extended SFR (2nd SFR) List (1/5) Address Special Function Register (SFR) Name Symbol Manipulable Bit Range After Reset 1-bit 8-bit 16-bit − √ − F0017H A/D port configuration register ADPC √ √ − F0030H Pull-up resistor option register 0 √...
Page 87
CHAPTER 3 CPU ARCHITECTURE Table 3-6. Extended SFR (2nd SFR) List (2/5) Address Special Function Register (SFR) Name Symbol Manipulable Bit Range After Reset 1-bit 8-bit 16-bit − − √ F0110H Serial mode register 00 SMR00 0020H F0111H − − √...
Page 88
CHAPTER 3 CPU ARCHITECTURE Table 3-6. Extended SFR (2nd SFR) List (3/5) Address Special Function Register (SFR) Name Symbol Manipulable Bit Range After Reset 1-bit 8-bit 16-bit − √ √ F014CH Serial flag clear trigger register 12 SIR12L SIR12 0000H −...
Page 89
CHAPTER 3 CPU ARCHITECTURE Table 3-6. Extended SFR (2nd SFR) List (4/5) Address Special Function Register (SFR) Name Symbol Manipulable Bit Range After Reset 1-bit 8-bit 16-bit − − √ F0188H Timer counter register 04 TCR04 FFFFH F0189H − − √...
Page 90
CHAPTER 3 CPU ARCHITECTURE Table 3-6. Extended SFR (2nd SFR) List (5/5) Address Special Function Register (SFR) Name Symbol Manipulable Bit Range After Reset 1-bit 8-bit 16-bit √ √ √ F01B0H Timer channel enable status register 0 TE0L 0000H − −...
CHAPTER 3 CPU ARCHITECTURE 3.3 Instruction Address Addressing 3.3.1 Relative addressing [Function] Relative addressing stores in the program counter (PC) the result of adding a displacement value included in the instruction word (signed complement data: −128 to +127 or −32768 to +32767) to the program counter (PC)’s value (the start address of the next instruction), and specifies the program address to be used as the branch destination.
Page 92
CHAPTER 3 CPU ARCHITECTURE 3.3.3 Table indirect addressing [Function] Table indirect addressing specifies a table address in the CALLT table area (0080H to 00BFH) with the 5-bit immediate data in the instruction word, stores the contents at that table address and the next address in the program counter (PC) as 16-bit data, and specifies the program address.
CHAPTER 3 CPU ARCHITECTURE 3.3.4 Register direct addressing [Function] Register direct addressing stores in the program counter (PC) the contents of a general-purpose register pair (AX/BC/DE/HL) and CS register of the current register bank specified with the instruction word as 20-bit data, and specifies the program address.
CHAPTER 3 CPU ARCHITECTURE 3.4 Addressing for Processing Data Addresses 3.4.1 Implied addressing [Function] Instructions for accessing registers (such as accumulators) that have special functions are directly specified with the instruction word, without using any register specification field in the instruction word. [Operand format] Because implied addressing can be automatically employed with an instruction, no particular operand format is necessary.
CHAPTER 3 CPU ARCHITECTURE 3.4.3 Direct addressing [Function] Direct addressing uses immediate data in the instruction word as an operand address to directly specify the target address. [Operand format] Identifier Description ADDR16 Label or 16-bit immediate data (only the space from F0000H to FFFFFH is specifiable) ES: ADDR16 Label or 16-bit immediate data (higher 4-bit addresses are specified by the ES register) Figure 3-29.
CHAPTER 3 CPU ARCHITECTURE 3.4.4 Short direct addressing [Function] Short direct addressing directly specifies the target addresses using 8-bit data in the instruction word. This type of addressing is applied only to the space from FFE20H to FFF1FH. [Operand format] Identifier Description SADDR...
CHAPTER 3 CPU ARCHITECTURE 3.4.5 SFR addressing [Function] SFR addressing directly specifies the target SFR addresses using 8-bit data in the instruction word. This type of addressing is applied only to the space from FFF00H to FFFFFH. [Operand format] Identifier Description SFR name SFRP...
CHAPTER 3 CPU ARCHITECTURE 3.4.6 Register indirect addressing [Function] Register indirect addressing directly specifies the target addresses using the contents of the register pair specified with the instruction word as an operand address. [Operand format] Identifier Description − [DE], [HL] (only the space from F0000H to FFFFFH is specifiable) −...
CHAPTER 3 CPU ARCHITECTURE 3.4.7 Based addressing [Function] Based addressing uses the contents of a register pair specified with the instruction word as a base address, and 8-bit immediate data or 16-bit immediate data as offset data. The sum of these values is used to specify the target address.
Page 100
CHAPTER 3 CPU ARCHITECTURE Figure 3-36. Example of [HL + byte], [DE + byte] FFFFFH rp (HL/DE) Target memory F0000H OP code byte Memory Figure 3-37. Example of word[B], word[C] FFFFFH r (B/C) Target memory F0000H OP code Low Addr. High Addr.
Page 101
CHAPTER 3 CPU ARCHITECTURE Figure 3-39. Example of ES:[HL + byte], ES:[DE + byte] FFFFFH rp (HL/DE) Target memory OP code 00000H byte Memory Figure 3-40. Example of ES:word[B], ES:word[C] FFFFFH r (B/C) Target memory OP code 00000H Low Addr. Memory High Addr.
CHAPTER 3 CPU ARCHITECTURE 3.4.8 Based indexed addressing [Function] Based indexed addressing uses the contents of a register pair specified with the instruction word as the base address, and the content of the B register or C register similarly specified with the instruction word as offset address.
CHAPTER 3 CPU ARCHITECTURE 3.4.9 Stack addressing [Function] The stack area is indirectly addressed with the stack pointer (SP) contents. This addressing is automatically employed when the PUSH, POP, subroutine call, and return instructions are executed or the register is saved/restored upon generation of an interrupt request.
• P121 to P124 • Non-port pins (excluding RESET and FLMD0 pins) 78K0R/KG3 products are provided with the ports shown in Figure 4-1, which enable variety of control operations. The functions of each port are shown in Table 4-2. In addition to the function as digital I/O ports, these ports have several alternate functions. For details of the alternate functions, see CHAPTER 2 PIN FUNCTIONS.
Page 105
CHAPTER 4 PORT FUNCTIONS Table 4-2. Port Functions (1/2) Function Name Function After Reset Alternate Function Port 0. Input port TI00 7-bit I/O port. TO00 Input of P03 and P04 can be set to TTL input buffer. SO10/TxD1 Output of P02 to P04 can be set to N-ch open-drain output SI10/RxD1/SDA10 tolerance).
Page 106
CHAPTER 4 PORT FUNCTIONS Table 4-2. Port Functions (2/2) Function Name Function After Reset Alternate Function Port 6. Input port SCL0 8-bit I/O port. SDA0 Output of P60 to P63 can be set to N-ch open-drain output (6 − V tolerance). −...
CHAPTER 4 PORT FUNCTIONS 4.2 Port Configuration Ports include the following hardware. Table 4-3. Port Configuration Item Configuration Control registers Port mode registers (PM0 to PM8, PM11 to PM15) Port registers (P0 to P8, P11 to P15) Pull-up resistor option registers (PU0, PU1, PU3 to PU8, PU12 to PU14) Port input mode registers (PIM0, PIM4, PIM14) Port output mode registers (POM0, POM4, POM14) A/D port configuration register (ADPC)
CHAPTER 4 PORT FUNCTIONS 4.2.1 Port 0 Port 0 is a 7-bit I/O port with an output latch. Port 0 can be set to the input mode or output mode in 1-bit units using port mode register 0 (PM0). When the P00 to P06 pins are used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 0 (PU0).
Page 109
CHAPTER 4 PORT FUNCTIONS Figure 4-3. Block Diagram of P01 , EV PU01 P-ch PORT Output latch (P01) P01/TO00 PM01 Alternate function Port register 0 PU0: Pull-up resistor option register 0 PM0: Port mode register 0 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
Page 110
CHAPTER 4 PORT FUNCTIONS Figure 4-4. Block Diagram of P02 , EV PU02 P-ch PORT Output latch (P02) P02/SO10/TxD1 POM0 POM02 PM02 Alternate function Port register 0 PU0: Pull-up resistor option register 0 PM0: Port mode register 0 POM0: Port output mode register 0 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
Page 111
CHAPTER 4 PORT FUNCTIONS Figure 4-5. Block Diagram of P03 and P04 PIM0 PIM03, PIM04 , EV PU03, PU04 P-ch Alternate function CMOS PORT Output latch P03/SI10/RxD1/SDA10, (P03, P04) P04/SCK10/SCL10 POM0 POM03, POM04 PM03, PM04 Alternate function Port register 0 PU0: Pull-up resistor option register 0 PM0:...
Page 112
CHAPTER 4 PORT FUNCTIONS Figure 4-6. Block Diagram of P05 , EV PU05 P-ch PORT Output latch P05/CLKOUT (P05) PM05 Alternate function Port register 0 PU0: Pull-up resistor option register 0 PM0: Port mode register 0 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
Page 113
CHAPTER 4 PORT FUNCTIONS Figure 4-7. Block Diagram of P06 , EV PU06 P-ch Alternate function PORT Output latch P06/WAIT (P06) PM06 Alternate function Port register 0 PU0: Pull-up resistor option register 0 PM0: Port mode register 0 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
CHAPTER 4 PORT FUNCTIONS 4.2.2 Port 1 Port 1 is an 8-bit I/O port with an output latch. Port 1 can be set to the input mode or output mode in 1-bit units using port mode register 1 (PM1). When the P10 to P17 pins are used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 1 (PU1).
Page 115
CHAPTER 4 PORT FUNCTIONS Figure 4-8. Block Diagram of P10 , EV PU10 P-ch Alternate function PORT Output latch (P10) P10/SCK00/EX24 PM10 Alternate function Alternate function Port register 1 PU1: Pull-up resistor option register 1 PM1: Port mode register 1 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
Page 116
CHAPTER 4 PORT FUNCTIONS Figure 4-9. Block Diagram of P11 and P14 , EV PU11, PU14 P-ch Alternate function PORT Output latch (P11, P14) P11/SI00/RxD0/EX25, P14/RxD3/EX28 PM11, PM14 Alternate function Port register 1 PU1: Pull-up resistor option register 1 PM1: Port mode register 1 Read signal WR××: Write signal...
Page 117
CHAPTER 4 PORT FUNCTIONS Figure 4-10. Block Diagram of P12 and P13 , EV PU12, PU13 P-ch PORT Output latch (P12, P13) P12/SO00/TxD0/EX26, P13/TxD3/EX27 PM12, PM13 Alternate function Alternate function Port register 1 PU1: Pull-up resistor option register 1 PM1: Port mode register 1 Read signal WR××: Write signal...
Page 118
CHAPTER 4 PORT FUNCTIONS Figure 4-11. Block Diagram of P15 , EV PU15 P-ch PORT Output latch P15/RTCDIV/RTCCL/EX29 (P15) PM15 Alternate function Port register 1 PU1: Pull-up resistor option register 1 PM1: Port mode register 1 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
Page 119
CHAPTER 4 PORT FUNCTIONS Figure 4-12. Block Diagram of P16 and P17 , EV PU16, PU17 P-ch Alternate function PORT Output latch P16/TI01/TO01/INTP5/EX30, (P16, P17) P17/TI02/TO02/EX31 PM16, PM17 Alternate function Port register 1 PU1: Pull-up resistor option register 1 PM1: Port mode register 1 Read signal WR××: Write signal...
CHAPTER 4 PORT FUNCTIONS 4.2.3 Port 2 Port 2 is an 8-bit I/O port with an output latch. Port 2 can be set to the input mode or output mode in 1-bit units using port mode register 2 (PM2). This port can also be used for A/D converter analog input. To use P20/ANI0 to P27/ANI7 as digital input pins, set them in the digital I/O mode by using the A/D port configuration register (ADPC) and in the input mode by using PM2.
Page 121
CHAPTER 4 PORT FUNCTIONS Figure 4-13. Block Diagram of P20 to P27 PORT Output latch P20/ANI0 to (P20 to P27) P27/ANI7 PM20 to PM27 A/D converter Port register 2 PM2: Port mode register 2 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
CHAPTER 4 PORT FUNCTIONS 4.2.4 Port 3 Port 3 is a 2-bit I/O port with an output latch. Port 3 can be set to the input mode or output mode in 1-bit units using port mode register 3 (PM3). When the P30 and P31 pins are used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 3 (PU3).
CHAPTER 4 PORT FUNCTIONS 4.2.5 Port 4 Port 4 is an 8-bit I/O port with an output latch. Port 4 can be set to the input mode or output mode in 1-bit units using port mode register 4 (PM4). When the P40 to P47 pins are used as an input port, use of an on-chip pull-up Note resistor can be specified in 1-bit units by pull-up resistor option register 4 (PU4) Input to the P43 and P44 pins can be specified through a normal input buffer or a TTL input buffer in 1-bit units...
Page 124
CHAPTER 4 PORT FUNCTIONS Figure 4-15. Block Diagram of P40 , EV PU40 P-ch Alternate function PORT Output latch (P40) P40/TOOL0 PM40 Alternate function Port register 4 PU4: Pull-up resistor option register 4 PM4: Port mode register 4 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
Page 125
CHAPTER 4 PORT FUNCTIONS Figure 4-16. Block Diagram of P41 , EV PU41 P-ch PORT Output latch (P41) P41/TOOL1 PM41 Alternate function Port register 4 PU4: Pull-up resistor option register 4 PM4: Port mode register 4 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
Page 126
CHAPTER 4 PORT FUNCTIONS Figure 4-17. Block Diagram of P42 , EV PU42 P-ch Alternate function PORT Output latch P42/TI04/TO04 (P42) PM42 Alternate function Port register 4 PU4: Pull-up resistor option register 4 PM4: Port mode register 4 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
Page 127
CHAPTER 4 PORT FUNCTIONS Figure 4-18. Block Diagram of P43 PIM4 PIM43 , EV PU43 P-ch Alternate function CMOS PORT Output latch P43/SCK01 (P43) POM4 POM43 PM43 Alternate function Port register 4 PU4: Pull-up resistor option register 4 PM4: Port mode register 4 PIM4: Port input mode register 4 POM4: Port output mode register 4...
Page 128
CHAPTER 4 PORT FUNCTIONS Figure 4-19. Block Diagram of P44 PIM4 PIM44 , EV PU44 P-ch Alternate function CMOS PORT Output latch P44/SI01 (P44) PM44 Port register 4 PU4: Pull-up resistor option register 4 PM4: Port mode register 4 PIM4: Port input mode register 4 Read signal WR××: Write signal...
Page 129
CHAPTER 4 PORT FUNCTIONS Figure 4-20. Block Diagram of P45 , EV PU45 P-ch PORT Output latch P45/SO01 (P45) POM4 POM45 PM45 Alternate function Port register 4 PU4: Pull-up resistor option register 4 PM4: Port mode register 4 POM4: Port output mode register 4 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
Page 130
CHAPTER 4 PORT FUNCTIONS Figure 4-21. Block Diagram of P46 , EV PU46 P-ch Alternate function PORT Output latch P46/TI05/TO05/INTP1 (P46) PM46 Alternate function Port register 4 PU4: Pull-up resistor option register 4 PM4: Port mode register 4 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
Page 131
CHAPTER 4 PORT FUNCTIONS Figure 4-22. Block Diagram of P47 , EV PU47 P-ch Alternate function PORT Output latch P47/INTP2 (P47) PM47 Port register 4 PU4: Pull-up resistor option register 4 PM4: Port mode register 4 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
CHAPTER 4 PORT FUNCTIONS 4.2.6 Port 5 Port 5 is an 8-bit I/O port with an output latch. Port 5 can be set to the input mode or output mode in 1-bit units using port mode register 5 (PM5). When the P50 to P57 pins are used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 5 (PU5).
Page 133
CHAPTER 4 PORT FUNCTIONS Figure 4-24. Block Diagram of P52 to P57 , EV PU52 to PU57 P-ch Alternate function PORT Output latch P52/EX10 to (P52 to P57) P57/EX15 PM52 to PM57 EXEN, MM0 to MM3 Alternate function Port register 5 PU5: Pull-up resistor option register 5 PM5:...
CHAPTER 4 PORT FUNCTIONS 4.2.7 Port 6 Port 6 is an 8-bit I/O port with an output latch. Port 6 can be set to the input mode or output mode in 1-bit units using port mode register 6 (PM6). When the P64 to P67 pins are used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 6 (PU6).
Page 135
CHAPTER 4 PORT FUNCTIONS Figure 4-26. Block Diagram of P62 and P63 PORT Output latch P62, P63 (P62, P63) PM62, PM63 Port register 6 PM6: Port mode register 6 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
Page 136
CHAPTER 4 PORT FUNCTIONS Figure 4-27. Block Diagram of P64 to P67 , EV PU64 to PU67 P-ch PORT Output latch P64/RD, (P64 to P67) P65/WR0, P66/WR1, P67/ASTB PM64 to PM67 Alternate function Port register 6 PU6: Pull-up resistor option register 6 PM6: Port mode register 6 Read signal...
CHAPTER 4 PORT FUNCTIONS 4.2.8 Port 7 Port 7 is an 8-bit I/O port with an output latch. Port 7 can be set to the input mode or output mode in 1-bit units using port mode register 7 (PM7). When used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 7 (PU7).
CHAPTER 4 PORT FUNCTIONS 4.2.9 Port 8 Port 8 is an 8-bit I/O port with an output latch. Port 8 can be set to the input mode or output mode in 1-bit units using port mode register 8 (PM8). When the P80 to P87 pins are used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 8 (PU8).
CHAPTER 4 PORT FUNCTIONS 4.2.10 Port 11 Port 11 is a 2-bit I/O port with an output latch. Port 11 can be set to the input mode or output mode in 1-bit units using port mode register 11 (PM11). This port can also be used for D/A converter analog output. Reset signal generation sets port 11 to input mode.
Page 140
CHAPTER 4 PORT FUNCTIONS 4.2.11 Port 12 P120 is a 1-bit I/O port with an output latch. Port 12 can be set to the input mode or output mode in 1-bit units using port mode register 12 (PM12). When used as an input port, use of an on-chip pull-up resistor can be specified by pull-up resistor option register 12 (PU12).
Page 141
CHAPTER 4 PORT FUNCTIONS Figure 4-32. Block Diagram of P121 and P122 Clock generator OSCSEL P122/X2/EXCLK EXCLK, OSCSEL P121/X1 CMC: Clock operation mode control register Read signal User’s Manual U17894EJ9V0UD...
Page 142
CHAPTER 4 PORT FUNCTIONS Figure 4-33. Block Diagram of P123 and P124 Clock generator OSCSELS P124/XT2 OSCSELS P123/XT1 CMC: Clock operation mode control register Read signal User’s Manual U17894EJ9V0UD...
CHAPTER 4 PORT FUNCTIONS 4.2.12 Port 13 P130 is a 1-bit output-only port with an output latch. P131 is a 1-bit I/O port with an output latch. When used as an input port, use of an on-chip pull-up resistor can be specified by pull-up resistor option register 13 (PU13).
Page 144
CHAPTER 4 PORT FUNCTIONS Figure 4-35. Block Diagram of P131 , EV PU13 PU131 P-ch Alternate function PORT Output latch P131/TI06/TO06 (P131) PM13 PM131 Alternate function P13: Port register 13 PU13: Pull-up resistor option register 13 PM13: Port mode register 13 Read signal WR××: Write signal User’s Manual U17894EJ9V0UD...
CHAPTER 4 PORT FUNCTIONS 4.2.13 Port 14 Port 14 is a 6-bit I/O port with an output latch. Port 14 can be set to the input mode or output mode in 1-bit units using port mode register 14 (PM14). When the P140 to P145 pins are used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up resistor option register 14 (PU14).
Page 146
CHAPTER 4 PORT FUNCTIONS Figure 4-36. Block Diagram of P140, P141, and P145 , EV PU14 PU140, PU141, PU145 P-ch Alternate function PORT Output latch P140/PCLBUZ0/INTP6, (P140, P141, P145) P141/PCLBUZ1/INTP7, P145/TI07/TO07 PM14 PM140, PM141, PM145 Alternate function P14: Port register 14 PU14: Pull-up resistor option register 14 PM14:...
Page 147
CHAPTER 4 PORT FUNCTIONS Figure 4-37. Block Diagram of P142 and P143 PIM14 PIM142, PIM143 , EV PU14 PU142, PU143 P-ch Alternate function CMOS PORT Output latch P142/SCK20/SCL20, (P142, P143) P143/SI20/RxD2/SDA20 POM14 POM142, POM143 PM14 PM142, PM143 Alternate function P14: Port register 14 PU14: Pull-up resistor option register 14...
Page 148
CHAPTER 4 PORT FUNCTIONS Figure 4-38. Block Diagram of P144 , EV PU14 PU144 P-ch PORT Output latch (P144) P144/SO20/TxD2 POM14 POM144 PM14 PM144 Alternate function P14: Port register 14 PU14: Pull-up resistor option register 14 PM14: Port mode register 14 POM14: Port output mode register 14 Read signal WR××: Write signal...
CHAPTER 4 PORT FUNCTIONS 4.2.14 Port 15 Port 15 is an 8-bit I/O port with an output latch. Port 15 can be set to the input mode or output mode in 1-bit units using port mode register 15 (PM15). This port can also be used for A/D converter analog input. To use P150/ANI8 to P157/ANI15 as digital input pins, set them in the digital I/O mode by using the A/D port configuration register (ADPC) and in the input mode by using PM15.
CHAPTER 4 PORT FUNCTIONS 4.3 Registers Controlling Port Function Port functions are controlled by the following six types of registers. • Port mode registers (PM0 to PM8, PM11 to PM15) • Port registers (P0 to P8, P11 to P15) • Pull-up resistor option registers (PU0, PU1, PU3 to PU8, PU12 to PU14) •...
Page 151
CHAPTER 4 PORT FUNCTIONS Figure 4-40. Format of Port Mode Register Symbol Address After reset PM06 PM05 PM04 PM03 PM02 PM01 PM00 FFF20H PM17 PM16 PM15 PM14 PM13 PM12 PM11 PM10 FFF21H PM27 PM26 PM25 PM24 PM23 PM22 PM21 PM20 FFF22H PM31 PM30...
Page 152
CHAPTER 4 PORT FUNCTIONS (2) Port registers (P0 to P8, P11 to P15) These registers write the data that is output from the chip when data is output from a port. If the data is read in the input mode, the pin level is read. If it is read in the output mode, the output latch value is Note read These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Page 153
CHAPTER 4 PORT FUNCTIONS Figure 4-41. Format of Port Register Symbol Address After reset FFF00H 00H (output latch) R/W FFF01H 00H (output latch) R/W FFF02H 00H (output latch) R/W FFF03H 00H (output latch) R/W FFF04H 00H (output latch) R/W FFF05H 00H (output latch) R/W FFF06H 00H (output latch) R/W...
Page 154
CHAPTER 4 PORT FUNCTIONS (3) Pull-up resistor option registers (PU0, PU1, PU3 to PU8, PU12 to PU14) These registers specify whether the on-chip pull-up resistors of P00 to P06, P10 to P17, P30, P31, P40 to P47, P50 to P57, P64 to P67, P70 to P77, P80 to P87, P120, P131, or P140 to P145 are to be used or not. On-chip pull-up resistors can be used in 1-bit units only for the bits set to input mode of the pins to which the use of an on- chip pull-up resistor has been specified in PU0, PU1, PU3 to PU8, and PU12 to PU14.
Page 155
CHAPTER 4 PORT FUNCTIONS (4) Port input mode registers (PIM0, PIM4, PIM14) These registers set the input buffer of P03, P04, P43, P44, P142, or P143 in 1-bit units. TTL input buffer can be selected during serial communication with an external device of the different potential. These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Page 156
CHAPTER 4 PORT FUNCTIONS (6) A/D port configuration register (ADPC) This register switches the P20/ANI0 to P27/ANI7 and P150/ANI8 to P157/ANI15 pins to digital I/O of port or analog input of A/D converter. ADPC can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation sets this register to 10H.
CHAPTER 4 PORT FUNCTIONS 4.4 Port Function Operations Port operations differ depending on whether the input or output mode is set, as shown below. 4.4.1 Writing to I/O port (1) Output mode A value is written to the output latch by a transfer instruction, and the output latch contents are output from the pin. Once data is written to the output latch, it is retained until data is written to the output latch again.
CHAPTER 4 PORT FUNCTIONS 4.4.4 Connecting to external device with different potential (2.5V, 3 V) When parts of ports 0, 4, and 14 operate with V = 4.0 V to 5.5 V, I/O connections with an external device that operates on 2.5 V, 3 V power supply voltage are possible. Regarding inputs, CMOS/TTL switching is possible on a bit-by-bit basis by port input mode registers (PIM0, PIM4, PIM14).
Page 159
CHAPTER 4 PORT FUNCTIONS (2) Setting procedure when using I/O pins of simplified IIC10 and IIC20 functions <1> After reset release, the port mode is the input mode (Hi-Z). <2> Externally pull up the pin to be used (on-chip pull-up resistor cannot be used). In case of simplified IIC10: P03, P04 In case of simplified IIC20:...
CHAPTER 4 PORT FUNCTIONS 4.5 Settings of Port Mode Register and Output Latch When Using Alternate Function To use the alternate function of a port pin, set the port mode register and output latch as shown in Table 4-6. Table 4-6. Settings of Port Mode Register and Output Latch When Using Alternate Function (1/3) PM××...
Page 161
CHAPTER 4 PORT FUNCTIONS Table 4-6. Settings of Port Mode Register and Output Latch When Using Alternate Function (2/3) Pin Name Alternate Function PM×× P×× Function Name × TI02 Input TO02 Output EX31 Output Note 1 Note 1 × P20 to P27 ANI0 to ANI7 Input RTC1HZ...
Page 162
CHAPTER 4 PORT FUNCTIONS Table 4-6. Settings of Port Mode Register and Output Latch When Using Alternate Function (3/3) Pin Name Alternate Function PM×× P×× Function Name × P120 INTP0 Input × EXLVI Input × P131 TI06 Input TO06 Output P140 PCLBUZ0 Output...
The targets of writing to and reading from the Pn register of a port whose PMnm bit is 1 are the output latch and pin status, respectively. A 1-bit manipulation instruction is executed in the following order in the 78K0R/KG3. <1> The Pn register is read in 8-bit units.
CHAPTER 5 EXTERNAL BUS INTERFACE 5.1 Functions of External Bus Interface The external bus interface function is used to connect an external device to an area other than the internal ROM, RAM, and SFR areas. An external device is connected by using ports 0, 1, and 5 to 8. Ports 0, 1, and 5 to 8 control signals such as address/data, read/write strobe, wait, and address strobe.
Page 165
CHAPTER 5 EXTERNAL BUS INTERFACE The function of the external bus interface pins differs depending on the set mode. EX31 to EX27 to EX23 to EX19 to EX15 to EX11 to EX7 to EX0 External Extension Mode EX28 EX24 EX20 EX16 EX12 −...
Page 166
CHAPTER 5 EXTERNAL BUS INTERFACE The memory maps when using the external bus interface function are as follows. Figure 5-1. Memory Map When Using External Bus Interface Function (1/4) μ μ (a) Memory map of PD78F1162, 78F1162A (b) Memory map of PD78F1163, 78F1163A FFFFFH FFFFFH...
Page 167
CHAPTER 5 EXTERNAL BUS INTERFACE Figure 5-1. Memory Map When Using External Bus Interface Function (2/4) μ μ (c) Memory map of PD78F1164, 78F1164A (d) Memory map of PD78F1165, 78F1165A FFFFFH FFFFFH Special-function register (SFR) Special-function register (SFR) 256 bytes 256 bytes FFF00H FFF00H...
Page 168
CHAPTER 5 EXTERNAL BUS INTERFACE Figure 5-1. Memory Map When Using External Bus Interface Function (3/4) μ μ (e) Memory map of PD78F1166, 78F1166A (f) Memory map of PD78F1167, 78F1167A FFFFFH FFFFFH Special-function register (SFR) Special-function register (SFR) 256 bytes 256 bytes FFF00H FFF00H...
Page 169
CHAPTER 5 EXTERNAL BUS INTERFACE Figure 5-1. Memory Map When Using External Bus Interface Function (4/4) μ (g) Memory map of PD78F1168, 78F1168A FFFFFH Special-function register (SFR) 256 bytes FFF00H FFEFFH General-purpose register 32 bytes FFEE0H FFEDFH Note 30 KB F8700H F86FFH Mirror...
CHAPTER 5 EXTERNAL BUS INTERFACE 5.2 Registers Controlling External Bus Interface Functions The external bus interface function is controlled by the following registers. • Peripheral enable register 1 (PER1) • Memory extension mode control register (MEM) • Port mode registers 0, 1, 5, 6, 7, 8 (PM0, PM1, PM5, PM6, PM7, PM8) •...
Page 171
CHAPTER 5 EXTERNAL BUS INTERFACE (2) Memory extension mode control register (MEM) MEM is a register that sets an external extension area. MEM can be set by a 1-bit or 8-bit manipulation instruction. Reset signal generation clears this register to 00H. Figure 5-3.
Page 172
CHAPTER 5 EXTERNAL BUS INTERFACE The function of the external bus interface pins differs depending on the setting of the memory extension mode control register (MEM). EX31 to EX27 to EX23 to EX19 to EX15 to EX11 to EX7 to EX28 EX24 EX20...
CHAPTER 5 EXTERNAL BUS INTERFACE 5.3 Setting Port Mode Register and Output Latch Set the port mode register and output latch as follows when using the external bus interface. EXEN MM3 MM2 MM1 MM0 P17/EX31 to P13/EX27 to P77/EX23 to P73/EX19 to P57/EX15 to P53/EX11 to...
CHAPTER 5 EXTERNAL BUS INTERFACE 5.4 Number of Instruction Wait Clocks for Data Access Wait clocks are added to the number of clocks of an instruction when the external bus interface is accessed. The actual number of operating clocks is therefore the sum of the number of operating clocks of each instruction and the number of wait states.
CHAPTER 5 EXTERNAL BUS INTERFACE <R> 5.6 Number of Instructed Wait Cycles According to External Wait Cycles If an external device that has a low access speed is accessed, wait cycles can be inserted into the bus cycle. If a Note low-level signal is input to the WAIT pin at the rising edge of the CLKOUT signal, a wait of one CLKOUT clock cycle...
CHAPTER 5 EXTERNAL BUS INTERFACE 5.7 Timing of External Bus Interface Function The functions of the timing control signal output pins in the external memory extension mode are described below. (1) RD pin (alternate function: P64) This pin outputs a read strobe signal when an instruction is fetched or data is read from the external memory. It does not output the read strobe signal (holds the high level) when the internal memory is read.
CLKOUT as the reference clock. Other signals have delay on CLKOUT, however, note with caution that the CLKOUT does not delay on-board or when designing external logic. Figure 5-9. Example of External Logic Connection 78K0R/KG3 A11 to A8 Address bus...
CHAPTER 5 EXTERNAL BUS INTERFACE 5.8.3 Connection of asynchronous memory Use the separate bus mode for connecting an asynchronous memory. Figure 5-11. Example of Asynchronous Memory Connection 78K0R/KG3 Asynchronous memory A15 to A1 A14 to A0 (address) D15 to D0 (data)
CHAPTER 6 CLOCK GENERATOR 6.1 Functions of Clock Generator The clock generator generates the clock to be supplied to the CPU and peripheral hardware. The following three kinds of system clocks and clock oscillators are selectable. (1) Main system clock <1>...
CHAPTER 6 CLOCK GENERATOR 6.2 Configuration of Clock Generator The clock generator includes the following hardware. Table 6-1. Configuration of Clock Generator Item Configuration Control registers Clock operation mode control register (CMC) Clock operation status control register (CSC) Oscillation stabilization time counter status register (OSTC) Oscillation stabilization time select register (OSTS) System clock control register (CKC) Peripheral enable register 0, 1 (PER0, PER1)
Page 189
<R> Figure 6-1. Block Diagram of Clock Generator Internal bus Clock operation mode Clock operation status Oscillation stabilization System clock control control register control register time select register (OSTS) register (CKC) (CMC) (CSC) AMPH EXCLK OSCSEL MSTOP MCM0 OSTS2 OSTS1 OSTS0 X1 oscillation stabilization time counter STOP...
CHAPTER 6 CLOCK GENERATOR Remark f X1 clock oscillation frequency Internal high-speed oscillation clock frequency External main system clock frequency High-speed system clock frequency : Main system clock frequency MAIN <R> : Main system select clock frequency MAINC XT1 clock oscillation frequency : Subsystem clock frequency CPU/peripheral hardware clock frequency Internal low-speed oscillation clock frequency...
Page 191
CHAPTER 6 CLOCK GENERATOR (1) Clock operation mode control register (CMC) This register is used to set the operation mode of the X1/P121, X2/EXCLK/P122, XT1/P123, and XT2/P124 pins, and to select a gain of the oscillator. CMC can be written only once by an 8-bit memory manipulation instruction after reset release. This register can be read by a 1-bit or 8-bit memory manipulation instruction.
Page 192
CHAPTER 6 CLOCK GENERATOR (2) Clock operation status control register (CSC) This register is used to control the operations of the high-speed system clock, internal high-speed oscillation clock, and subsystem clock (except the internal low-speed oscillation clock). CSC can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation sets this register to C0H.
CHAPTER 6 CLOCK GENERATOR Caution 4. The setting of the flags of the register to stop clock oscillation (invalidate the external clock input) and the condition before clock oscillation is to be stopped are as follows. Table 6-2. Condition Before Stopping Clock Oscillation and Flag Setting Clock Condition Before Stopping Clock Setting of CSC...
Page 194
CHAPTER 6 CLOCK GENERATOR Figure 6-4. Format of Oscillation Stabilization Time Counter Status Register (OSTC) Address: FFFA2H After reset: 00H Symbol OSTC MOST MOST MOST MOST MOST MOST MOST MOST MOST MOST MOST MOST MOST MOST MOST MOST Oscillation stabilization time status = 10 MHz = 20 MHz μ...
Page 195
CHAPTER 6 CLOCK GENERATOR (4) Oscillation stabilization time select register (OSTS) This register is used to select the X1 clock oscillation stabilization wait time when the STOP mode is released. When the X1 clock is selected as the CPU clock, the operation automatically waits for the time set using OSTS after the STOP mode is released.
Page 196
CHAPTER 6 CLOCK GENERATOR Figure 6-5. Format of Oscillation Stabilization Time Select Register (OSTS) Address: FFFA3H After reset: 07H Symbol OSTS OSTS2 OSTS1 OSTS0 OSTS2 OSTS1 OSTS0 Oscillation stabilization time selection = 10 MHz = 20 MHz μ 25.6 Setting prohibited μ...
CHAPTER 6 CLOCK GENERATOR (5) System clock control register (CKC) This register is used to select a CPU/peripheral hardware clock and a division ratio. CKC can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation sets this register to 09H. Figure 6-6.
Page 198
SPECIFICATIONS (STANDARD PRODUCTS) and CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS). The fastest instruction can be executed in 1 clock of the CPU clock in the 78K0R/KG3. Therefore, the relationship between the CPU clock (f ) and the minimum instruction execution time is as shown in Table 6-3.
Page 199
CHAPTER 6 CLOCK GENERATOR (6) Peripheral enable registers 0, 1 (PER0, PER1) These registers are used to enable or disable use of each peripheral hardware macro. Clock supply to the hardware that is not used is also stopped so as to decrease the power consumption and noise. PER0 and PER1 can be set by a 1-bit or 8-bit memory manipulation instruction.
Page 200
CHAPTER 6 CLOCK GENERATOR Figure 6-7. Format of Peripheral Enable Register (2/2) SAU1EN Control of serial array unit 1 input clock Stops input clock supply. • SFR used by the serial array unit 1 cannot be written. • The serial array unit 1 is in the reset status. Supplies input clock.
Page 201
CHAPTER 6 CLOCK GENERATOR (7) Operation speed mode control register (OSMC) This register is used to control the step-up circuit of the flash memory for high-speed operation. If the microcontroller operates at a low speed with a system clock of 10 MHz or less, the power consumption can be lowered by setting this register to the default value, 00H.
Page 202
CHAPTER 6 CLOCK GENERATOR (8) Internal high-speed oscillator trimming register (HIOTRM) This register is used to adjust the accuracy of the internal high-speed oscillator. With self-measurement of the internal high-speed oscillator frequency via a subsystem clock using a crystal resonator, a timer using high-accuracy external clock input (real-time counter or timer array unit), and so on, the register can adjust the accuracy.
Page 203
CHAPTER 6 CLOCK GENERATOR Figure 6-9. Format of Internal High-Speed Oscillator Trimming Register (HIOTRM) Address: F00F2H After reset: 10H Symbol HIOTRM TTRM4 TTRM3 TTRM2 TTRM1 TTRM0 TTRM4 TTRM3 TTRM2 TTRM1 TTRM0 Clock correction value (2.7 V ≤ V ≤ 5.5 V) MIN.
CHAPTER 6 CLOCK GENERATOR 6.4 System Clock Oscillator 6.4.1 X1 oscillator The X1 oscillator oscillates with a crystal resonator or ceramic resonator (2 to 20 MHz) connected to the X1 and X2 pins. An external clock can also be input. In this case, input the clock signal to the EXCLK pin. To use the X1 oscillator, set bits 7 and 6 (EXCLK, OSCSEL) of the clock operation mode control register (CMC) as follows.
Page 205
CHAPTER 6 CLOCK GENERATOR Caution When using the X1 oscillator and XT1 oscillator, wire as follows in the area enclosed by the broken lines in the Figures 6-10 and 6-11 to avoid an adverse effect from wiring capacitance. • Keep the wiring length as short as possible. •...
Page 206
CHAPTER 6 CLOCK GENERATOR Figure 6-12. Examples of Incorrect Resonator Connection (2/2) (c) Wiring near high alternating current (d) Current flowing through ground line of oscillator (potential at points A, B, and C fluctuates) High current (e) Signals are fetched Remark When using the subsystem clock, replace X1 and X2 with XT1 and XT2, respectively.
CHAPTER 6 CLOCK GENERATOR 6.4.3 Internal high-speed oscillator The internal high-speed oscillator is incorporated in the 78K0R/KG3 (8 MHz (TYP.)). Oscillation can be controlled by bit 0 (HIOSTOP) of the clock operation status control register (CSC). After a reset release, the internal high-speed oscillator automatically starts oscillation.
• CPU/peripheral hardware clock f The CPU starts operation when the internal high-speed oscillator starts outputting after a reset release in the 78K0R/KG3, thus enabling the following. (1) Enhancement of security function When the X1 clock is set as the CPU clock by the default setting, the device cannot operate if the X1 clock is damaged or badly connected and therefore does not operate after reset is released.
CHAPTER 6 CLOCK GENERATOR Figure 6-13. Clock Generator Operation When Power Supply Voltage Is Turned On (When LVI Default Start Function Stopped Is Set (Option Byte: LVIOFF = 1)) Power supply 1.8 V voltage (V 1.59 V (TYP.) 0.5 V/ms (MIN.) <1>...
Page 210
CHAPTER 6 CLOCK GENERATOR Cautions 1. If the voltage rises with a slope of less than 0.5 V/ms (MIN.) from power application until the voltage reaches 1.8 V, input a low level to the RESET pin from power application until the voltage reaches 1.8 V, or set the LVI default start function stopped by using the option byte (LVIOFF = 0) (see Figure 6-14).
Page 211
CHAPTER 6 CLOCK GENERATOR Notes 1. The internal reset processing time includes the oscillation accuracy stabilization time of the internal high-speed oscillation clock. When releasing a reset (above figure) or releasing STOP mode while the CPU is operating on the internal high-speed oscillation clock, confirm the oscillation stabilization time for the X1 clock using the oscillation stabilization time counter status register (OSTC).
CHAPTER 6 CLOCK GENERATOR 6.6 Controlling Clock 6.6.1 Example of controlling high-speed system clock The following two types of high-speed system clocks are available. • X1 clock: Crystal/ceramic resonator is connected to the X1 and X2 pins. • External main system clock: External clock is input to the EXCLK pin. When the high-speed system clock is not used, the X1/P121 and X2/EXCLK/P122 pins can be used as input port pins.
CHAPTER 6 CLOCK GENERATOR (2) Example of setting procedure when using the external main system clock <1> Setting P121/X1 and P122/X2/EXCLK pins (CMC register) EXCLK OSCSEL OSCSELS AMPH × Remarks 1. ×: don’t care 2. For setting of the P123/XT1 and P124/XT2 pins, see 6.6.3 (1) Example of setting procedure when oscillating the subsystem clock.
Page 214
CHAPTER 6 CLOCK GENERATOR <3> If some peripheral hardware macros are not used, supply of the input clock to each hardware macro can be stopped. (PER0 register) RTCEN DACEN ADCEN IIC0EN SAU1EN SAU0EN TAU0EN (PER1 register) EXBEN xxxEN Input clock control Stops input clock supply.
CHAPTER 6 CLOCK GENERATOR (b) To stop X1 oscillation (disabling external clock input) by setting MSTOP to 1 <1> Confirming the CPU clock status (CKC register) Confirm with CLS and MCS that the CPU is operating on a clock other than the high-speed system clock.
Page 216
CHAPTER 6 CLOCK GENERATOR <2> Setting the internal high-speed oscillation clock as the source clock of the CPU/peripheral hardware clock and setting the division ratio of the set clock (CKC register) MCM0 MDIV2 MDIV1 MDIV0 Selection of CPU/Peripheral Hardware Clock (f Caution If switching the CPU/peripheral hardware clock from the high-speed system clock to the internal high-speed oscillation clock after restarting the internal high-speed oscillation μ...
CHAPTER 6 CLOCK GENERATOR <2> Stopping the internal high-speed oscillation clock (CSC register) When HIOSTOP is set to 1, internal high-speed oscillation clock is stopped. Caution Be sure to confirm that MCS = 1 or CLS = 1 when setting HIOSTOP to 1. In addition, stop peripheral hardware that is operating on the internal high-speed oscillation clock.
Page 218
CHAPTER 6 CLOCK GENERATOR (2) Example of setting procedure when using the subsystem clock as the CPU clock Note <1> Setting subsystem clock oscillation (See 6.6.3 (1) Example of setting procedure when oscillating the subsystem clock.) Note The setting of <1> is not necessary when while the subsystem clock is operating. <2>...
CHAPTER 6 CLOCK GENERATOR 6.6.4 Example of controlling internal low-speed oscillation clock The internal low-speed oscillation clock cannot be used as the CPU clock. Used only as the watchdog timer clock. The internal low-speed oscillator automatically starts oscillation after a reset release, and the watchdog timer is driven (240 kHz (TYP.)) if the watchdog timer operation is enabled by the option byte.
CHAPTER 6 CLOCK GENERATOR 6.6.5 CPU clock status transition diagram Figure 6-15 shows the CPU clock status transition diagram of this product. Figure 6-15. CPU Clock Status Transition Diagram Internal high-speed oscillation: Woken up Power ON X1 oscillation/EXCLK input: Stops (input port mode) XT1 oscillation: Stops (input port mode) <...
Page 221
CHAPTER 6 CLOCK GENERATOR Table 6-4 shows transition of the CPU clock and examples of setting the SFR registers. Table 6-4. CPU Clock Transition and SFR Register Setting Examples (1/4) (1) CPU operating with internal high-speed oscillation clock (B) after reset release (A) Status Transition SFR Register Setting (A) →...
Page 222
CHAPTER 6 CLOCK GENERATOR Table 6-4. CPU Clock Transition and SFR Register Setting Examples (2/4) (4) CPU clock changing from internal high-speed oscillation clock (B) to high-speed system clock (C) (Setting sequence of SFR registers) Note 1 Setting Flag of SFR Register CMC Register OSTS OSMC...
Page 223
CHAPTER 6 CLOCK GENERATOR Table 6-4. CPU Clock Transition and SFR Register Setting Examples (3/4) (6) CPU clock changing from high-speed system clock (C) to internal high-speed oscillation clock (B) (Setting sequence of SFR registers) Setting Flag of SFR Register CSC Register Oscillation accuracy CKC Register...
Page 224
CHAPTER 6 CLOCK GENERATOR Table 6-4. CPU Clock Transition and SFR Register Setting Examples (4/4) <R> (9) CPU clock changing from subsystem clock (D) to high-speed system clock (C) (Setting sequence of SFR registers) Setting Flag of SFR Register OSTS OSMC OSTC Register...
CHAPTER 6 CLOCK GENERATOR 6.6.6 Condition before changing CPU clock and processing after changing CPU clock Condition before changing the CPU clock and processing after changing the CPU clock are shown below. Table 6-5. Changing CPU Clock (1/2) CPU Clock Condition Before Change Processing After Change Before Change...
Page 226
CHAPTER 6 CLOCK GENERATOR Table 6-5. Changing CPU Clock (2/2) CPU Clock Condition Before Change Processing After Change Before Change After Change Subsystem Internal high- Oscillation of internal high-speed oscillator XT1 oscillation can be stopped (XTSTOP = Note clock speed oscillation and selection of internal high-speed clock oscillation clock as main system clock...
CHAPTER 6 CLOCK GENERATOR 6.6.7 Time required for switchover of CPU clock and main system clock By setting bits 0 to 2, 4, and 6 (MDIV0 to MDIV2, MCM0, CSS) of the system clock control register (CKC), the CPU clock can be switched (between the main system clock and the subsystem clock), main system clock can be switched (between the internal high-speed oscillation clock and the high-speed system clock), and the division ratio of the main system clock can be changed.
CHAPTER 6 CLOCK GENERATOR <R> Table 6-9. Maximum Number of Clocks Required in Type 3 Set Value Before Switchover Set Value After Switchover MAINC 1 + 4 f clock MAINC MAINC 2 + f clock MAINC <R> Remarks 1. f :Internal high-speed oscillation clock frequency :High-speed system clock frequency :Main system clock frequency...
CHAPTER 7 TIMER ARRAY UNIT The timer array unit has eight 16-bit timers per unit. Each 16-bit timer is called a channel and can be used as an independent timer. In addition, two or more “channels” can be used to create a high-accuracy timer. Single-Operation Function Combination Operation Function •...
CHAPTER 7 TIMER ARRAY UNIT 7.1.2 Functions of each channel when it operates with another channel Combination operation functions are those functions that are attained by using the master channel (mostly the reference timer that controls cycles) and the slave channels (timers that operate following the master channel) in combination (for details, refer to 7.6.1 Overview of single-operation function and combination operation function).
CHAPTER 7 TIMER ARRAY UNIT 7.2 Configuration of Timer Array Unit The timer array unit includes the following hardware. Table 7-1. Configuration of Timer Array Unit Item Configuration Timer/counter Timer counter register 0n (TCR0n) Register Timer data register 0n (TDR0n) Timer input TI00 to TI07 pins, RxD3 pin (for LIN-bus) Timer output...
Page 233
CHAPTER 7 TIMER ARRAY UNIT (1) Timer/counter register 0n (TCR0n) TCR0n is a 16-bit read-only register and is used to count clocks. The value of this counter is incremented or decremented in synchronization with the rising edge of a count clock.
Page 234
CHAPTER 7 TIMER ARRAY UNIT The TCR0n register read value differs as follows according to operation mode changes and the operating status. Table 7-2. TCR0n Register Read Value in Various Operation Modes Note Operation Mode Count Mode TCR0n Register Read Value Operation mode Operation mode Operation restart...
Page 235
CHAPTER 7 TIMER ARRAY UNIT (2) Timer data register 0n (TDR0n) This is a 16-bit register from which a capture function and a compare function can be selected. The capture or compare function can be switched by selecting an operation mode by using the MD0n3 to MD0n0 bits of TMR0n.
CHAPTER 7 TIMER ARRAY UNIT 7.3 Registers Controlling Timer Array Unit The timer array unit is controlled by the following registers. • Peripheral enable register 0 (PER0) • Timer clock select register 0 (TPS0) • Timer mode register 0n (TMR0n) •...
Page 237
CHAPTER 7 TIMER ARRAY UNIT (1) Peripheral enable register 0 (PER0) PER0 is used to enable or disable use of each peripheral hardware macro. Clock supply to a hardware macro that is not used is stopped in order to reduce the power consumption and noise. When the timer array unit is used, be sure to set bit 0 (TAU0EN) of this register to 1.
Page 238
CHAPTER 7 TIMER ARRAY UNIT (2) Timer clock select register 0 (TPS0) TPS0 is a 16-bit register that is used to select two types of operation clocks (CK00, CK01) that are commonly supplied to each channel. CK01 is selected by bits 7 to 4 of TPS0, and CK00 is selected by bits 3 to 0. Rewriting of TPS0 during timer operation is possible only in the following cases.
Page 239
CHAPTER 7 TIMER ARRAY UNIT (3) Timer mode register 0n (TMR0n) TMR0n sets an operation mode of channel n. It is used to select an operation clock (MCK), a count clock, whether the timer operates as the master or a slave, a start trigger and a capture trigger, the valid edge of the timer input, and an operation mode (interval, capture, event counter, one-count, or capture &...
Page 240
CHAPTER 7 TIMER ARRAY UNIT Figure 7-6. Format of Timer Mode Register 0n (TMR0n) (2/3) Address: F0190H, F0191H (TMR00) to F019EH, F019FH (TMR07) After reset: 0000H Symbol TMR0n MAST ER0n Setting of start trigger or capture trigger of channel n Only software trigger start is valid (other trigger sources are unselected).
Page 241
CHAPTER 7 TIMER ARRAY UNIT Figure 7-6. Format of Timer Mode Register 0n (TMR0n) (3/3) Address: F0190H, F0191H (TMR00) - F019EH, F019FH (TMR07) After reset: 0000H Symbol TMR0n MAST ER0n Operation mode of channel n Count operation of TCR Independent operation Interval timer mode Counting down Possible...
Page 242
CHAPTER 7 TIMER ARRAY UNIT (4) Timer status register 0n (TSR0n) TSR0n indicates the overflow status of the counter of channel n. TSR0n is valid only in the capture mode (MD0n3 to MD0n1 = 010B) and capture & one-count mode (MD0n3 to MD0n1 = 110B).
Page 243
CHAPTER 7 TIMER ARRAY UNIT (5) Timer channel enable status register 0 (TE0) TE0 is used to enable or stop the timer operation of each channel. When a bit of timer channel start register 0 (TS0) is set to 1, the corresponding bit of this register is set to 1. When a bit of timer channel stop register 0 (TT0) is set to 1, the corresponding bit of this register is cleared to TE0 can be read by a 16-bit memory manipulation instruction.
Page 244
CHAPTER 7 TIMER ARRAY UNIT (6) Timer channel start register 0 (TS0) TS0 is a trigger register that is used to clear a timer counter (TCR0n) and start the counting operation of each channel. When a bit (TS0n) of this register is set to 1, the corresponding bit (TE0n) of timer channel enable status register 0 (TE0) is set to 1.
Page 245
CHAPTER 7 TIMER ARRAY UNIT Table 7-4. Operations from Count Operation Enabled State to TCR0n Count Start (2/2) Timer operation mode Operation when TS0n = 1 is set • One-count mode When TS0n = 0, writing 1 to TS0n bit sets the start trigger wait state. No operation is carried out from start trigger detection until count clock generation.
Page 246
CHAPTER 7 TIMER ARRAY UNIT (b) Start timing in event counter mode <1> While TE0n is set to 0, TCR0n holds the initial value. <2> Writing 1 to TS0n sets 1 to TE0n. <3> As soon as 1 has been written to TS0n and 1 has been set to TE0n, the "TDR0n value" is loaded to TCR0n to start counting.
Page 247
CHAPTER 7 TIMER ARRAY UNIT (d) Start timing in one-count mode <1> Writing 1 to TS0n sets TE0n = 1 <2> Enters the start trigger input wait status, and TCR0n holds the initial value. <3> On start trigger detection, the “TDR0n value” is loaded to TCR0n and count starts. Figure 7-13.
Page 248
CHAPTER 7 TIMER ARRAY UNIT (e) Start timing in capture & one-count mode <1> Writing 1 to TS0n sets TE0n = 1 <2> Enters the start trigger input wait status, and TCR0n holds the initial value. <3> On start trigger detection, 0000H is loaded to TCR0n and count starts. Figure 7-14.
Page 249
CHAPTER 7 TIMER ARRAY UNIT (7) Timer channel stop register 0 (TT0) TT0 is a trigger register that is used to clear a timer counter (TCR0n) and start the counting operation of each channel. When a bit (TT0n) of this register is set to 1, the corresponding bit (TE0n) of timer channel enable status register 0 (TE0) is cleared to 0.
Page 250
CHAPTER 7 TIMER ARRAY UNIT (8) Timer input select register 0 (TIS0) TIS0 is used to select whether a signal input to the timer input pin (TI0n) or the subsystem clock divided by four /4) is valid for each channel. TIS0 can be set by a 1-bit or 8-bit memory manipulation instruction.
Page 251
CHAPTER 7 TIMER ARRAY UNIT (10) Timer output register 0 (TO0) TO0 is a buffer register of timer output of each channel. The value of each bit in this register is output from the timer output pin (TO0n) of each channel. This register can be rewritten by software only when timer output is disabled (TOE0n = 0).
Page 252
CHAPTER 7 TIMER ARRAY UNIT (11) Timer output level register 0 (TOL0) TOL0 is a register that controls the timer output level of each channel. The setting of the inverted output of channel n by this register is reflected at the timing of set or reset of the timer output signal while the timer output is enabled (TOE0n = 1) in the combination operation mode (TOM0n = 1).
Page 253
CHAPTER 7 TIMER ARRAY UNIT (12) Timer output mode register 0 (TOM0) TOM0 is used to control the timer output mode of each channel. When a channel is used for the single-operation function, set the corresponding bit of the channel to be used to 0.
Page 254
CHAPTER 7 TIMER ARRAY UNIT (13) Input switch control register (ISC) ISC is used to implement LIN-bus communication operation with channel 7 in association with serial array unit When bit 1 of this register is set to 1, the input signal of the serial data input pin (RxD3) is selected as a timer input signal.
Page 255
CHAPTER 7 TIMER ARRAY UNIT Figure 7-22. Format of Noise Filter Enable Register 1 (NFEN1) Address: F0061H After reset: 00H Symbol NFEN1 TNFEN07 TNFEN06 TNFEN05 TNFEN04 TNFEN03 TNFEN02 TNFEN01 TNFEN00 Note Enable/disable using noise filter of TI07/TO07/P145 pin or RxD3/P14/EX26 pin input signal TNFEN07 Noise filter OFF Noise filter ON...
Page 256
CHAPTER 7 TIMER ARRAY UNIT (15) Port mode registers 0, 1, 3, 4, 13, 14 (PM0, PM1, PM3, PM4, PM13, PM14) These registers set input/output of ports 0, 1, 3, 4, 13, and 14 in 1-bit units. When using the P01/TO00, P16/TO01/TI01/INTP5/EX30, P17/TO02/TI02/EX31, P31/TO03/TI03/INTP4, P42/TO04/TI04, P46/TO05/TI05/INTP1, P131/TO06/TI06, and P145/TO07/TI07 pins for timer output, set PM01, PM16, PM17, PM31, PM42, PM46, PM131, and PM145 and the output latches of P01, P16, P17, P31, P42, P46, P131, and P145 to 0.
CHAPTER 7 TIMER ARRAY UNIT 7.4.2 TO0n pin output setting The following figure shows the procedure and status transition of TO0n out put pin from initial setting to timer operation start. Figure 7-25. Status Transition from Timer Output Setting to Operation Start TCR0n Undefined value (FFFFH after reset) (Counter)
Page 259
CHAPTER 7 TIMER ARRAY UNIT (2) Default level of TO0n pin and output level after timer operation start The following figure shows the TO0n pin output level transition when writing has been done in the state of TOE0n = 0 before port output is enabled and TOE0n = 1 is set after changing the default level. (a) When operation starts with TOM0n = 0 setting (toggle output) The setting of TOL0n is invalid when TOM0n = 0.
Page 260
CHAPTER 7 TIMER ARRAY UNIT (b) When operation starts with TOM0n = 1 setting (Combination operation mode (PWM output)) When TOM0n = 1, the active level is determined by TOL0n setting. Figure 7-27. TO0n Pin Output Status at PWM Output (TOM0n = 1) TOE0n Default level, TOL0n setting TO0n = 0, TOL0n = 0...
Page 261
CHAPTER 7 TIMER ARRAY UNIT (b) Set/reset timing To realize 0%/100% output at PWM output, the TO0n pin/TO0n set timing at master channel timer interrupt (INTTM0n) generation is delayed by 1 count clock by the slave channel. If the set condition and reset condition are generated at the same time, a higher priority is given to the latter.
CHAPTER 7 TIMER ARRAY UNIT 7.4.4 Collective manipulation of TO0n bits In the TO0 register, the setting bits for all the channels are located in one register in the same way as the TS0 register (channel start trigger). Therefore, TO0n of all the channels can be manipulated collectively. Only specific bits can also be manipulated by setting the corresponding TOE0n = 0 to a target TO0n (channel output).
CHAPTER 7 TIMER ARRAY UNIT Caution When TOE0n = 1, even if the output by timer interrupt of each timer (INTTM0n) contends with writing to TO0n, output is normally done to TO0n pin. Remark n = 0 to 7 7.4.5 Timer interrupt and TO0n pin output at count operation start In the interval timer mode or capture mode, the MD0n0 bit in the TMR0n register sets whether or not to generate a timer interrupt at count start.
CHAPTER 7 TIMER ARRAY UNIT 7.6 Basic Function of Timer Array Unit 7.6.1 Overview of single-operation function and combination operation function The timer array unit consists of several channels and has a single-operation function that allows each channel to operate independently, and a combination operation function that uses two or more channels in combination. The single-operation function can be used for any channel, regardless of the operation mode of the other channels.
CHAPTER 7 TIMER ARRAY UNIT 7.6.3 Applicable range of basic rules of combination operation function The rules of the combination operation function are applied in a channel group (a master channel and slave channels forming one combination operation function). If two or more channel groups that do not operate in combination are specified, the basic rules of the combination operation function in 7.6.2 Basic rules of combination operation function do not apply to the channel groups.
CHAPTER 7 TIMER ARRAY UNIT 7.7 Operation of Timer Array Unit as Independent Channel 7.7.1 Operation as interval timer/square wave output (1) Interval timer The timer array unit can be used as a reference timer that generates INTTM0n (timer interrupt) at fixed intervals.
Page 268
CHAPTER 7 TIMER ARRAY UNIT Figure 7-35. Block Diagram of Operation as Interval Timer/Square Wave Output CK01 Operation clock CK00 Timer counter Output TO0n pin (TCR0n) controller Interrupt Data register Interrupt signal TS0n controller (TDR0n) (INTTM0n) Figure 7-36. Example of Basic Timing of Operation as Interval Timer/Square Wave Output (MD0n0 = 1) TS0n TE0n TCR0n...
Page 269
CHAPTER 7 TIMER ARRAY UNIT Figure 7-37. Example of Set Contents of Registers During Operation as Interval Timer/Square Wave Output (1/3) (1) When CK00 or CK01 is selected as count clock (a) Timer mode register 0n (TMR0n) TMR0n CKS0n CCS0n STS0n2 STS0n1 STS0n0...
Page 270
CHAPTER 7 TIMER ARRAY UNIT Figure 7-37. Example of Set Contents of Registers During Operation as Interval Timer/Square Wave Output (2/3) (2) When f /4 is selected as count clock (a) Timer mode register 0n (TMR0n) TMR0n CKS0n CCS0n STS0n2 STS0n1 STS0n0 CIS0n1...
Page 271
CHAPTER 7 TIMER ARRAY UNIT Figure 7-37. Example of Set Contents of Registers During Operation as Interval Timer/Square Wave Output (3/3) (2) When f /4 is selected as count clock (continued) (e) Timer output enable register 0 (TOE0) Bit n TOE0 0: Stops the TO0n output operation by counting operation.
Page 272
CHAPTER 7 TIMER ARRAY UNIT Figure 7-38. Operation Procedure of Interval Timer/Square Wave Output Function Software Operation Hardware Status Power-off status default (Clock supply is stopped and writing to each register is setting disabled.) Sets the TAU0EN bit of the PER0 register to 1. Power-on status.
CHAPTER 7 TIMER ARRAY UNIT 7.7.2 Operation as external event counter The timer array unit can be used as an external event counter that counts the number of times the valid input edge (external event) is detected in the TI0n pin. When a specified count value is reached, the event counter generates an interrupt.
Page 274
CHAPTER 7 TIMER ARRAY UNIT Figure 7-41. Example of Set Contents of Registers in External Event Counter Mode (a) Timer mode register 0n (TMR0n) TMR0n CKS0n CCS0n STS0n2 STS0n1 STS0n0 CIS0n1 CIS0n0 MD0n3 MD0n2 MD0n1 MD0n0 TER0n Operation mode of channel n 011B: Event count mode Setting of operation when counting is started 0: Neither generates INTTM0n nor inverts...
Page 275
CHAPTER 7 TIMER ARRAY UNIT Figure 7-42. Operation Procedure When External Event Counter Function Is Used Software Operation Hardware Status Power-off status default (Clock supply is stopped and writing to each register is setting disabled.) Sets the TAU0EN bit of the PER0 register to 1. Power-on status.
CHAPTER 7 TIMER ARRAY UNIT 7.7.3 Operation as frequency divider (channel 0 only) The timer array unit can be used as a frequency divider that divides a clock input to the TI00 pin and outputs the result from TO00. The divided clock frequency output from TO00 can be calculated by the following expression. •...
Page 277
CHAPTER 7 TIMER ARRAY UNIT Figure 7-44. Example of Basic Timing of Operation as Frequency Divider (MD000 = 1) TS00 TE00 TI00 TCR00 0000H TDR00 0002H 0001H TO00 INTTM00 Divided Divided by 6 by 4 User’s Manual U17894EJ9V0UD...
Page 278
CHAPTER 7 TIMER ARRAY UNIT Figure 7-45. Example of Set Contents of Registers When Frequency Divider Is Used (a) Timer mode register 00 (TMR00) TMR00 CKS00 CCS00 STS002 STS001 STS000 CIS001 CIS000 MD003 MD002 MD001 MD000 TER00 Operation mode of channel 0 000B: Interval timer Setting of operation when counting is started 0: Neither generates INTTM00 nor inverts...
Page 279
CHAPTER 7 TIMER ARRAY UNIT Figure 7-46. Operation Procedure When Frequency Divider Function Is Used Software Operation Hardware Status Power-off status default (Clock supply is stopped and writing to each register is setting disabled.) Sets the TAU0EN bit of the PER0 register to 1. Power-on status.
CHAPTER 7 TIMER ARRAY UNIT 7.7.4 Operation as input pulse interval measurement The count value can be captured at the TI0n valid edge and the interval of the pulse input to TI0n can be measured. The pulse interval can be calculated by the following expression. TI0n input pulse interval = Period of count clock ×...
Page 281
CHAPTER 7 TIMER ARRAY UNIT Figure 7-48. Example of Basic Timing of Operation as Input Pulse Interval Measurement (MD0n0 = 0) TS0n TE0n TI0n FFFFH TCR0n 0000H TDR0n 0000H INTTM0n Remark n = 0 to 7 User’s Manual U17894EJ9V0UD...
Page 282
CHAPTER 7 TIMER ARRAY UNIT Figure 7-49. Example of Set Contents of Registers to Measure Input Pulse Interval (a) Timer mode register 0n (TMR0n) TMR0n CKS0n CCS0n STS0n2 STS0n1 STS0n0 CIS0n1 CIS0n0 MD0n3 MD0n2 MD0n1 MD0n0 TER0n Operation mode of channel n 010B: Capture mode Setting of operation when counting is started 0: Does not generate INTTM0n when...
Page 283
CHAPTER 7 TIMER ARRAY UNIT Figure 7-50. Operation Procedure When Input Pulse Interval Measurement Function Is Used Software Operation Hardware Status Power-off status default (Clock supply is stopped and writing to each register is setting disabled.) Sets the TAU0EN bit of the PER0 register to 1. Power-on status.
CHAPTER 7 TIMER ARRAY UNIT 7.7.5 Operation as input signal high-/low-level width measurement By starting counting at one edge of TI0n and capturing the number of counts at another edge, the signal width (high-level width/low-level width) of TI0n can be measured. The signal width of TI0n can be calculated by the following expression.
Page 285
CHAPTER 7 TIMER ARRAY UNIT Figure 7-52. Example of Basic Timing of Operation as Input Signal High-/Low-Level Width Measurement TS0n TE0n TI0n FFFFH TCR0n 0000H TDR0n 0000H INTTM0n Remark n = 0 to 7 User’s Manual U17894EJ9V0UD...
Page 286
CHAPTER 7 TIMER ARRAY UNIT Figure 7-53. Example of Set Contents of Registers to Measure Input Signal High-/Low-Level Width (a) Timer mode register 0n (TMR0n) TMR0n CKS0n CCS0n STS0n2 STS0n1 STS0n0 CIS0n1 CIS0n0 MD0n3 MD0n2 MD0n1 MD0n0 TER0n Operation mode of channel n 110B: Capture &...
Page 287
CHAPTER 7 TIMER ARRAY UNIT Figure 7-54. Operation Procedure When Input Signal High-/Low-Level Width Measurement Function Is Used Software Operation Hardware Status Power-off status default (Clock supply is stopped and writing to each register is setting disabled.) Sets the TAU0EN bit of the PER0 register to 1. Power-on status.
CHAPTER 7 TIMER ARRAY UNIT 7.8 Operation of Plural Channels of Timer Array Unit 7.8.1 Operation as PWM function Two channels can be used as a set to generate a pulse of any period and duty factor. The period and duty factor of the output pulse can be calculated by the following expressions. Pulse period = {Set value of TDR0n (master) + 1} ×...
Page 289
CHAPTER 7 TIMER ARRAY UNIT Figure 7-55. Block Diagram of Operation as PWM Function Master channel (interval timer mode) CK01 Operation clock Timer counter (TCR0n) CK00 Data register Interrupt Interrupt signal TS0n (TDR0n) controller (INTTM0n) Slave channel (one-count mode) CK01 Operation clock Timer counter Output...
Page 290
CHAPTER 7 TIMER ARRAY UNIT Figure 7-56. Example of Basic Timing of Operation as PWM Function TS0n TE0n FFFFH Master TCR0n channel 0000H TDR0n TO0n INTTM0n TS0m TE0m FFFFH TCR0m Slave 0000H channel TDR0m TO0m INTTM0m Remark n = 0, 2, 4, 6 m = n + 1 User’s Manual U17894EJ9V0UD...
Page 291
CHAPTER 7 TIMER ARRAY UNIT Figure 7-57. Example of Set Contents of Registers When PWM Function (Master Channel) Is Used (a) Timer mode register 0n (TMR0n) TMR0n CKS0n CCS0n STS0n2 STS0n1 STS0n0 CIS0n1 CIS0n0 MD0n3 MD0n2 MD0n1 MD0n0 TER0n Operation mode of channel n 000B: Interval timer Setting of operation when counting is started 1: Generates INTTM0n when counting is...
Page 292
CHAPTER 7 TIMER ARRAY UNIT Figure 7-58. Example of Set Contents of Registers When PWM Function (Slave Channel) Is Used (a) Timer mode register 0m (TMR0m) TMR0m CKS0m CCS0m STS0m2 STS0m1 STS0m0 CIS0m1 CIS0m0 MD0m3 MD0m2 MD0m1 MD0m0 TER0 Operation mode of channel m 100B: One-count mode Start trigger during operation 1: Trigger input is valid.
Page 293
CHAPTER 7 TIMER ARRAY UNIT Figure 7-59. Operation Procedure When PWM Function Is Used (1/2) Software Operation Hardware Status Power-off status default (Clock supply is stopped and writing to each register is setting disabled.) Sets the TAU0EN bit of the PER0 register to 1. Power-on status.
Page 294
CHAPTER 7 TIMER ARRAY UNIT Figure 7-59. Operation Procedure When PWM Function Is Used (2/2) Software Operation Hardware Status Operation Sets TOE0m (slave) to 1 (only when operation is start resumed). The TS0n (master) and TS0m (slave) bits of the TS0 TE0n = 1, TE0m = 1 register are set to 1 at the same time.
CHAPTER 7 TIMER ARRAY UNIT 7.8.2 Operation as one-shot pulse output function By using two channels as a set, a one-shot pulse having any delay pulse width can be generated from the signal input to the TI0n pin. The delay time and pulse width can be calculated by the following expressions. Delay time = {Set value of TDR0n (master) + 2} ×...
Page 296
CHAPTER 7 TIMER ARRAY UNIT Figure 7-60. Block Diagram of Operation as One-Shot Pulse Output Function Master channel (one-count mode) CK01 Operation clock Timer counter (TCR0n) CK00 TS0n Data register Interrupt Interrupt signal (TDR0n) controller Edge (INTTM0n) TI0n pin detection Slave channel (one-count mode) CK01...
Page 297
CHAPTER 7 TIMER ARRAY UNIT Figure 7-61. Example of Basic Timing of Operation as One-Shot Pulse Output Function TS0n TE0n TI0n Master FFFFH channel TCR0n 0000H TDR0n TO0n INTTM0n TS0m TE0m FFFFH TCR0m Slave 0000H channel TDR0m TO0m INTTM0m a + 2 a + 2 Remark n = 0, 2, 4, 6...
Page 298
CHAPTER 7 TIMER ARRAY UNIT Figure 7-62. Example of Set Contents of Registers When One-Shot Pulse Output Function Is Used (Master Channel) (a) Timer mode register 0n (TMR0n) TMR0n CKS0n CCS0n STS0n2 STS0n1 STS0n0 CIS0n1 CIS0n0 MD0n3 MD0n2 MD0n1 MD0n0 TER0n Operation mode of channel n 100B: One-count mode...
Page 299
CHAPTER 7 TIMER ARRAY UNIT Figure 7-63. Example of Set Contents of Registers When One-Shot Pulse Output Function Is Used (Slave Channel) (a) Timer mode register 0m (TMR0m) TMR0m CKS0m CCS0m STS0m2 STS0m1 STS0m0 CIS0m1 CIS0m0 MD0m3 MD0m2 MD0m1 MD0m0 TER0 Operation mode of channel m 100B: One-count mode...
Page 300
CHAPTER 7 TIMER ARRAY UNIT Figure 7-64. Operation Procedure of One-Shot Pulse Output Function (1/2) Software Operation Hardware Status Power-off status default (Clock supply is stopped and writing to each register is setting disabled.) Sets the TAU0EN bit of the PER0 register to 1. Power-on status.
Page 301
CHAPTER 7 TIMER ARRAY UNIT Figure 7-64. Operation Procedure of One-Shot Pulse Output Function (2/2) Software Operation Hardware Status Operation Sets TOE0m (slave) to 1 (only when operation is start resumed). The TS0n (master) and TS0m (slave) bits of the TS0 register are set to 1 at the same time.
CHAPTER 7 TIMER ARRAY UNIT 7.8.3 Operation as multiple PWM output function By extending the PWM function and using two or more slave channels, many PWM output signals can be produced. For example, when using two slave channels, the period and duty factor of an output pulse can be calculated by the following expressions.
Page 303
CHAPTER 7 TIMER ARRAY UNIT Figure 7-65. Block Diagram of Operation as Multiple PWM Output Function (Output Two Types of PWMs) Master channel (interval timer mode) CK01 Operation clock Timer counter (TCR0n) CK00 Data register Interrupt Interrupt signal TS0n (TDR0n) controller (INTTM0n) Slave channel 1...
Page 304
CHAPTER 7 TIMER ARRAY UNIT Figure 7-66. Example of Basic Timing of Operation as Multiple PWM Output Function (Output Two Types of PWMs) TS0n TE0n FFFFH Master TCR0n channel 0000H TDR0n TO0n INTTM0n TS0p TE0p FFFFH TCR0p Slave 0000H channel 1 TDR0p TO0p INTTM0p...
Page 305
CHAPTER 7 TIMER ARRAY UNIT Figure 7-67. Example of Set Contents of Registers When Multiple PWM Output Function (Master Channel) Is Used (a) Timer mode register 0n (TMR0n) TMR0n CKS0n CCS0n STS0n2 STS0n1 STS0n0 CIS0n1 CIS0n0 MD0n3 MD0n2 MD0n1 MD0n0 TER0n Operation mode of channel n 000B: Interval timer...
Page 306
CHAPTER 7 TIMER ARRAY UNIT Figure 7-68. Example of Set Contents of Registers When Multiple PWM Output Function (Slave Channel) Is Used (Output Two Types of PWMs) (a) Timer mode registers 0p, 0q (TMR0p, TMR0q) TMR0p CKS0p CCS0p STS0p2 STS0p1 STS0p0 CIS0p1 CIS0p0...
Page 307
CHAPTER 7 TIMER ARRAY UNIT Figure 7-69. Operation Procedure When Multiple PWM Output Function Is Used (1/2) Software Operation Hardware Status Power-off status default (Clock supply is stopped and writing to each register is setting disabled.) Sets the TAU0EN bit of the PER0 register to 1. Power-on status.
Page 308
CHAPTER 7 TIMER ARRAY UNIT Figure 7-69. Operation Procedure When Multiple PWM Output Function Is Used (2/2) Software Operation Hardware Status Operation Sets TOE0p and TOE0q (slave) to 1 (only when start operation is resumed). The TS0n bit (master), and TS0p and TS0q (slave) bits of TE0n = 1, TE0p, TE0q = 1 the TS0 register are set to 1 at the same time.
CHAPTER 8 REAL-TIME COUNTER 8.1 Functions of Real-Time Counter The real-time counter has the following features. • Having counters of year, month, week, day, hour, minute, and second, and can count up to 99 years. • Constant-period interrupt function (period: 1 month to 0.5 seconds) •...
CHAPTER 8 REAL-TIME COUNTER 8.3 Registers Controlling Real-Time Counter The real-time counter is controlled by the following 18 registers. • Peripheral enable register 0 (PER0) • Real-time counter control register 0 (RTCC0) • Real-time counter control register 1 (RTCC1) • Real-time counter control register 2 (RTCC2) •...
Page 312
CHAPTER 8 REAL-TIME COUNTER (1) Peripheral enable register 0 (PER0) PER0 is used to enable or disable use of each peripheral hardware macro. Clock supply to a hardware macro that is not used is stopped in order to reduce the power consumption and noise. When the real-time counter is used, be sure to set bit 7 (RTCEN) of this register to 1.
Page 313
CHAPTER 8 REAL-TIME COUNTER Figure 8-3. Format of Real-Time Counter Control Register 0 (RTCC0) Address: FFF9DH After reset: 00H Symbol <7> <5> <4> RTCC0 RTCE RCLOE1 RCLOE0 AMPM RTCE Real-time counter operation control Stops counter operation. Starts counter operation. RCLOE1 RTC1HZ pin output control Disables output of RTC1HZ pin (1 Hz).
Page 314
CHAPTER 8 REAL-TIME COUNTER (3) Real-time counter control register 1 (RTCC1) The RTCC1 register is an 8-bit register that is used to control the alarm interrupt function and the wait time of the counter. RTCC1 can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation clears this register to 00H.
Page 315
CHAPTER 8 REAL-TIME COUNTER Figure 8-4. Format of Real-Time Counter Control Register 1 (RTCC1) (2/2) RIFG Constant-period interrupt status flag Constant-period interrupt is not generated. Constant-period interrupt is generated. This flag indicates the status of generation of the constant-period interrupt. When the constant-period interrupt is generated, it is set to “1”.
Page 316
CHAPTER 8 REAL-TIME COUNTER (4) Real-time counter control register 2 (RTCC2) The RTCC2 register is an 8-bit register that is used to control the interval interrupt function and the RTCDIV pin. RTCC2 can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation clears this register to 00H.
Page 317
CHAPTER 8 REAL-TIME COUNTER (5) Sub-count register (RSUBC) The RSUBC register is a 16-bit register that counts the reference time of 1 second of the real-time counter. It takes a value of 0000H to 7FFFH and counts 1 second with a clock of 32.768 kHz. RSUBC can be set by a 16-bit memory manipulation instruction.
Page 318
CHAPTER 8 REAL-TIME COUNTER (7) Minute count register (MIN) The MIN register is an 8-bit register that takes a value of 0 to 59 (decimal) and indicates the count value of minutes. It counts up when the second counter overflows. When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks (32.768 kHz) later.
Page 319
CHAPTER 8 REAL-TIME COUNTER Table 8-2. Displayed Time Digits 24-Hour Display (AMPM Bit = 1) 12-Hour Display (AMPM Bit = 0) Time HOUR Register Time HOUR Register 0 a.m. 1 a.m. 2 a.m. 3 a.m. 4 a.m. 5 a.m. 6 a.m. 7 a.m.
Page 320
CHAPTER 8 REAL-TIME COUNTER (9) Day count register (DAY) The DAY register is an 8-bit register that takes a value of 1 to 31 (decimal) and indicates the count value of days. It counts up when the hour counter overflows. This counter counts as follows.
Page 321
CHAPTER 8 REAL-TIME COUNTER (10) Week count register (WEEK) The WEEK register is an 8-bit register that takes a value of 0 to 6 (decimal) and indicates the count value of weekdays. It counts up in synchronization with the day counter. When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks (32.768 kHz) later.
Page 322
CHAPTER 8 REAL-TIME COUNTER (11) Month count register (MONTH) The MONTH register is an 8-bit register that takes a value of 1 to 12 (decimal) and indicates the count value of months. It counts up when the day counter overflows. When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks (32.768 kHz) later.
CHAPTER 8 REAL-TIME COUNTER (13) Watch error correction register (SUBCUD) This register is used to correct the watch with high accuracy when it is slow or fast by changing the value (reference value: 7FFFH) that overflows from the sub-count register (RSUBC) to the second count register. SUBCUD can be set by an 8-bit memory manipulation instruction.
Page 324
CHAPTER 8 REAL-TIME COUNTER (14) Alarm minute register (ALARMWM) This register is used to set minutes of alarm. ALARMWM can be set by an 8-bit memory manipulation instruction. Reset signal generation clears this register to 00H. Caution Set a decimal value of 00 to 59 to this register in BCD code. If a value outside the range is set, the alarm is not detected.
Page 325
CHAPTER 8 REAL-TIME COUNTER Here is an example of setting the alarm. Time of Alarm 12-Hour Display 24-Hour Display Sunday Friday Hour Hour Minute Minute Hour Hour Minute Minute Monday Tuesday Thursday Saturday Wednesday Every day, 0:00 a.m. Every day, 1:30 a.m. Every day, 11:59 a.m.
CHAPTER 8 REAL-TIME COUNTER 8.4.2 Shifting to STOP mode after starting operation Perform one of the following processing when shifting to STOP mode immediately after setting RTCE to 1. However, after setting RTCE to 1, this processing is not required when shifting to STOP mode after the first INTRTC interrupt has occurred.
CHAPTER 8 REAL-TIME COUNTER 8.4.3 Reading/writing real-time counter Read or write the counter after setting 1 to RWAIT first. Figure 8-21. Procedure for Reading Real-Time Counter Start Stops SEC to YEAR counters. RWAIT = 1 Mode to read and write count values RWST = 1? Checks wait status of counter.
Page 329
CHAPTER 8 REAL-TIME COUNTER Figure 8-22. Procedure for Writing Real-Time Counter Start Stops SEC to YEAR counters. RWAIT = 1 Mode to read and write count values RWST = 1? Checks wait status of counter. Writing SEC Writes second count register. Writing MIN Writes minute count register.
CHAPTER 8 REAL-TIME COUNTER 8.4.4 Setting alarm of real-time counter Set time of alarm after setting 0 to WALE first. Figure 8-23. Alarm Setting Procedure Start Match operation of alarm is invalid. WALE = 0 Interrupt is generated when alarm matches. WALIE = 1 Setting ALARMWM Sets alarm minute register.
CHAPTER 8 REAL-TIME COUNTER 8.4.8 Example of watch error correction of real-time counter The watch can be corrected with high accuracy when it is slow or fast, by setting a value to the watch error correction register. Example of calculating the correction value The correction value used when correcting the count value of the sub-count register (RSUBC) is calculated by using the following expression.
Page 333
CHAPTER 8 REAL-TIME COUNTER Correction example <1> Example of correcting from 32772.3 Hz to 32768 Hz (32772.3 Hz − 131.2 ppm) [Measuring the oscillation frequency] Note The oscillation frequency of each product is measured by outputting about 32 kHz from the RTCCL pin or outputting about 1 Hz from the RTC1HZ pin when the watch error correction register is set to its initial value (00H).
Page 335
CHAPTER 8 REAL-TIME COUNTER Correction example <2> Example of correcting from 32767.4 Hz to 32768 Hz (32767.4 Hz + 18.3 ppm) [Measuring the oscillation frequency] Note The oscillation frequency of each product is measured by outputting about 32 kHz from the RTCCL pin or outputting about 1 Hz from the RTC1HZ pin when the watch error correction register is set to its initial value (00H).
CHAPTER 9 WATCHDOG TIMER 9.1 Functions of Watchdog Timer The watchdog timer operates on the internal low-speed oscillation clock. The watchdog timer is used to detect an inadvertent program loop. If a program loop is detected, an internal reset signal is generated. Program loop is detected in the following cases.
CHAPTER 9 WATCHDOG TIMER 9.2 Configuration of Watchdog Timer The watchdog timer includes the following hardware. Table 9-1. Configuration of Watchdog Timer Item Configuration Control register Watchdog timer enable register (WDTE) How the counter operation is controlled, overflow time, window open period, and interval interrupt are set by the option byte.
CHAPTER 9 WATCHDOG TIMER 9.3 Register Controlling Watchdog Timer The watchdog timer is controlled by the watchdog timer enable register (WDTE). (1) Watchdog timer enable register (WDTE) Writing “ACH” to WDTE clears the watchdog timer counter and starts counting again. This register can be set by an 8-bit memory manipulation instruction.
CHAPTER 9 WATCHDOG TIMER 9.4 Operation of Watchdog Timer 9.4.1 Controlling operation of watchdog timer When the watchdog timer is used, its operation is specified by the option byte (000C0H). • Enable counting operation of the watchdog timer by setting bit 4 (WDTON) of the option byte (000C0H) to 1 (the counter starts operating after a reset release) (for details, see CHAPTER 24).
CHAPTER 9 WATCHDOG TIMER Cautions 4. The operation of the watchdog timer in the HALT and STOP modes differs as follows depending on the set value of bit 0 (WDSTBYON) of the option byte (000C0H). WDSTBYON = 0 WDSTBYON = 1 In HALT mode Watchdog timer operation stops.
CHAPTER 9 WATCHDOG TIMER 9.4.3 Setting window open period of watchdog timer Set the window open period of the watchdog timer by using bits 6 and 5 (WINDOW1, WINDOW0) of the option byte (000C0H). The outline of the window is as follows. •...
CHAPTER 9 WATCHDOG TIMER Remarks 1. If the overflow time is set to 2 , the window close time and open time are as follows. Setting of Window Open Period 100% Window close time 0 to 3.56 ms 0 to 2.37 ms 0 to 0.119 ms None Window open time...
CHAPTER 10 CLOCK OUTPUT/BUZZER OUTPUT CONTROLLER 10.1 Functions of Clock Output/Buzzer Output Controller The clock output controller is intended for carrier output during remote controlled transmission and clock output for supply to peripheral ICs. Buzzer output is a function to output a square wave of buzzer frequency. One pin can be used to output a clock or buzzer sound.
CHAPTER 10 CLOCK OUTPUT/BUZZER OUTPUT CONTROLLER (2) Port mode register 14 (PM14) This register sets port 14 input/output in 1-bit units. When using the P140/INTP6/PCLBUZ0 and P141/INTP7/PCLBUZ1 pins for clock output/buzzer output, clear PM140 and PM141 and the output latches of P140 and P141 to 0. PM14 is set by a 1-bit or 8-bit memory manipulation instruction.
CHAPTER 11 A/D CONVERTER 11.1 Function of A/D Converter The A/D converter converts an analog input signal into a digital value, and consists of up to 16 channels (ANI0 to ANI15) with a resolution of 10 bits. The A/D converter has the following function. •...
CHAPTER 11 A/D CONVERTER 11.2 Configuration of A/D Converter The A/D converter includes the following hardware. (1) ANI0 to ANI15 pins These are the analog input pins of the 16-channel A/D converter. They input analog signals to be converted into digital signals.
Page 350
CHAPTER 11 A/D CONVERTER (8) Controller This circuit controls the conversion time of an input analog signal that is to be converted into a digital signal, as well as starting and stopping of the conversion operation. When A/D conversion has been completed, this controller generates INTAD.
CHAPTER 11 A/D CONVERTER 11.3 Registers Used in A/D Converter The A/D converter uses the following seven registers. • Peripheral enable register 0 (PER0) • A/D converter mode register (ADM) • A/D port configuration register (ADPC) • Analog input channel specification register (ADS) •...
Page 352
CHAPTER 11 A/D CONVERTER (2) A/D converter mode register (ADM) This register sets the conversion time for analog input to be A/D converted, and starts/stops conversion. ADM can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation clears this register to 00H. Figure 11-4.
Page 353
CHAPTER 11 A/D CONVERTER Table 11-3. A/D Conversion Time Selection (1) 2.7 V ≤ AV ≤ 5.5 V REF0 A/D Converter Mode Register (ADM) Conversion Time Selection Conversion Clock = 2 MHz = 10 MHz = 20 MHz μ μ 264/f 26.4 13.2...
Page 355
CHAPTER 11 A/D CONVERTER Figure 11-6. A/D Converter Sampling and A/D Conversion Timing ← ADCS 1 or ADS rewrite ADCS Sampling timing INTAD Sampling Successive conversion Sampling Transfer clear to ADCR, clear INTAD generation Conversion time Conversion time User’s Manual U17894EJ9V0UD...
Page 356
CHAPTER 11 A/D CONVERTER (3) 10-bit A/D conversion result register (ADCR) This register is a 16-bit register that stores the A/D conversion result. The lower 6 bits are fixed to 0. Each time A/D conversion ends, the conversion result is loaded from the successive approximation register. The higher 8 bits of the conversion result are stored in FFF1FH and the lower 2 bits are stored in the higher 2 bits of FFF1EH.
Page 357
CHAPTER 11 A/D CONVERTER (5) Analog input channel specification register (ADS) This register specifies the input channel of the analog voltage to be A/D converted. ADS can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation clears this register to 00H. Figure 11-9.
Page 358
CHAPTER 11 A/D CONVERTER (6) A/D port configuration register (ADPC) This register switches the ANI0/P20 to ANI7/P27 and ANI8/P150 to ANI15/P157 pins to analog input of A/D converter or digital I/O of port. ADPC can be set by an 8-bit memory manipulation instruction. Reset signal generation sets this register to 10H.
Page 359
CHAPTER 11 A/D CONVERTER (7) Port mode registers 2 and 15 (PM2, PM15) When using the ANI0/P20 to ANI7/P27 and ANI8/P150 to ANI15/P157 pins for analog input port, set PM20 to PM27 and PM150 to PM157 to 1. The output latches of P20 to P27 and P150 to P157 at this time may be 0 or 1. If PM20 to PM27 and PM150 to PM157 are set to 0, they cannot be used as analog input port pins.
CHAPTER 11 A/D CONVERTER 11.4 A/D Converter Operations 11.4.1 Basic operations of A/D converter <1> Set bit 5 (ADCEN) of peripheral enable register 0 (PER0) to 1 to start the supply of the input clock to the A/D converter. <2> Set bit 0 (ADCE) of the A/D converter mode register (ADM) to 1 to start the operation of the A/D voltage comparator.
Page 361
CHAPTER 11 A/D CONVERTER Figure 11-12. Basic Operation of A/D Converter Conversion time Sampling time A/D converter Sampling A/D conversion operation Conversion Undefined result Conversion ADCR result INTAD A/D conversion operations are performed continuously until bit 7 (ADCS) of the A/D converter mode register (ADM) is reset (0) by software.
CHAPTER 11 A/D CONVERTER 11.4.2 Input voltage and conversion results The relationship between the analog input voltage input to the analog input pins (ANI0 to ANI15) and the theoretical A/D conversion result (stored in the 10-bit A/D conversion result register (ADCR)) is shown by the following expression.
CHAPTER 11 A/D CONVERTER 11.4.3 A/D converter operation mode The operation mode of the A/D converter is the select mode. One channel of analog input is selected from ANI0 to ANI15 by the analog input channel specification register (ADS) and A/D conversion is executed. (1) A/D conversion operation By setting bit 7 (ADCS) of the A/D converter mode register (ADM) to 1, the A/D conversion operation of the voltage, which is applied to the analog input pin specified by the analog input channel specification register...
Page 364
CHAPTER 11 A/D CONVERTER The setting methods are described below. <1> Set bit 5 (ADCEN) of peripheral enable register 0 (PER0) to 1. <2> Set bit 0 (ADCE) of the A/D converter mode register (ADM) to 1. <3> Set the channel to be used in the analog input mode by using bits 4 to 0 (ADPC4 to ADPC0) of the A/D port configuration register (ADPC) and bits 7 to 0 (PM27 to PM20) of port mode register 2 (PM2) and bits 7 to 0 (PM157 to PM150) of port mode register 15 (PM15).
CHAPTER 11 A/D CONVERTER μ 11.5 Temperature Sensor Function (Expanded-Specification Products ( PD78F116xA) Only) A temperature sensor performs A/D conversion for two voltages, an internal reference voltage (sensor 0 on the ANI0 side) that depends on the temperature and an internal reference voltage (sensor 1 on the ANI1 side) that does not depend on the temperature, and calculations, so that the temperature is obtained without depending on the AV REF0 ≥...
CHAPTER 11 A/D CONVERTER 11.5.2 Registers used by temperature sensors The following four types of registers are used when using a temperature sensor. • Peripheral enable register 0 (PER0) • A/D converter mode register (ADM) • Analog input channel specification register (ADS) •...
Page 367
CHAPTER 11 A/D CONVERTER (3) 10-bit A/D conversion result register (ADCR) Use the ADCR register in the same manner as during A/D converter basic operation (see 11.3 (3) 10-bit A/D conversion result register (ADCR)). Caution When using a temperature sensor, use the result of the second or later A/D conversion for temperature sensor 0 (ANI0 side), and the result of the third or later A/D conversion for temperature sensor 1 (ANI1 side).
CHAPTER 11 A/D CONVERTER 11.5.3 Temperature sensor operation (1) Temperature sensor detection value When using a temperature sensor, determine as reference temperatures two points of temperature (high and low) in the temperature range to be used, and measure the result of A/D conversion with temperature sensors 0 and 1 at each reference temperature in advance.
Page 369
CHAPTER 11 A/D CONVERTER (2) How to calculate temperature As shown in Figure 11-17, the temperature sensor detection value makes a characteristics curve that is linear with respect to the temperature. Therefore, the temperature sensor detection value can be expressed with the following expressions.
CHAPTER 11 A/D CONVERTER 11.5.4 Procedures for using temperature sensors (1) Procedure for using temperature sensors <1> Perform the following steps in the same environment as the one in which the temperature sensor is used in a set • When obtaining a temperature through calculation Determine as reference temperatures two points of temperature (high and low) in the temperature range to be used, and measure the result of A/D conversion with temperature sensors 0 and 1 at the reference temperature in advance, before shipment of the set.
Page 371
CHAPTER 11 A/D CONVERTER <Obtaining temperature T > <14> Calculate the temperature by using either of the following methods. • When obtaining a temperature through calculation During measurement at reference temperatures, write ADT0 and ADT1 to the internal flash memory by means such as self programming.
Page 372
CHAPTER 11 A/D CONVERTER Figure 11-18. Flowchart of Procedure for Using Temperature Sensor START ADCEN of PER0 register = 1 <1> Starts the supply of the input clock to A/D converter <2> ADCE of ADM register = 1 Starts the operation of the comparator ADM ←...
CHAPTER 11 A/D CONVERTER 11.6 How to Read A/D Converter Characteristics Table Here, special terms unique to the A/D converter are explained. (1) Resolution This is the minimum analog input voltage that can be identified. That is, the percentage of the analog input voltage per bit of digital output is called 1LSB (Least Significant Bit).
Page 374
CHAPTER 11 A/D CONVERTER (5) Full-scale error This shows the difference between the actual measurement value of the analog input voltage and the theoretical value (Full-scale − 3/2LSB) when the digital output changes from 1..110 to 1..111. (6) Integral linearity error This shows the degree to which the conversion characteristics deviate from the ideal linear relationship.
CHAPTER 11 A/D CONVERTER 11.7 Cautions for A/D Converter (1) Operating current in STOP mode Shift to STOP mode after clearing the A/D converter (by clearing bit 7 (ADCS) of the A/D converter mode register (ADM) to 0). The operating current can be reduced by clearing bit 0 (ADCE) of the A/D converter mode register (ADM) to 0 at the same time.
Page 376
CHAPTER 11 A/D CONVERTER (3) Input range of ANI0 to ANI15 Observe the rated range of the ANI0 to ANI15 input voltage. If a voltage of AV or higher and AV or lower REF0 (even in the range of absolute maximum ratings) is input to an analog input channel, the converted value of that channel becomes undefined.
Page 377
CHAPTER 11 A/D CONVERTER Figure 11-26. Analog Input Pin Connection If there is a possibility that noise equal to or higher than AV REF0 equal to or lower than AV may enter, clamp with a diode with a small V value (0.3 V or lower).
Page 378
CHAPTER 11 A/D CONVERTER (9) Interrupt request flag (ADIF) The interrupt request flag (ADIF) is not cleared even if the analog input channel specification register (ADS) is changed. Therefore, if an analog input pin is changed during A/D conversion, the A/D conversion result and ADIF for the pre-change analog input may be set just before the ADS rewrite.
Page 379
CHAPTER 11 A/D CONVERTER (12) Internal equivalent circuit The equivalent circuit of the analog input block is shown below. Figure 11-28. Internal Equivalent Circuit of ANIn Pin ANIn Table 11-6. Resistance and Capacitance Values of Equivalent Circuit (Reference Values) REF0 4.0 V ≤...
CHAPTER 12 D/A CONVERTER 12.1 Function of D/A Converter The D/A converter has a resolution of 8 bits and converts an input digital signal into an analog signal. It is configured so that output analog signals of two channels (ANO0 and ANO1) can be controlled. The D/A converter has the following features.
Page 381
CHAPTER 12 D/A CONVERTER The D/A converter includes the following hardware. Table 12-1. Configuration of D/A Converter Item Configuration Peripheral enable register 0 (PER0) Control registers D/A converter mode register (DAM) 8-bit D/A conversion value setting registers 0, 1 (DACS0, DACS1) (1) AV REF1 This is the D/A converter reference voltage input pin and the positive power supply pin of P110, P111, and the...
CHAPTER 12 D/A CONVERTER 12.3 Registers Used in D/A Converter The D/A converter uses the following registers. • Peripheral enable register 0 (PER0) • D/A converter mode register (DAM) • 8-bit D/A conversion value setting registers 0, 1 (DACS0, DACS1) •...
Page 383
CHAPTER 12 D/A CONVERTER (2) D/A converter mode register (DAM) This register controls the operation of the D/A converter. DAM can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation clears this register to 00H. Figure 12-3. Format of D/A Converter Mode Register (DAM) Address: FFF32H After reset: 00H Symbol...
Page 384
CHAPTER 12 D/A CONVERTER (4) Port mode register 11 (PM11) This register sets the input or output of port 11 in 1-bit units. When using the P110/ANO0 and P111/ANO1 pins as the analog output function of the D/A converter, set both PM110 and PM111 to 1.
CHAPTER 12 D/A CONVERTER 12.4 Operation of D/A Converter 12.4.1 Operation in normal mode D/A conversion is performed using write operation to the DACSn register as the trigger. The setting method is described below. <1> Set the DAMDn bit of the DAM register to 0 (normal mode). <2>...
CHAPTER 12 D/A CONVERTER 12.4.2 Operation in real-time output mode D/A conversion is performed using the interrupt request signals (INTTM04 and INTTM05) of timer channel 4 and timer channel 5 as triggers. The setting method is described below. <1> Set the DAMDn bit of the DAM register to 1 (real-time output mode). <2>...
CHAPTER 12 D/A CONVERTER 12.4.3 Cautions Observe the following cautions when using the D/A converter of the 78K0R/KG3. (1) The digital port I/O function, which is the alternate function of the ANO0 and ANO1 pins, does not operate during D/A conversion.
The serial array unit has four serial channels per unit and can use two or more of various serial interfaces (3-wire serial (CSI), UART, and simplified I C) in combination. Function assignment of each channel supported by the 78K0R/KG3 is as shown below (channels 2 and 3 of unit 1 are dedicated to UART3 (supporting LIN-bus)). Used as Simplified I...
CHAPTER 13 SERIAL ARRAY UNIT 13.1.2 UART (UART0, UART1, UART2, UART3) This is a start-stop synchronization function using two lines: serial data transmission (T D) and serial data reception (R D) lines. It transmits or receives data in asynchronization with the party of communication (by using an internal baud rate).
CHAPTER 13 SERIAL ARRAY UNIT 13.1.3 Simplified I C (IIC10, IIC20) This is a clocked communication function to communicate with two or more devices by using two lines: serial clock (SCL) and serial data (SDA). This simplified I C is designed for single communication with a device such as EEPROM, flash memory, or A/D converter, and therefore, it functions only as a master and does not have a function to detect wait states.
CHAPTER 13 SERIAL ARRAY UNIT 13.2 Configuration of Serial Array Unit Serial array unit includes the following hardware. Table 13-1. Configuration of Serial Array Unit Item Configuration Shift register 8 bits Note Buffer register Lower 8 bits of serial data register mn (SDRmn) Serial clock I/O SCK00, SCK01, SCK10, SCK20 pins (for 3-wire serial I/O), SCL10, SCL20 pins (for simplified Serial data input...
Page 392
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-1 shows the block diagram of serial array unit 0. Figure 13-1. Block Diagram of Serial Array Unit 0 Noise filter enable Serial output register 0 (SO0) register 0 (NFEN0) SNFEN SNFEN CKO02 CKO01 CKO00 SO02 SO01 SO00 Peripheral enable...
Page 393
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-2 shows the block diagram of serial array unit 1. Figure 13-2. Block Diagram of Serial Array Unit 1 Noise filter enable Serial output register 1 (SO1) register 0 (NFEN0) SNFEN SNFEN CKO10 SO12 SO10 Peripheral enable Serial clock select register 1 (SPS1)
Page 394
CHAPTER 13 SERIAL ARRAY UNIT (1) Shift register This is an 8-bit register that converts parallel data into serial data or vice versa. During reception, it converts data input to the serial pin into parallel data. When data is transmitted, the value set to this register is output as serial data from the serial output pin. The shift register cannot be directly manipulated by program.
Page 395
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-3. Format of Serial Data Register mn (SDRmn) Address: FFF10H, FFF11H (SDR00), FFF12H, FFF13H (SDR01), After reset: 0000H FFF44H, FFF45H (SDR02), FFF46H, FFF47H (SDR03), FFF48H, FFF49H (SDR10), FFF4AH, FFF4BH (SDR11), FFF14H, FFF15H (SDR12), FFF16H, FFF17H (SDR13) FFF11H (SDR00) FFF10H (SDR00) SDRmn...
CHAPTER 13 SERIAL ARRAY UNIT 13.3 Registers Controlling Serial Array Unit Serial array unit is controlled by the following registers. • Peripheral enable register 0 (PER0) • Serial clock select register m (SPSm) • Serial mode register mn (SMRmn) • Serial communication operation setting register mn (SCRmn) •...
Page 397
CHAPTER 13 SERIAL ARRAY UNIT (1) Peripheral enable register 0 (PER0) PER0 is used to enable or disable use of each peripheral hardware macro. Clock supply to a hardware macro that is not used is stopped in order to reduce the power consumption and noise. When serial array unit 0 is used, be sure to set bit 2 (SAU0EN) of this register to 1.
Page 398
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-5. Format of Serial Clock Select Register m (SPSm) Address: F0126H, F0127H (SPS0), F0166H, F0167H (SPS1) After reset: 0000H Symbol SPSm Note 1 Section of operation clock (CKmp) = 2 MHz = 5 MHz = 10 MHz = 20 MHz 2 MHz...
CHAPTER 13 SERIAL ARRAY UNIT (3) Serial mode register mn (SMRmn) SMRmn is a register that sets an operation mode of channel n. It is also used to select an operation clock (MCK), specify whether the serial clock (SCK) may be input or not, set a start trigger, an operation mode (CSI, UART, or I C), and an interrupt source.
Page 400
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-6. Format of Serial Mode Register mn (SMRmn) (2/2) Address: F0110H, F0111H (SMR00) to F0116H, F0117H (SMR03), After reset: 0020H F0150H, F0151H (SMR10), F0152H, F0153H (SMR11), F0154H, F0155H (SMR12), F0156H, F0157H (SMR13) Symbol SMRmn Controls inversion of level of receive data of channel n in UART mode Falling edge is detected as the start bit.
CHAPTER 13 SERIAL ARRAY UNIT (4) Serial communication operation setting register mn (SCRmn) SCRmn is a communication operation setting register of channel n. It is used to set a data transmission/reception mode, phase of data and clock, whether an error signal is to be masked or not, parity bit, start bit, stop bit, and data length.
Page 402
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-7. Format of Serial Communication Operation Setting Register mn (SCRmn) (2/3) Address: F0118H, F0119H (SCR00) to F011EH, F011FH (SCR03), After reset: 0087H F0158H, F0159H (SCR10), F015AH, F015BH (SCR11), F015CH, F015DH (SCR12), F015EH, F015FH (SCR13) Symbol SCRmn Selection of masking of error interrupt signal (INTSREx (x = 0 to 3))
Page 403
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-7. Format of Serial Communication Operation Setting Register mn (SCRmn) (3/3) Address: F0118H, F0119H (SCR00) to F011EH, F011FH (SCR03), After reset: 0087H F0158H, F0159H (SCR10), F015AH, F015BH (SCR11), F015CH, F015DH (SCR12), F015EH, F015FH (SCR13) Symbol SCRmn Setting of data length in CSI and UART modes...
Page 404
CHAPTER 13 SERIAL ARRAY UNIT (5) Higher 7 bits of the serial data register mn (SDRmn) SDRmn is the transmit/receive data register (16 bits) of channel n. Bits 7 to 0 function as a transmit/receive buffer register, and bits 15 to 9 are used as a register that sets the division ratio of the operation clock (MCK). If the CCSmn bit of serial mode register mn (SMRmn) is cleared to 0, the clock set by dividing the operating clock by the higher 7 bits of SDRmn is used as the transfer clock.
CHAPTER 13 SERIAL ARRAY UNIT (6) Serial status register mn (SSRmn) SSRmn is a register that indicates the communication status and error occurrence status of channel n. The errors indicated by this register are a framing error, parity error, and overrun error. SSRmn can be read by a 16-bit memory manipulation instruction.
Page 406
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-9. Format of Serial Status Register mn (SSRmn) (2/2) Address: F0100H, F0101H (SSR00) to F0106H, F0107H (SSR03), After reset: 0000H F0140H, F0141H (SSR10), F0142H, F0143H (SSR11), F0144H, F0145H (SSR12), F0146H, F0147H (SSR13) Symbol SSRmn Framing error detection flag of channel n No error occurs.
Page 407
CHAPTER 13 SERIAL ARRAY UNIT (7) Serial flag clear trigger register mn (SIRmn) SIRmn is a trigger register that is used to clear each error flag of channel n. When each bit (FECTmn, PECTmn, OVCTmn) of this register is set to 1, the corresponding bit (FEFmn, PEFmn, OVFmn) of serial status register mn is cleared to 0.
Page 408
CHAPTER 13 SERIAL ARRAY UNIT (8) Serial channel enable status register m (SEm) SEm indicates whether data transmission/reception operation of each channel is enabled or stopped. When 1 is written a bit of serial channel start register m (SSm), the corresponding bit of this register is set to 1. When 1 is written a bit of serial channel stop register m (STm), the corresponding bit is cleared to 0.
Page 409
CHAPTER 13 SERIAL ARRAY UNIT (9) Serial channel start register m (SSm) SSm is a trigger register that is used to enable starting communication/count by each channel. When 1 is written a bit of this register (SSmn), the corresponding bit (SEmn) of serial channel enable status register m (SEm) is set to 1.
Page 410
CHAPTER 13 SERIAL ARRAY UNIT (10) Serial channel stop register m (STm) STm is a trigger register that is used to enable stopping communication/count by each channel. When 1 is written a bit of this register (STmn), the corresponding bit (SEmn) of serial channel enable status register m (SEm) is cleared to 0.
Page 411
CHAPTER 13 SERIAL ARRAY UNIT (11) Serial output enable register m (SOEm) SOEm is a register that is used to enable or stop output of the serial communication operation of each channel. Channel n that enables serial output cannot rewrite by software the value of SOmn of the serial output register m (SOm) to be described below, and a value reflected by a communication operation is output from the serial data output pin.
Page 412
CHAPTER 13 SERIAL ARRAY UNIT (12) Serial output register m (SOm) SOm is a buffer register for serial output of each channel. The value of bit n of this register is output from the serial data output pin of channel n. The value of bit (n + 8) of this register is output from the serial clock output pin of channel n.
Page 413
CHAPTER 13 SERIAL ARRAY UNIT (13) Serial output level register m (SOLm) SOLm is a register that is used to set inversion of the data output level of each channel. This register can be set only in the UART mode. Be sure to set 0000H in the CSI mode and simplifies I mode.
Page 414
CHAPTER 13 SERIAL ARRAY UNIT (14) Input switch control register (ISC) ISC is used to realize a LIN-bus communication operation by UART3 in coordination with an external interrupt and the timer array unit. When bit 0 is set to 1, the input signal of the serial data input (R D3) pin is selected as an external interrupt (INTP0) that can be used to detect a wakeup signal.
Page 415
CHAPTER 13 SERIAL ARRAY UNIT (15) Noise filter enable register 0 (NFEN0) NFEN0 is used to set whether the noise filter can be used for the input signal from the serial data input pin to each channel. Disable the noise filter of the pin used for CSI or simplified I C communication, by clearing the corresponding bit of this register to 0.
Page 416
CHAPTER 13 SERIAL ARRAY UNIT (16) Port input mode registers 0, 4, 14 (PIM0, PIM4, PIM14) These registers set the input buffer of ports 0, 4, and 14 in 1-bit units. PIM0, PIM4, and PIM14 can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation clears these registers to 00H.
Page 417
CHAPTER 13 SERIAL ARRAY UNIT (18) Port mode registers 0, 1, 4, 14 (PM0, PM1, PM4, PM14) These registers set input/output of ports 0, 1, 4 and 14 in 1-bit units. When using P02/SO10/T P03/SI10/R D1/SDA10, P04/SCK10/SCL10, P10/SCK00/EX24, P12/SO00/T D0/EX26, P13/T D3/EX27, P43/SCK01,...
CHAPTER 13 SERIAL ARRAY UNIT 13.4 Operation Stop Mode Each serial interface of serial array unit has the operation stop mode. In this mode, serial communication cannot be executed, thus reducing the power consumption. addition, P02/SO10/TxD1, P03/SI10/SDA10/RxD1, P04/SCK10/SCL10, P10/SCK00/EX24, P11/SI00/RxD0/EX25, P12/SO00/TxD0/EX26, P13/TxD3/EX27, P43/SCK01,...
CHAPTER 13 SERIAL ARRAY UNIT 13.4.2 Stopping the operation by channels The stopping of the operation by channels is set using each of the following registers. Figure 13-23. Each Register Setting When Stopping the Operation by Channels (1/2) (a) Serial Channel Enable Status Register m (SEm) … This register indicates whether data transmission/reception operation of each channel is enabled or stopped.
Page 420
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-23. Each Register Setting When Stopping the Operation by Channels (2/2) (d) Serial output register m (SOm) …This register is a buffer register for serial output of each channel. CKO02 CKO01 CKO00 SO02 SO01 SO00 1: Serial clock output value is “1”...
CHAPTER 13 SERIAL ARRAY UNIT 13.5 Operation of 3-Wire Serial I/O (CSI00, CSI01, CSI10, CSI20) Communication This is a clocked communication function that uses three lines: serial clock (SCK) and serial data (SI and SO) lines. [Data transmission/reception] • Data length of 7 or 8 bits •...
CHAPTER 13 SERIAL ARRAY UNIT 13.5.1 Master transmission Master transmission is an operation in which the 78K0R/KG3 outputs a transfer clock and transmits data to another device. 3-Wire Serial I/O CSI00 CSI01 CSI10 CSI20 Target channel Channel 0 of SAU0...
CHAPTER 13 SERIAL ARRAY UNIT (1) Register setting Figure 13-24. Example of Contents of Registers for Master Transmission of 3-Wire Serial I/O (CSI00, CSI01, CSI10, CSI20) (a) Serial output register m (SOm) … Sets only the bits of the target channel. CKOm2 CKOm1 CKOm0...
CHAPTER 13 SERIAL ARRAY UNIT (2) Operation procedure Figure 13-25. Initial Setting Procedure for Master Transmission Starting initial setting Release the serial array unit from the Setting PER0 register reset status and start clock supply. Set the operation clock. Setting SPSm register Set an operation mode, etc.
Page 425
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-26. Procedure for Stopping Master Transmission Starting setting to stop Write 1 to the STmn bit of the target Setting STm register channel. Set the SOEm register and stop the Changing setting of SOEm register output of the target channel Stopping communication...
Page 426
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-27. Procedure for Resuming Master Transmission Starting setting for resumption Disable data output and clock output of the target channel by setting a port Port manipulation (Essential) register and a port mode register. Change the setting if an incorrect division Changing setting of SPSm register (Selective) ratio of the operation clock is set.
Page 427
CHAPTER 13 SERIAL ARRAY UNIT (3) Processing flow (in single-transmission mode) Figure 13-28. Timing Chart of Master Transmission (in Single-Transmission Mode) (Type 1: DAPmn = 0, CKPmn = 0) SSmn STmn SEmn SDRmn Transmit data 1 Transmit data 2 Transmit data 3 SCKp pin SOp pin Transmit data 1...
Page 428
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-29. Flowchart of Master Transmission (in Single-Transmission Mode) Starting CSI communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting operation clock by SPSm register SMRmn, SCRmn: Setting communication SDRmn[15:9]: Setting transfer rate Perform initial setting when SEmn = 0.
Page 429
CHAPTER 13 SERIAL ARRAY UNIT (4) Processing flow (in continuous transmission mode) Figure 13-30. Timing Chart of Master Transmission (in Continuous Transmission Mode) (Type 1: DAPmn = 0, CKPmn = 0) SSmn STmn SEmn SDRmn Transmit data 1 Transmit data 2 Transmit data 3 SCKp pin SOp pin...
Page 430
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-31. Flowchart of Master Transmission (in Continuous Transmission Mode) Starting CSI communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting operation clock by SPSm register SMRmn, SCRmn: Setting communication Perform initial setting when SEmn = 0. SDRmn[15:9]: Setting transfer rate <1>...
CHAPTER 13 SERIAL ARRAY UNIT 13.5.2 Master reception Master reception is an operation in which the 78K0R/KG3 outputs a transfer clock and receives data from another device. 3-Wire Serial I/O CSI00 CSI01 CSI10 CSI20 Target channel Channel 0 of SAU0...
Page 432
CHAPTER 13 SERIAL ARRAY UNIT (1) Register setting Figure 13-32. Example of Contents of Registers for Master Reception of 3-Wire Serial I/O (CSI00, CSI01, CSI10, CSI20) (a) Serial output register m (SOm) … Sets only the bits of the target channel. CKOm2 CKOm1 CKOm0...
Page 433
CHAPTER 13 SERIAL ARRAY UNIT (2) Operation procedure Figure 13-33. Initial Setting Procedure for Master Reception Starting initial setting Release the serial array unit from the Setting PER0 register reset status and start clock supply. Set the operation clock. Setting SPSm register Set an operation mode, etc.
Page 434
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-35. Procedure for Resuming Master Reception Starting setting for resumption Disable clock output of the target channel by setting a port register and a Port manipulation (Essential) port mode register. Change the setting if an incorrect division Changing setting of SPSm register ratio of the operation clock is set.
Page 435
CHAPTER 13 SERIAL ARRAY UNIT (3) Processing flow (in single-reception mode) Figure 13-36. Timing Chart of Master Reception (in Single-Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0) SSmn STmn SEmn Receive data 3 Receive data 1 Receive data 2 SDRmn Dummy data Dummy data for reception...
Page 436
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-37. Flowchart of Master Reception (in Single-Reception Mode) Starting CSI communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting transfer rate by SPSm register SMRmn, SCRmn: Setting communication SDRmn[15:9]: Setting transfer rate Perform initial setting when SEmn = 0.
Page 437
CHAPTER 13 SERIAL ARRAY UNIT <R> (4) Processing flow (in continuous reception mode) Figure 13-38. Timing Chart of Master Reception (in Continuous Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0) SSmn STmn SEmn Receive data 3 SDRmn Dummy data Dummy data Receive data 1 Dummy data...
Page 438
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-39. Flowchart of Master Reception (in Continuous Reception Mode) <R> Starting CSI communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting transfer rate by SPSm register SMRmn, SCRmn: Setting communication Perform initial setting when SEmn = 0. SDRmn[15:9]: Setting transfer rate <1>...
CHAPTER 13 SERIAL ARRAY UNIT 13.5.3 Master transmission/reception Master transmission/reception is an operation in which the 78K0R/KG3 outputs a transfer clock and transmits/receives data to/from another device. 3-Wire Serial I/O CSI00 CSI01 CSI10 CSI20 Target channel Channel 0 of SAU0...
Page 440
CHAPTER 13 SERIAL ARRAY UNIT (1) Register setting Figure 13-40. Example of Contents of Registers for Master Transmission/Reception of 3-Wire Serial I/O (CSI00, CSI01, CSI10, CSI20) (a) Serial output register m (SOm) … Sets only the bits of the target channel. CKOm2 CKOm1 CKOm0...
Page 441
CHAPTER 13 SERIAL ARRAY UNIT (2) Operation procedure Figure 13-41. Initial Setting Procedure for Master Transmission/Reception Starting initial setting Release the serial array unit from the Setting PER0 register reset status and start clock supply. Set the operation clock. Setting SPSm register Set an operation mode, etc.
Page 442
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-43. Procedure for Resuming Master Transmission/Reception Starting setting for resumption Disable data output and clock output of the target channel by setting a port Port manipulation (Essential) register and a port mode register. Change the setting if an incorrect division Changing setting of SPSm register (Selective) ratio of the operation clock is set.
Page 443
CHAPTER 13 SERIAL ARRAY UNIT (3) Processing flow (in single-transmission/reception mode) Figure 13-44. Timing Chart of Master Transmission/Reception (in Single-Transmission/Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0) SSmn STmn SEmn Receive data 1 Receive data 3 Receive data 2 SDRmn Transmit data 1 Transmit data 2...
Page 444
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-45. Flowchart of Master Transmission/Reception (in Single- Transmission/Reception Mode) Starting CSI communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting operation clock by SPSm register SMRmn, SCRmn: Setting communication SDRmn[15:9]: Setting transfer rate Perform initial setting when SEmn = 0.
Page 445
CHAPTER 13 SERIAL ARRAY UNIT (4) Processing flow (in continuous transmission/reception mode) Figure 13-46. Timing Chart of Master Transmission/Reception (in Continuous Transmission/Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0) SSmn STmn SEmn Receive data 3 SDRmn Transmit data 2 Receive data 1 Receive data 2 Transmit data 1...
Page 446
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-47. Flowchart of Master Transmission/Reception (in Continuous Transmission/Reception Mode) Starting CSI communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting operation clock by SPSm register SMRmn, SCRmn: Setting communication Perform initial setting when SEmn = 0. SDRmn[15:9]: Setting transfer rate <1>...
CHAPTER 13 SERIAL ARRAY UNIT 13.5.4 Slave transmission Slave transmission is an operation in which the 78K0R/KG3 transmits data to another device in the state of a transfer clock being input from another device. 3-Wire Serial I/O CSI00 CSI01 CSI10...
Page 448
CHAPTER 13 SERIAL ARRAY UNIT (1) Register setting Figure 13-48. Example of Contents of Registers for Slave Transmission of 3-Wire Serial I/O (CSI00, CSI01, CSI10, CSI20) (a) Serial output register m (SOm) … Sets only the bits of the target channel. CKOm2 CKOm1 CKOm0...
Page 449
CHAPTER 13 SERIAL ARRAY UNIT (2) Operation procedure Figure 13-49. Initial Setting Procedure for Slave Transmission Starting initial setting Release the serial array unit from the Setting PER0 register reset status and start clock supply. Set the operation clock. Setting SPSm register Set an operation mode, etc.
Page 450
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-50. Procedure for Stopping Slave Transmission Starting setting to stop Write 1 to the STmn bit of the target Setting STm register channel. Set the SOEm register and stop the Changing setting of SOEm register output of the target channel.
Page 451
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-51. Procedure for Resuming Slave Transmission Starting setting for resumption Stop the target for communication or wait Manipulating target for communication (Essential) until the target completes its operation. Disable data output of the target channel by setting a port register and a port Port manipulation (Selective)
Page 452
CHAPTER 13 SERIAL ARRAY UNIT (3) Processing flow (in single-transmission mode) Figure 13-52. Timing Chart of Slave Transmission (in Single-Transmission Mode) (Type 1: DAPmn = 0, CKPmn = 0) SSmn STmn SEmn SDRmn Transmit data 1 Transmit data 2 Transmit data 3 SCKp pin SOp pin Transmit data 1...
Page 453
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-53. Flowchart of Slave Transmission (in Single-Transmission Mode) Starting CSI communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting transfer rate by SPSm register SMRmn, SCRmn: Setting communication <R> SDRmn[15:9]: Setting 0000000B Perform initial setting when SEmn = 0.
Page 454
CHAPTER 13 SERIAL ARRAY UNIT (4) Processing flow (in continuous transmission mode) Figure 13-54. Timing Chart of Slave Transmission (in Continuous Transmission Mode) (Type 1: DAPmn = 0, CKPmn = 0) SSmn STmn SEmn SDRmn Transmit data 1 Transmit data 3 Transmit data 2 SCKp pin SOp pin...
Page 455
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-55. Flowchart of Slave Transmission (in Continuous Transmission Mode) Starting CSI communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting transfer rate by SPSm register SMRmn, SCRmn: Setting communication Perform initial setting when SEmn = 0. <R>...
CHAPTER 13 SERIAL ARRAY UNIT 13.5.5 Slave reception Slave reception is an operation in which the 78K0R/KG3 receives data from another device in the state of a transfer clock being input from another device. 3-Wire Serial I/O CSI00 CSI01 CSI10...
Page 457
CHAPTER 13 SERIAL ARRAY UNIT (1) Register setting Figure 13-56. Example of Contents of Registers for Slave Reception of 3-Wire Serial I/O (CSI00, CSI01, CSI10, CSI20) (a) Serial output register m (SOm) …The register that not used in this mode. CKOm2 CKOm1 CKOm0...
Page 458
CHAPTER 13 SERIAL ARRAY UNIT (2) Operation procedure Figure 13-57. Initial Setting Procedure for Slave Reception Starting initial settings Release the serial array unit from the Setting PER0 register reset status and start clock supply. Set the operation clock. Setting SPSm register Set an operation mode, etc.
Page 459
CHAPTER 13 SERIAL ARRAY UNIT <R> Figure 13-59. Procedure for Resuming Slave Reception Starting setting for resumption Stop the target for communication or wait (Essential) Manipulating target for communication until the target completes its operation. Disable clock output of the target channel by setting a port register and a Port manipulation (Essential)
Page 460
CHAPTER 13 SERIAL ARRAY UNIT (3) Processing flow (in single-reception mode) Figure 13-60. Timing Chart of Slave Reception (in Single-Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0) SSmn STmn SEmn Receive data 3 SDRmn Receive data 1 Receive data 2 Read Read Read...
Page 461
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-61. Flowchart of Slave Reception (in Single-Reception Mode) Starting CSI communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting transfer rate by SPSm register SMRmn, SCRmn: Setting communication Perform initial setting when SEmn = 0. <R>...
CHAPTER 13 SERIAL ARRAY UNIT 13.5.6 Slave transmission/reception Slave transmission/reception is an operation in which the 78K0R/KG3 transmits/receives data to/from another device in the state of a transfer clock being input from another device. 3-Wire Serial I/O CSI00 CSI01 CSI10...
Page 463
CHAPTER 13 SERIAL ARRAY UNIT (1) Register setting Figure 13-62. Example of Contents of Registers for Slave Transmission/Reception of 3-Wire Serial I/O (CSI00, CSI01, CSI10, CSI20) (a) Serial output register m (SOm) … Sets only the bits of the target channel. CKOm2 CKOm1 CKOm0...
Page 464
CHAPTER 13 SERIAL ARRAY UNIT (2) Operation procedure Figure 13-63. Initial Setting Procedure for Slave Transmission/Reception Starting initial setting Release the serial array unit from the Setting PER0 register reset status and start clock supply. Set the operation clock. Setting SPSm register Set an operation mode, etc.
Page 465
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-64. Procedure for Stopping Slave Transmission/Reception Starting setting to stop Write 1 to the STmn bit of the target Setting STm register channel. Set the SOEm register and stop the Changing setting of SOEm register output of the target channel.
Page 466
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-65. Procedure for Resuming Slave Transmission/Reception Starting setting for resumption Stop the target for communication or wait Manipulating target for communication (Essential) until the target completes its operation. Disable data output of the target channel by setting a port register and a port Port manipulation (Essential)
Page 467
CHAPTER 13 SERIAL ARRAY UNIT (3) Processing flow (in single-transmission/reception mode) Figure 13-66. Timing Chart of Slave Transmission/Reception (in Single-Transmission/Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0) SSmn STmn SEmn Receive data 2 Receive data 1 Receive data 3 SDRmn Transmit data 1 Transmit data 2...
Page 468
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-67. Flowchart of Slave Transmission/Reception (in Single- Transmission/Reception Mode) Starting CSI communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting transfer rate by SPSm register SMRmn, SCRmn: Setting communication <R> SDRmn[15:9]: Setting 0000000B Perform initial setting when SEmn = 0.
Page 469
CHAPTER 13 SERIAL ARRAY UNIT (4) Processing flow (in continuous transmission/reception mode) Figure 13-68. Timing Chart of Slave Transmission/Reception (in Continuous Transmission/Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0) SSmn STmn SEmn Receive data 3 SDRmn Transmit data 2 Receive data 2 Transmit data 1 Receive data 1...
Page 470
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-69. Flowchart of Slave Transmission/Reception (in Continuous Transmission/Reception Mode) Starting CSI communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting transfer rate by SPSm register SMRmn, SCRmn: Setting communication Perform initial setting when SEmn = 0. <R>...
CHAPTER 13 SERIAL ARRAY UNIT 13.5.7 Calculating transfer clock frequency The transfer clock frequency for 3-wire serial I/O (CSI00, CSI01, CSI10, CSI20) communication can be calculated by the following expressions. (1) Master (Transfer clock frequency) = {Operation clock (MCK) frequency of target channel} ÷ (SDRmn[15:9] + 1) ÷ 2 [Hz] (2) Slave Note (Transfer clock frequency) = {Frequency of serial clock (SCK) supplied by master}...
CHAPTER 13 SERIAL ARRAY UNIT 13.5.8 Procedure for processing errors that occurred during 3-wire serial I/O (CSI00, CSI01, CSI10, CSI20) communication The procedure for processing errors that occurred during 3-wire serial I/O (CSI00, CSI01, CSI10, CSI20) communication is described in Figure 13-70. Figure 13-70.
CHAPTER 13 SERIAL ARRAY UNIT 13.6 Operation of UART (UART0, UART1, UART2, UART3) Communication This is a start-stop synchronization function using two lines: serial data transmission (TxD) and serial data reception (RxD) lines. It transmits or receives data in asynchronization with the party of communication (by using an internal baud rate).
CHAPTER 13 SERIAL ARRAY UNIT 13.6.1 UART transmission UART transmission is an operation to transmit data from the 78K0R/KG3 to another device asynchronously (start- stop synchronization). Of two channels used for UART, the even channel is used for UART transmission.
CHAPTER 13 SERIAL ARRAY UNIT (1) Register setting Figure 13-71. Example of Contents of Registers for UART Transmission of UART (UART0, UART1, UART2, UART3) (1/2) (a) Serial output register m (SOm) … Sets only the bits of the target channel to 1. CKOm2 CKOm1 CKOm0...
Page 477
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-71. Example of Contents of Registers for UART Transmission of UART (UART0, UART1, UART2, UART3) (2/2) (f) Serial communication operation setting register mn (SCRmn) SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn2 DLSmn1...
CHAPTER 13 SERIAL ARRAY UNIT (2) Operation procedure Figure 13-72. Initial Setting Procedure for UART Transmission Starting initial setting Release the serial array unit from the Setting PER0 register reset status and start clock supply. Set the operation clock. Setting SPSm register Set an operation mode, etc.
Page 479
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-73. Procedure for Stopping UART Transmission Starting setting to stop Write 1 to the STmn bit of the target Setting STm register channel. Set the SOEmn bit to 0 and stop the Changing setting of SOEm register output.
Page 480
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-74. Procedure for Resuming UART Transmission Starting setting for resumption Disable data output of the target channel by setting a port register and a port mode Port manipulation (Essential) register. Change the setting if an incorrect division Changing setting of SPSm register (Selective) ratio of the operation clock is set.
Page 481
CHAPTER 13 SERIAL ARRAY UNIT (3) Processing flow (in single-transmission mode) Figure 13-75. Timing Chart of UART Transmission (in Single-Transmission Mode) SSmn STmn SEmn SDRmn Transmit data 1 Transmit data 2 Transmit data 3 TxDq pin Transmit data 1 Transmit data 2 Transmit data 3 P SP P SP...
Page 482
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-76. Flowchart of UART Transmission (in Single-Transmission Mode) Starting UART communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting operation clock by SPSm register SMRmn, SCRmn: Setting communication SDRmn[15:9]: Setting transfer rate Perform initial setting when SEmn = 0.
Page 483
CHAPTER 13 SERIAL ARRAY UNIT (4) Processing flow (in continuous transmission mode) Figure 13-77. Timing Chart of UART Transmission (in Continuous Transmission Mode) SSmn STmn SEmn SDRmn Transmit data 3 Transmit data 1 Transmit data 2 TxDq pin Transmit data 3 Transmit data 1 Transmit data 2 P SP...
Page 484
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-78. Flowchart of UART Transmission (in Continuous Transmission Mode) Starting UART communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting operation clock by SPSm register SMRmn, SCRmn: Setting communication Perform initial setting when SEmn = 0. SDRmn[15:9]: Setting transfer rate SOLmn:...
CHAPTER 13 SERIAL ARRAY UNIT 13.6.2 UART reception UART reception is an operation wherein the 78K0R/KG3 asynchronously receives data from another device (start- stop synchronization). For UART reception, the odd-number channel of the two channels used for UART is used. The SMR register of both the odd- and even-numbered channels must be set.
Page 486
CHAPTER 13 SERIAL ARRAY UNIT (1) Register setting Figure 13-79. Example of Contents of Registers for UART Reception of UART (UART0, UART1, UART2, UART3) (1/2) (a) Serial output register m (SOm) …The register that not used in this mode. CKOm2 CKOm1 CKOm0 SOm2...
Page 487
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-79. Example of Contents of Registers for UART Reception of UART (UART0, UART1, UART2, UART3) (2/2) (g) Serial data register mn (SDRmn) (lower 8 bits: RXDq) SDRmn Baud rate setting Receive data register RXDq Caution For the UART reception, be sure to set SMRmr of channel r that is to be paired with channel m: Unit number (m = 0, 1), n: Channel number (n = 1, 3), r: Channel number (r = n −...
Page 488
CHAPTER 13 SERIAL ARRAY UNIT (2) Operation procedure Figure 13-80. Initial Setting Procedure for UART Reception Starting initial setting Release the serial array unit from the Setting PER0 register reset status and start clock supply. Set the operation clock. Setting SPSm register Set an operation mode, etc.
Page 489
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-82. Procedure for Resuming UART Reception Starting setting for resumption Stop the target for communication or wait (Essential) Manipulating target for communication until the target completes its operation. Change the setting if an incorrect division (Selective) Changing setting of SPSm register ratio of the operation clock is set.
CHAPTER 13 SERIAL ARRAY UNIT (3) Processing flow Figure 13-83. Timing Chart of UART Reception SSmn STmn SEmn Receive data 3 SDRmn Receive data 1 Receive data 2 RxDq pin Receive data 1 Receive data 2 Receive data 3 Shift Shift operation Shift operation Shift operation...
Page 491
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-84. Flowchart of UART Reception Starting UART communication Setting SAU1EN and SAU0EN bits of PER0 register to 1 Setting transfer rate by SPSm register Perform initial setting when SMRmn, SMRmr, SCRmn: Setting communication <R> SEmn = 0.
CHAPTER 13 SERIAL ARRAY UNIT 13.6.3 LIN transmission Of UART transmission, UART3 supports LIN communication. For LIN transmission, channel 2 of unit 1 (SAU1) is used. UART UART0 UART1 UART2 UART3 Support of LIN communication Not supported Not supported Not supported Supported −...
Page 493
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-85. Transmission Operation of LIN Wakeup signal Sync break Sync field Identification Data field Data field Checksum frame field field field LIN Bus 13-bit SBF Data Data Data Data Note 1 Note 2 8 bits transmission transmission transmission...
Page 494
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-86. Flowchart for LIN Transmission Starting LIN communication Setting baud rate Writing 1 to SS12 Setting transfer data 00H Transmitting wakeup signal frame Wakeup signal frame Transfer end interrupt generated? Setting transfer data 00H Transmitting sync break field Sync break field...
CHAPTER 13 SERIAL ARRAY UNIT 13.6.4 LIN reception Of UART reception, UART3 supports LIN communication. For LIN reception, channel 3 of unit 1 (SAU1) is used. UART UART0 UART1 UART2 UART3 Support of LIN communication Not supported Not supported Not supported Supported −...
Page 496
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-87. Reception Operation of LIN Wakeup signal Sync break Sync field Identification Data filed Data filed Checksum frame field field field LIN Bus 13-bit SBF Data Data Data reception reception reception reception reception reception <5>...
Page 497
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-88 shows the configuration of a port that manipulates reception of LIN. The wakeup signal transmitted from the master of LIN is received by detecting an edge of an external interrupt (INTP0). The length of the sync field transmitted from the master can be measured by using the external event capture operation of the timer array unit (TAU) to calculate a baud-rate error.
Page 498
CHAPTER 13 SERIAL ARRAY UNIT The peripheral functions used for the LIN communication operation are as follows. <Peripheral functions used> • External interrupt (INTP0); Wakeup signal detection Usage: To detect an edge of the wakeup signal and the start of communication •...
Page 499
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-89. Flowchart of LIN Reception Starting LIN communication Setting TAU in capture mode (to measure low-level width) Detecting low-level width Wakeup signal frame Wakeup detected? Detecting low-level width Sync break field SBF detected? INTP0, Stopping operation Setting TAU in capture mode (to measure...
CHAPTER 13 SERIAL ARRAY UNIT 13.6.5 Calculating baud rate (1) Baud rate calculation expression The baud rate for UART (UART0, UART1, UART2, UART3) communication can be calculated by the following expressions. (Baud rate) = {Operation clock (MCK) frequency of target channel} ÷ (SDRmn[15:9] + 1) ÷ 2 [bps] Caution Setting SDRmn [15:9] = (0000000B, 0000001B) is prohibited.
Page 502
CHAPTER 13 SERIAL ARRAY UNIT (2) Baud rate error during transmission The baud rate error of UART (UART0, UART1, UART2, UART3) communication during transmission can be calculated by the following expression. Make sure that the baud rate at the transmission side is within the permissible baud rate range at the reception side.
Page 503
CHAPTER 13 SERIAL ARRAY UNIT (3) Permissible baud rate range for reception The permissible baud rate range for reception during UART (UART0, UART1, UART2, UART3) communication can be calculated by the following expression. Make sure that the baud rate at the transmission side is within the permissible baud rate range at the reception side.
CHAPTER 13 SERIAL ARRAY UNIT 13.6.6 Procedure for processing errors that occurred during UART (UART0, UART1, UART2, UART3) communication The procedure for processing errors that occurred during UART (UART0, UART1, UART2, UART3) communication is described in Figures 13-91 and 13-92. Figure 13-91.
CHAPTER 13 SERIAL ARRAY UNIT 13.7 Operation of Simplified I C (IIC10, IIC20) Communication This is a clocked communication function to communicate with two or more devices by using two lines: serial clock (SCL) and serial data (SDA). This communication function is designed to execute single communication with devices such as EEPROM, flash memory, and A/D converter, and therefore, can be used only by the master and does not have a wait detection function.
CHAPTER 13 SERIAL ARRAY UNIT 13.7.1 Address field transmission Address field transmission is a transmission operation that first executes in I C communication to identify the target for transfer (slave). After a start condition is generated, an address (7 bits) and a transfer direction (1 bit) are transmitted in one frame.
CHAPTER 13 SERIAL ARRAY UNIT (1) Register setting Figure 13-93. Example of Contents of Registers for Address Field Transmission of Simplified I C (IIC10, IIC20) (a) Serial output register m (SOm) … Sets only the bits of the target channel. CKOm2 CKOm1 CKOm0...
Page 508
CHAPTER 13 SERIAL ARRAY UNIT (2) Operation procedure Figure 13-94. Initial Setting Procedure for Address Field Transmission Starting initial setting Release the serial array unit from the Setting PER0 register reset status and start clock supply. Set the operation clock . Setting SPSm register Set an operation mode, etc.
CHAPTER 13 SERIAL ARRAY UNIT (3) Processing flow Figure 13-95. Timing Chart of Address Field Transmission SSmn SEmn SOEmn SDRmn Address field transmission SCLr output CKOmn bit manipulation SDAr output SOmn bit manipulation Address SDAr input Shift Shift operation register mn INTIICr TSFmn Remark...
Page 510
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-96. Flowchart of Address Field Transmission Starting IIC communication SMRmn, SCRmn: Setting communication SPSm, SDRmn[15:9]: Setting transfer rate Writing 0 to SOmn bit Perform initial setting when SEmn = 0. Writing 0 to CKOmn bit Writing 1 to SOEmn bit Writing 1 to SSmn bit Writing address and R/W...
CHAPTER 13 SERIAL ARRAY UNIT 13.7.2 Data transmission Data transmission is an operation to transmit data to the target for transfer (slave) after transmission of an address field. After all data are transmitted to the slave, a stop condition is generated and the bus is released. Simplified I IIC10 IIC20...
Page 512
CHAPTER 13 SERIAL ARRAY UNIT (1) Register setting Figure 13-97. Example of Contents of Registers for Data Transmission of Simplified I C (IIC10, IIC20) (a) Serial output register m (SOm) … Do not manipulate this register during data transmission/reception. CKOm2 CKOm1 CKOm0 SOm2...
Page 513
CHAPTER 13 SERIAL ARRAY UNIT (2) Processing flow Figure 13-98. Timing Chart of Data Transmission SSmn “L” SEmn “H” SOEmn “H” SDRmn Transmit data 1 SCLr output SDAr output SDAr input Shift Shift operation register mn INTIICr TSFmn Remark m: Unit number (m = 0, 1), n: Channel number (n = 0, 2), r: IIC number (r = 10, 20) Figure 13-99.
CHAPTER 13 SERIAL ARRAY UNIT 13.7.3 Data reception Data reception is an operation to receive data to the target for transfer (slave) after transmission of an address field. After all data are received to the slave, a stop condition is generated and the bus is released. Simplified I IIC10 IIC20...
Page 515
CHAPTER 13 SERIAL ARRAY UNIT (1) Register setting Figure 13-100. Example of Contents of Registers for Data Reception of Simplified I C (IIC10, IIC20) (a) Serial output register m (SOm) … Do not manipulate this register during data transmission/reception. CKOm2 CKOm1 CKOm0 SOm2...
Page 516
CHAPTER 13 SERIAL ARRAY UNIT (2) Processing flow Figure 13-101. Timing Chart of Data Reception (a) When starting data reception SSmn STmn SEmn SOEmn “H” TXEmn, TXEmn = 1 / RXEmn = 0 TXEmn = 0 / RXEmn = 1 RXEmn SDRmn Dummy data (FFH)
Page 517
CHAPTER 13 SERIAL ARRAY UNIT Figure 13-102. Flowchart of Data Reception Address field transmission completed Writing 1 to STmn bit Writing 0 to TXEmn bit, and 1 to RXEmn bit Writing 1 to SSmn bit Starting data reception Last byte received? Writing 0 to SOEmn bit (Stopping output by serial communication operation)
CHAPTER 13 SERIAL ARRAY UNIT 13.7.4 Stop condition generation After all data are transmitted to or received from the target slave, a stop condition is generated and the bus is released. (1) Processing flow Figure 13-103. Timing Chart of Stop Condition Generation STmn SEmn SOEmn...
CHAPTER 13 SERIAL ARRAY UNIT 13.7.5 Calculating transfer rate The transfer rate for simplified I C (IIC10, IIC20) communication can be calculated by the following expressions. (Transfer rate) = {Operation clock (MCK) frequency of target channel} ÷ (SDRmn[15:9] + 1) ÷ 2 <R>...
Page 521
CHAPTER 13 SERIAL ARRAY UNIT Here is an example of setting an IIC transfer rate where MCK = f = 20 MHz. IIC Transfer Mode = 20 MHz (Desired Transfer Rate) Operation Clock (MCK) SDRmn[15:9] Calculated Error from Desired Transfer Transfer Rate Rate 100 kHz...
CHAPTER 13 SERIAL ARRAY UNIT 13.7.6 Procedure for processing errors that occurred during simplified I C (IIC10, IIC20) communication The procedure for processing errors that occurred during simplified I C (IIC10, IIC20) communication is described in Figures 13-105 and 13-106. Figure 13-105.
CHAPTER 13 SERIAL ARRAY UNIT 13.8 Relationship Between Register Settings and Pins Tables 13-5 to 13-12 show the relationship between register settings and pins for each channel of serial array units 0 and 1. Table 13-5. Relationship Between Register Settings and Pins (Channel 0 of Unit 0: CSI00, UART0 Transmission) P10 PM Operation Mode...
Page 524
CHAPTER 13 SERIAL ARRAY UNIT Table 13-6. Relationship Between Register Settings and Pins (Channel 1 of Unit 0: CSI01, UART0 Reception) SO01 CKO P43 PM44 P44 PM P45 PM Operation Pin Function Note 2 Mode SCK01/ SI01/P44 SO01/ SI00/EX25/ Note 1 Note 2 RxD0/ Note 2...
Page 525
CHAPTER 13 SERIAL ARRAY UNIT Table 13-7. Relationship Between Register Settings and Pins (Channel 2 of Unit 0: CSI10, UART1 Transmission, IIC10) P04 PM03 PM02 P02 Operation Mode Pin Function Note 2 Note 2 SCK10/ SI10/SDA10/ SO10/ Note 1 SCL10/P04 RxD1/P03 TxD1/P02 Note 2...
Page 526
CHAPTER 13 SERIAL ARRAY UNIT Table 13-8. Relationship Between Register Settings and Pins (Channel 3 of Unit 0: UART1 Reception) Note 1 Note 2 Note 2 SE03 PM03 MD032 MD031 TXE03 RXE03 Operation Pin Function Mode SI10/SDA10/RxD1/P03 Note 2 Note 3 Note 3 Note 2 ×...
Page 527
CHAPTER 13 SERIAL ARRAY UNIT Table 13-9. Relationship Between Register Settings and Pins (Channel 0 of Unit 1: CSI20, UART2 Transmission, IIC20) P142 PM P143 P144 Operation Mode Pin Function Note 2 SCK20/ SI20/SDA20/ SO20/ Note 1 Note 2 SCL20/P142 RxD2/P143 TxD2/P144 Note 2...
Page 528
CHAPTER 13 SERIAL ARRAY UNIT Table 13-10. Relationship Between Register Settings and Pins (Channel 1 of Unit 1: UART2 Reception) Note 1 Note 2 Note 2 SE11 PM143 P143 MD112 MD111 TXE11 RXE11 Operation Pin Function Mode Note 2 SI20/SDA20/RxD2/P143 Note 3 Note 3 ×...
Page 529
CHAPTER 13 SERIAL ARRAY UNIT Table 13-11. Relationship Between Register Settings and Pins (Channel 2 of Unit 1: UART3 Transmission) Note SE12 MD122 MD121 SOE12 SO12 TXE12 RXE12 PM13 Operation Pin Function Mode EX27/TxD3/P13 × × Operation EX27/P13 Note 2 Note 2 stop mode Note 3...
CHAPTER 14 SERIAL INTERFACE IIC0 14.1 Functions of Serial Interface IIC0 Serial interface IIC0 has the following two modes. (1) Operation stop mode This mode is used when serial transfers are not performed. It can therefore be used to reduce power consumption.
Page 531
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-1. Block Diagram of Serial Interface IIC0 Internal bus IIC status register 0 (IICS0) MSTS0 ALD0 EXC0 COI0 TRC0 ACKD0 STD0 SPD0 IIC control register 0 (IICC0) IICE0 LREL0 WREL0 SPIE0 WTIM0 ACKE0 STT0 SPT0 Slave address Start Clear...
Page 532
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-2 shows a serial bus configuration example. Figure 14-2. Serial Bus Configuration Example Using I C Bus Serial data bus Master CPU2 Master CPU1 SDA0 SDA0 Slave CPU1 Slave CPU2 Serial clock SCL0 SCL0 Address 0 Address 1 SDA0...
CHAPTER 14 SERIAL INTERFACE IIC0 14.2 Configuration of Serial Interface IIC0 Serial interface IIC0 includes the following hardware. Table 14-1. Configuration of Serial Interface IIC0 Item Configuration Registers IIC shift register 0 (IIC0) Slave address register 0 (SVA0) Control registers Peripheral enable register 0 (PER0) IIC control register 0 (IICC0) IIC status register 0 (IICS0)
Page 534
CHAPTER 14 SERIAL INTERFACE IIC0 (3) SO latch The SO latch is used to retain the SDA0 pin’s output level. (4) Wakeup controller This circuit generates an interrupt request (INTIIC0) when the address received by this register matches the address value set to slave address register 0 (SVA0) or when an extension code is received. (5) Prescaler This selects the sampling clock to be used.
Page 535
CHAPTER 14 SERIAL INTERFACE IIC0 (14) Bus status detector This circuit detects whether or not the bus is released by detecting start conditions and stop conditions. However, as the bus status cannot be detected immediately following operation, the initial status is set by the STCEN bit.
CHAPTER 14 SERIAL INTERFACE IIC0 14.3 Registers to Controlling Serial Interface IIC0 Serial interface IIC0 is controlled by the following eight registers. • Peripheral enable register 0 (PER0) • IIC control register 0 (IICC0) • IIC flag register 0 (IICF0) •...
Page 537
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-6. Format of IIC Control Register 0 (IICC0) (1/4) Address: FFF52H After reset: 00H Symbol <7> <6> <5> <4> <3> <2> <1> <0> IICC0 IICE0 LREL0 WREL0 SPIE0 WTIM0 ACKE0 STT0 SPT0 IICE0 C operation enable Note 1 Stop operation.
Page 538
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-6. Format of IIC Control Register 0 (IICC0) (2/4) Note 1 SPIE0 Enable/disable generation of interrupt request when stop condition is detected Disable Enable Condition for clearing (SPIE0 = 0) Condition for setting (SPIE0 = 1) •...
Page 539
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-6. Format of IIC Control Register 0 (IICC0) (3/4) Note STT0 Start condition trigger Do not generate a start condition. <R> When bus is released (in standby state, when IICBSY = 0): Generate a start condition (for starting as master). When the SCL0 line is high level, the SDA0 line is changed from high level to low level and then the start condition is generated.
Page 540
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-6. Format of IIC Control Register 0 (IICC0) (4/4) SPT0 Stop condition trigger Stop condition is not generated. Stop condition is generated (termination of master device’s transfer). After the SDA0 line goes to low level, either set the SCL0 line to high level or wait until it goes to high level.
Page 541
CHAPTER 14 SERIAL INTERFACE IIC0 (3) IIC status register 0 (IICS0) This register indicates the status of I IICS0 is read by a 1-bit or 8-bit memory manipulation instruction only when STT0 = 1 and during the wait period. Reset signal generation clears this register to 00H. Figure 14-7.
Page 542
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-7. Format of IIC Status Register 0 (IICS0) (2/3) COI0 Detection of matching addresses Addresses do not match. Addresses match. Condition for clearing (COI0 = 0) Condition for setting (COI0 = 1) • When a start condition is detected •...
Page 543
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-7. Format of IIC Status Register 0 (IICS0) (3/3) ACKD0 Detection of acknowledge (ACK) Acknowledge was not detected. Acknowledge was detected. Condition for clearing (ACKD0 = 0) Condition for setting (ACKD0 = 1) • When a stop condition is detected •...
Page 544
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-8. Format of IIC Flag Register 0 (IICF0) Note Address: FFF51H After reset: 00H <7> <6> <1> <0> Symbol IICF0 IICBSY STCEN IICRSV STCF STCF STT0 clear flag Generate start condition Start condition generation unsuccessful: clear STT0 flag Condition for clearing (STCF = 0) Condition for setting (STCF = 1) •...
Page 545
CHAPTER 14 SERIAL INTERFACE IIC0 (5) IIC clock select register 0 (IICCL0) This register is used to set the transfer clock for the I C bus. IICCL0 can be set by a 1-bit or 8-bit memory manipulation instruction. However, the CLD0 and DAD0 bits are read-only.
Page 546
CHAPTER 14 SERIAL INTERFACE IIC0 (6) IIC function expansion register 0 (IICX0) This register sets the function expansion of I IICX0 can be set by a 1-bit or 8-bit memory manipulation instruction. The CLX0 bit is set in combination with bits 3, 1, and 0 (SMC0, CL01, and CL00) of IIC clock select register 0 (IICCL0) (see 14.5.4 Transfer clock setting method).
Page 547
CHAPTER 14 SERIAL INTERFACE IIC0 (7) Port mode register 6 (PM6) This register sets the input/output of port 6 in 1-bit units. When using the P60/SCL0 pin as clock I/O and the P61/SDA0 pin as serial data I/O, clear PM60 and PM61, and the output latches of P60 and P61 to 0.
CHAPTER 14 SERIAL INTERFACE IIC0 14.4 I C Bus Mode Functions 14.4.1 Pin configuration The serial clock pin (SCL0) and serial data bus pin (SDA0) are configured as follows. (1) SCL0..This pin is used for serial clock input and output. This pin is an N-ch open-drain output for both master and slave devices.
CHAPTER 14 SERIAL INTERFACE IIC0 14.5 I C Bus Definitions and Control Methods The following section describes the I C bus’s serial data communication format and the signals used by the I C bus. Figure 14-13 shows the transfer timing for the “start condition”, “address”, “data”, and “stop condition” output via the C bus’s serial data bus.
CHAPTER 14 SERIAL INTERFACE IIC0 14.5.2 Addresses The address is defined by the 7 bits of data that follow the start condition. An address is a 7-bit data segment that is output in order to select one of the slave devices that are connected to the master device via the bus lines.
CHAPTER 14 SERIAL INTERFACE IIC0 14.5.4 Transfer clock setting method (1) Selection clock setting method on the master side The I C transfer clock frequency (f ) is calculated using the following expression. = 1/(m × T + t m = 24, 44, 48, 88, 96, 172, 344 (see Table 14-3 Selection Clock Setting) T: 1/f : SCL0 rise time : SCL0 fall time...
CHAPTER 14 SERIAL INTERFACE IIC0 Table 14-3. Selection Clock Setting IICX0 IICCL0 Transfer Clock (f Settable Selection Clock Operation Mode ) Range Bit 0 Bit 3 Bit 1 Bit 0 CLX0 SMC0 CL01 CL00 4.00 MHz to 8.4 MHz Normal mode (SMC0 bit = 0) /172 8.38 MHz to 16.76 MHz /344...
Page 553
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-17. ACK SCL0 SDA0 When the local address is received, ACK is automatically generated, regardless of the value of ACKE0. When an address other than that of the local address is received, ACK is not generated (NACK). When an extension code is received, ACK is generated if ACKE0 is set to 1 in advance.
CHAPTER 14 SERIAL INTERFACE IIC0 14.5.6 Stop condition When the SCL0 pin is at high level, changing the SDA0 pin from low level to high level generates a stop condition. A stop condition is a signal that the master device generates to the slave device when serial transfer has been completed.
CHAPTER 14 SERIAL INTERFACE IIC0 14.5.7 Wait The wait is used to notify the communication partner that a device (master or slave) is preparing to transmit or receive data (i.e., is in a wait state). Setting the SCL0 pin to low level notifies the communication partner of the wait state. When wait state has been canceled for both the master and slave devices, the next data transfer can begin.
Page 556
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-19. Wait (2/2) (2) When master and slave devices both have a nine-clock wait (master transmits, slave receives, and ACKE0 = 1) Master Master and slave both wait after output of ninth clock IIC0 data write (cancel wait) IIC0 SCL0 Slave...
CHAPTER 14 SERIAL INTERFACE IIC0 14.5.8 Canceling wait The I C usually cancels a wait state by the following processing. • Writing data to IIC shift register 0 (IIC0) • Setting bit 5 (WREL0) of IIC control register 0 (IICC0) (canceling wait) •...
CHAPTER 14 SERIAL INTERFACE IIC0 14.5.9 Interrupt request (INTIIC0) generation timing and wait control The setting of bit 3 (WTIM0) of IIC control register 0 (IICC0) determines the timing by which INTIIC0 is generated and the corresponding wait control, as shown in Table 14-4. Table 14-4.
CHAPTER 14 SERIAL INTERFACE IIC0 14.5.10 Address match detection method In I C bus mode, the master device can select a particular slave device by transmitting the corresponding slave address. Address match can be detected automatically by hardware. An INTIIC0 occurs when the address set to the slave address register 0 (SVA0) matches the slave address sent by the master device, or when an extension code has been received.
CHAPTER 14 SERIAL INTERFACE IIC0 14.5.13 Arbitration When several master devices simultaneously generate a start condition (when STT0 is set to 1 before STD0 is set to 1), communication among the master devices is performed as the number of clocks are adjusted until the data differs.
CHAPTER 14 SERIAL INTERFACE IIC0 Table 14-6. Status During Arbitration and Interrupt Request Generation Timing Status During Arbitration Interrupt Request Generation Timing Note 1 During address transmission At falling edge of eighth or ninth clock following byte transfer Read/write data after address transmission During extension code transmission Read/write data after extension code transmission During data transmission...
CHAPTER 14 SERIAL INTERFACE IIC0 14.5.15 Communication reservation (1) When communication reservation function is enabled (bit 0 (IICRSV) of IIC flag register 0 (IICF0) = 0) To start master device communications when not currently using a bus, a communication reservation can be made to enable transmission of a start condition when the bus is released.
Page 563
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-21. Communication Reservation Timing Write to Program processing STT0 = 1 IIC0 Communi- Set SPD0 cation Hardware processing STD0 reservation INTIIC0 SCL0 SDA0 Generate by master device with bus mastership Remark IIC0: IIC shift register 0 STT0: Bit 1 of IIC control register 0 (IICC0) STD0: Bit 1 of IIC status register 0 (IICS0)
Page 564
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-23. Communication Reservation Protocol SET1 STT0 Sets STT0 flag (communication reservation) Defines that communication reservation is in effect Define communication (defines and sets user flag to any part of RAM) reservation Secures wait period set by software (see Table 14-7). Wait Note (Communication reservation)
Page 565
CHAPTER 14 SERIAL INTERFACE IIC0 (2) When communication reservation function is disabled (bit 0 (IICRSV) of IIC flag register 0 (IICF0) = 1) When bit 1 (STT0) of IIC control register 0 (IICC0) is set to 1 when the bus is not used in a communication during bus communication, this request is rejected and a start condition is not generated.
CHAPTER 14 SERIAL INTERFACE IIC0 14.5.16 Cautions (1) When STCEN (bit 1 of IIC flag register 0 (IICF0)) = 0 Immediately after I C operation is enabled (IICE0 = 1), the bus communication status (IICBSY (bit 6 of IICF0) = 1) is recognized regardless of the actual bus status.
This flowchart is broadly divided into the initial settings, communication waiting, and communication processing. The processing when the 78K0R/KG3 looses in arbitration and is specified as the slave is omitted here, and only the processing as the master is shown.
CHAPTER 14 SERIAL INTERFACE IIC0 (1) Master operation in single-master system Figure 14-24. Master Operation in Single-Master System START Initializing I C bus Note Sets the port used alternatively as the pin to be used. Setting port First, set the port to input mode and the output latch to 0 (see 14.3 (7) Port mode register 6 (PM6)). IICX0 ←...
Page 569
CHAPTER 14 SERIAL INTERFACE IIC0 (2) Master operation in multi-master system Figure 14-25. Master Operation in Multi-Master System (1/3) START Sets the port used alternatively as the pin to be used. Setting port First, set the port to input mode and the output latch to 0 (see 14.3 (7) Port mode register 6 (PM6)). IICX0 ←...
Page 570
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-25. Master Operation in Multi-Master System (2/3) Enables reserving communication. Prepares for starting communication STT0 = 1 (generates a start condition). Secures wait time by software Wait (see Table 14-7). MSTS0 = 1? INTIIC0 interrupt occurs? Waits for bus release (communication being reserved).
Page 571
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-25. Master Operation in Multi-Master System (3/3) Starts communication Writing IIC0 (specifies an address and transfer direction). INTIIC0 interrupt occurs? Waits for detection of ACK. MSTS0 = 1? ACKD0 = 1? TRC0 = 1? ACKE0 = 1 WTIM0 = 0 WTIM0 = 1...
Page 572
CHAPTER 14 SERIAL INTERFACE IIC0 (3) Slave operation The processing procedure of the slave operation is as follows. Basically, the slave operation is event-driven. Therefore, processing by the INTIIC0 interrupt (processing that must substantially change the operation status such as detection of a stop condition during communication) is necessary.
Page 573
CHAPTER 14 SERIAL INTERFACE IIC0 The main processing of the slave operation is explained next. Start serial interface IIC0 and wait until communication is enabled. When communication is enabled, execute communication by using the communication mode flag and ready flag (processing of the stop condition and start condition is performed by an interrupt.
Page 574
CHAPTER 14 SERIAL INTERFACE IIC0 An example of the processing procedure of the slave with the INTIIC0 interrupt is explained below (processing is performed assuming that no extension code is used). The INTIIC0 interrupt checks the status, and the following operations are performed. <1>...
CHAPTER 14 SERIAL INTERFACE IIC0 14.5.18 Timing of I C interrupt request (INTIIC0) occurrence The timing of transmitting or receiving data and generation of interrupt request signal INTIIC0, and the value of the IICS0 register when the INTIIC0 signal is generated are shown below. Remark Start condition AD6 to AD0: Address...
Page 576
CHAPTER 14 SERIAL INTERFACE IIC0 (1) Master device operation (a) Start ~ Address ~ Data ~ Data ~ Stop (transmission/reception) (i) When WTIM0 = 0 SPT0 = 1 ↓ AD6 to AD0 R/W ACK D7 to D0 D7 to D0 1: IICS0 = 1000×110B 2: IICS0 = 1000×000B Note...
Page 577
CHAPTER 14 SERIAL INTERFACE IIC0 (b) Start ~ Address ~ Data ~ Start ~ Address ~ Data ~ Stop (restart) (i) When WTIM0 = 0 STT0 = 1 SPT0 = 1 ↓ ↓ AD6 to AD0 R/W ACK D7 to D0 AD6 to AD0 D7 to D0 1: IICS0 = 1000×110B...
Page 578
CHAPTER 14 SERIAL INTERFACE IIC0 (c) Start ~ Code ~ Data ~ Data ~ Stop (extension code transmission) (i) When WTIM0 = 0 SPT0 = 1 ↓ AD6 to AD0 R/W ACK D7 to D0 D7 to D0 1: IICS0 = 1010×110B 2: IICS0 = 1010×000B Note 3: IICS0 = 1010×000B (Sets WTIM0 to 1)
Page 579
CHAPTER 14 SERIAL INTERFACE IIC0 (2) Slave device operation (slave address data reception) (a) Start ~ Address ~ Data ~ Data ~ Stop (i) When WTIM0 = 0 AD6 to AD0 R/W ACK D7 to D0 D7 to D0 1: IICS0 = 0001×110B 2: IICS0 = 0001×000B 3: IICS0 = 0001×000B 4: IICS0 = 00000001B...
Page 580
CHAPTER 14 SERIAL INTERFACE IIC0 (b) Start ~ Address ~ Data ~ Start ~ Address ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, matches with SVA0) AD6 to AD0 R/W ACK D7 to D0 AD6 to AD0 D7 to D0 1: IICS0 = 0001×110B 2: IICS0 = 0001×000B...
Page 581
CHAPTER 14 SERIAL INTERFACE IIC0 (c) Start ~ Address ~ Data ~ Start ~ Code ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, does not match address (= extension code)) AD6 to AD0 R/W ACK D7 to D0 AD6 to AD0 D7 to D0 1: IICS0 = 0001×110B...
Page 582
CHAPTER 14 SERIAL INTERFACE IIC0 (d) Start ~ Address ~ Data ~ Start ~ Address ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, does not match address (= not extension code)) AD6 to AD0 R/W ACK D7 to D0 AD6 to AD0 D7 to D0 1: IICS0 = 0001×110B...
Page 583
CHAPTER 14 SERIAL INTERFACE IIC0 (3) Slave device operation (when receiving extension code) The device is always participating in communication when it receives an extension code. (a) Start ~ Code ~ Data ~ Data ~ Stop (i) When WTIM0 = 0 AD6 to AD0 R/W ACK D7 to D0 D7 to D0...
Page 584
CHAPTER 14 SERIAL INTERFACE IIC0 (b) Start ~ Code ~ Data ~ Start ~ Address ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, matches SVA0) AD6 to AD0 R/W ACK D7 to D0 AD6 to AD0 D7 to D0 1: IICS0 = 0010×010B 2: IICS0 = 0010×000B 3: IICS0 = 0001×110B...
Page 585
CHAPTER 14 SERIAL INTERFACE IIC0 (c) Start ~ Code ~ Data ~ Start ~ Code ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, extension code reception) AD6 to AD0 R/W ACK D7 to D0 AD6 to AD0 D7 to D0 1: IICS0 = 0010×010B 2: IICS0 = 0010×000B...
Page 586
CHAPTER 14 SERIAL INTERFACE IIC0 (d) Start ~ Code ~ Data ~ Start ~ Address ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, does not match address (= not extension code)) AD6 to AD0 R/W ACK D7 to D0 AD6 to AD0 D7 to D0 1: IICS0 = 00100010B...
Page 587
CHAPTER 14 SERIAL INTERFACE IIC0 (4) Operation without communication (a) Start ~ Code ~ Data ~ Data ~ Stop AD6 to AD0 R/W ACK D7 to D0 D7 to D0 1: IICS0 = 00000001B Remark : Generated only when SPIE0 = 1 (5) Arbitration loss operation (operation as slave after arbitration loss) When the device is used as a master in a multi-master system, read the MSTS0 bit each time interrupt request signal INTIIC0 has occurred to check the arbitration result.
Page 588
CHAPTER 14 SERIAL INTERFACE IIC0 (ii) When WTIM0 = 1 AD6 to AD0 R/W ACK D7 to D0 D7 to D0 1: IICS0 = 0101×110B 2: IICS0 = 0001×100B 3: IICS0 = 0001××00B 4: IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 ×: Don’t care...
Page 589
CHAPTER 14 SERIAL INTERFACE IIC0 (ii) When WTIM0 = 1 AD6 to AD0 R/W ACK D7 to D0 D7 to D0 1: IICS0 = 0110×010B 2: IICS0 = 0010×110B 3: IICS0 = 0010×100B 4: IICS0 = 0010××00B 5: IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1...
Page 590
CHAPTER 14 SERIAL INTERFACE IIC0 (b) When arbitration loss occurs during transmission of extension code AD6 to AD0 R/W ACK D7 to D0 D7 to D0 1: IICS0 = 0110×010B Sets LREL0 = 1 by software 2: IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1...
Page 591
CHAPTER 14 SERIAL INTERFACE IIC0 (ii) When WTIM0 = 1 AD6 to AD0 R/W ACK D7 to D0 D7 to D0 1: IICS0 = 10001110B 2: IICS0 = 01000100B 3: IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 (d) When loss occurs due to restart condition during data transfer (i) Not extension code (Example: does not match with SVA0) AD6 to AD0 R/W ACK...
Page 592
CHAPTER 14 SERIAL INTERFACE IIC0 (ii) Extension code AD6 to AD0 R/W ACK D7 to Dn AD6 to AD0 D7 to D0 1: IICS0 = 1000×110B 2: IICS0 = 01100010B Sets LREL0 = 1 by software 3: IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1...
Page 593
CHAPTER 14 SERIAL INTERFACE IIC0 (f) When arbitration loss occurs due to low-level data when attempting to generate a restart condition (i) When WTIM0 = 0 STT0 = 1 ↓ AD6 to AD0 R/W ACK D7 to D0 D7 to D0 D7 to D0 1: IICS0 = 1000×110B 2: IICS0 = 1000×000B (Sets WTIM0 to 1)
Page 594
CHAPTER 14 SERIAL INTERFACE IIC0 (g) When arbitration loss occurs due to a stop condition when attempting to generate a restart condition (i) When WTIM0 = 0 STT0 = 1 ↓ AD6 to AD0 R/W ACK D7 to D0 1: IICS0 = 1000×110B 2: IICS0 = 1000×000B (Sets WTIM0 to 1) 3: IICS0 = 1000××00B (Sets STT0 to 1) 4: IICS0 = 01000001B...
Page 595
CHAPTER 14 SERIAL INTERFACE IIC0 (h) When arbitration loss occurs due to low-level data when attempting to generate a stop condition (i) When WTIM0 = 0 SPT0 = 1 ↓ AD6 to AD0 R/W ACK D7 to D0 D7 to D0 D7 to D0 1: IICS0 = 1000×110B 2: IICS0 = 1000×000B (Sets WTIM0 to 1)
CHAPTER 14 SERIAL INTERFACE IIC0 14.6 Timing Charts When using the I C bus mode, the master device outputs an address via the serial bus to select one of several slave devices as its communication partner. After outputting the slave address, the master device transmits the TRC0 bit (bit 3 of IIC status register 0 (IICS0)), which specifies the data transfer direction, and then starts serial communication with the slave device.
Page 597
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-28. Example of Master to Slave Communication (When 9-Clock Wait Is Selected for Both Master and Slave) (1/3) (1) Start condition ~ address Processing by master device ← ← IIC0 IIC0 address IIC0 data Note 1 ACKD0 STD0 SPD0...
Page 598
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-28. Example of Master to Slave Communication (When 9-Clock Wait Is Selected for Both Master and Slave) (2/3) (2) Data Processing by master device ← ← IIC0 data Note 1 IIC0 data Note 1 IIC0 ACKD0 STD0...
Page 599
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-28. Example of Master to Slave Communication (When 9-Clock Wait Is Selected for Both Master and Slave) (3/3) (3) Stop condition Processing by master device ← ← IIC0 IIC0 data Note 1 IIC0 address ACKD0 STD0 SPD0...
Page 600
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-29. Example of Slave to Master Communication (When 8-Clock Wait Is Selected for Master, 9-Clock Wait Is Selected for Slave) (1/3) (1) Start condition ~ address Processing by master device ← ← IIC0 IIC0 address IIC0 FFH Note 1...
Page 601
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-29. Example of Slave to Master Communication (When 8-Clock Wait Is Selected for Master, 9-Clock Wait Is Selected for Slave) (2/3) (2) Data Processing by master device ← ← IIC0 IIC0 FFH Note 1 IIC0 FFH Note 1 ACKD0...
Page 602
CHAPTER 14 SERIAL INTERFACE IIC0 Figure 14-29. Example of Slave to Master Communication (When 8-Clock Wait Is Changed to 9-Clock Wait for Master, 9-Clock Wait Is Selected for Slave) (3/3) (3) Stop condition Processing by master device ← IIC0 address ←...
CHAPTER 15 MULTIPLIER 15.1 Functions of Multiplier The multiplier has the following functions. • Can execute calculation of 16 bits × 16 bits = 32 bits. Figure 15-1 shows the block diagram of the multiplier. Figure 15-1. Block Diagram of Multiplier Internal bus Multiplication input data Multiplication input data...
CHAPTER 15 MULTIPLIER 15.2 Configuration of Multiplier (1) 16-bit higher multiplication result storage register and 16-bit lower multiplication result storage register (MULOH, MULOL) These two registers, MULOH and MULOL, are used to store a 32-bit multiplication result. The higher 16 bits of the multiplication result are stored in MULOH and the lower 16 bits, in MULOL, so that a total of 32 bits of the multiplication result can be stored.
CHAPTER 15 MULTIPLIER 15.3 Operation of Multiplier The result of the multiplication can be obtained by storing the values in the MULA and MULB registers and then reading the MULOH and MULOL registers after waiting for 1 clock. The result can also be obtained after 1 clock or more has elapsed, even when fixing either of MULA or MULB and rewrite the other of these.
CHAPTER 16 DMA CONTROLLER The 78K0R/KG3 has an internal DMA (Direct Memory Access) controller. Data can be automatically transferred between the peripheral hardware supporting DMA, SFRs, and internal RAM without via CPU. As a result, the normal internal operation of the CPU and data transfer can be executed in parallel with transfer between the SFR and internal RAM, and therefore, a large capacity of data can be processed.
CHAPTER 16 DMA CONTROLLER 16.2 Configuration of DMA Controller The DMA controller includes the following hardware. Table 16-1. Configuration of DMA Controller Item Configuration • DMA SFR address registers 0, 1 (DSA0, DSA1) Address registers • DMA RAM address registers 0, 1 (DRA0, DRA1) •...
Page 608
CHAPTER 16 DMA CONTROLLER (2) DMA RAM address register n (DRAn) This is a 16-bit register that is used to set a RAM address that is the transfer source or destination of DMA channel n. Addresses of the internal RAM area other than the general-purpose registers (FEF00H to FFEDFH in the μ...
Page 609
CHAPTER 16 DMA CONTROLLER (3) DMA byte count register n (DBCn) This is a 10-bit register that is used to set the number of times DMA channel n executes transfer. Be sure to set the number of times of transfer to this DBCn register before executing DMA transfer (up to 1024 times). Each time DMA transfer has been executed, this register is automatically decremented.
CHAPTER 16 DMA CONTROLLER 16.3 Registers Controlling DMA Controller DMA controller is controlled by the following registers. • DMA mode control register n (DMCn) • DMA operation control register n (DRCn) Remark n: DMA channel number (n = 0, 1) User’s Manual U17894EJ9V0UD...
Page 611
CHAPTER 16 DMA CONTROLLER (1) DMA mode control register n (DMCn) DMCn is a register that is used to set a transfer mode of DMA channel n. It is used to select a transfer direction, data size, setting of pending, and start source. Bit 7 (STGn) is a software trigger that starts DMA. Rewriting bits 6, 5, and 3 to 0 of DMCn is prohibited during operation (when DSTn = 1).
Page 612
CHAPTER 16 DMA CONTROLLER Figure 16-4. Format of DMA Mode Control Register n (DMCn) (2/2) Address: FFFBAH (DMC0), FFFBBH (DMC1) After reset: 00H Symbol <7> <6> <5> <4> DMCn STGn DRSn DWAITn IFCn3 IFCn2 IFCn1 IFCn0 Note IFCn IFCn IFCn IFCn Selection of DMA start source Trigger signal...
Page 613
CHAPTER 16 DMA CONTROLLER (2) DMA operation control register n (DRCn) DRCn is a register that is used to enable or disable transfer of DMA channel n. Rewriting bit 7 (DENn) of this register is prohibited during operation (when DSTn = 1). DRCn can be set by a 1-bit or 8-bit memory manipulation instruction.
CHAPTER 16 DMA CONTROLLER 16.4 Operation of DMA Controller 16.4.1 Operation procedure <1> The DMA controller is enabled to operate when DENn = 1. Before writing the other registers, be sure to set DENn to 1. Use 80H to write with an 8-bit manipulation instruction. <2>...
Page 615
CHAPTER 16 DMA CONTROLLER Figure 16-6. Operation Procedure DENn = 1 Set by software program Setting DSAn, DRAn, DBCn, and DMCn DSTn = 1 DMA trigger = 1? Transmitting DMA request Receiving DMA acknowledge Operation by DMA DMA transfer controller (hardware) DRAn = DRAn + 1 (or + 2) DBCn = DBCn −...
CHAPTER 16 DMA CONTROLLER 16.4.2 Transfer mode The following four modes can be selected for DMA transfer by using bits 6 and 5 (DRSn and DSn) of the DMCn register. DRSn DMA Transfer Mode Transfer from SFR of 1-byte data (fixed address) to RAM (address is incremented by +1) Transfer from SFR of 2-byte data (fixed address) to RAM (address is incremented by +2) Transfer from RAM of 1-byte data (address is incremented by +1) to SFR (fixed address) Transfer from RAM of 2-byte data (address is incremented by +2) to SFR (fixed address)
CHAPTER 16 DMA CONTROLLER 16.5 Example of Setting of DMA Controller 16.5.1 CSI consecutive transmission A flowchart showing an example of setting for CSI consecutive transmission is shown below. • Consecutive transmission (256 bytes) of CSI00 • DMA channel 0 is used for DMA transfer. •...
Page 618
CHAPTER 16 DMA CONTROLLER Figure 16-7. Setting Example of CSI Consecutive Transmission Start DEN0 = 1 DSA0 = 10H DRA0 = F100H DBC0 = 0100H DMC0 = 46H Setting for CSI transfer DST0 = 1 DMA is started. STG0 = 1 INTCSI00 occurs.
CHAPTER 16 DMA CONTROLLER <R> 16.5.2 CSI master reception A flowchart showing an example of setting for CSI master reception is shown below. • Master reception (256 bytes) of CSI00 • DMA channel 0 is used to read received data and DMA channel 1 is used to write dummy data. •...
CHAPTER 16 DMA CONTROLLER <R> 16.5.3 CSI transmission/reception A flowchart showing an example of setting for CSI transmission/reception is shown below. • Transmission/reception (256 bytes) of CSI00 • DMA channel 0 is used to read received data and DMA channel 1 is used to write transmit data. •...
CHAPTER 16 DMA CONTROLLER 16.5.4 Consecutive capturing of A/D conversion results A flowchart of an example of setting for consecutively capturing A/D conversion results is shown below. • Consecutive capturing of A/D conversion results. • DMA channel 1 is used for DMA transfer. •...
Page 624
CHAPTER 16 DMA CONTROLLER Figure 16-10. Setting Example of Consecutively Capturing A/D Conversion Results Start DEN1 = 1 DSA1 = 1EH DRA1 = F380H DBC1 = 0000H DMC1 = 2CH DST1 = 1 Starting A/D conversion INTAD occurs. User program processing DMA1 transfer INTDMA1 occurs.
CHAPTER 16 DMA CONTROLLER 16.5.5 UART consecutive reception + ACK transmission A flowchart illustrating an example of setting for UART consecutive reception + ACK transmission is shown below. • Consecutively receives data from UART0 and outputs ACK to P10 on completion of reception. •...
CHAPTER 16 DMA CONTROLLER 16.5.6 Holding DMA transfer pending by DWAITn When DMA transfer is started, transfer is performed while an instruction is executed. At this time, the operation of <R> the CPU is stopped and delayed for the duration of 2 clocks. If this poses a problem to the operation of the set system, a DMA transfer can be held pending by setting DWAITn to 1.
CHAPTER 16 DMA CONTROLLER 16.5.7 Forced termination by software After DSTn is set to 0 by software, it takes up to 2 clocks until a DMA transfer is actually stopped and DSTn is set to 0. To forcibly terminate a DMA transfer by software without waiting for occurrence of the interrupt (INTDMAn) of DMAn, therefore, perform either of the following processes.
Page 629
CHAPTER 16 DMA CONTROLLER Figure 16-13. Forced Termination of DMA Transfer (2/2) Example 3 • Procedure for forcibly terminating the DMA • Procedure for forcibly terminating the DMA transfer for one channel if both channels are used transfer for both channels if both channels are used DWAIT0 = 1 DWAIT0 = 1 DWAIT1 = 1...
CHAPTER 16 DMA CONTROLLER 16.6 Cautions on Using DMA Controller <R> (1) Priority of DMA During DMA transfer, a request from the other DMA channel is held pending even if generated. The pending DMA transfer is started after the ongoing DMA transfer is completed. If two DMA requests are generated at the same time, however, DMA channel 0 takes priority over DMA channel 1.
Page 631
CHAPTER 16 DMA CONTROLLER <R> (2) DMA response time The response time of DMA transfer is as follows. Table 16-2. Response Time of DMA Transfer Minimum Time Maximum Time Note Response time 3 clocks 10 clocks Note This is the time required to execute an instruction from internal ROM (without accessing data in external memory).
Page 632
CHAPTER 16 DMA CONTROLLER (3) Operation in standby mode The DMA controller operates as follows in the standby mode. Table 16-3. DMA Operation in Standby Mode Status DMA Operation HALT mode Normal operation STOP mode Stops operation. If DMA transfer and STOP instruction execution contend, DMA transfer may be damaged.
17.2 Interrupt Sources and Configuration The 78K0R/KG3 has a total of 42 interrupt sources including maskable interrupts and software interrupts. In addition, they also have up to five reset sources (see Table 17-1). The vector codes that store the program start address when branching due to the generation of a reset or various interrupt requests are two bytes each, so interrupts jump to a 64 K address of 00000H to 0FFFFH.
Page 634
CHAPTER 17 INTERRUPT FUNCTIONS Table 17-1. Interrupt Source List (1/2) Interrupt Default Interrupt Source Internal/ Vector Basic Note 1 Type Priority External Table Configuration Name Trigger Note 2 Address Type Note 3 Maskable INTWDTI Watchdog timer interval Internal 0004H (75% of overflow time) Note 4 INTLVI Low-voltage detection...
Page 635
CHAPTER 17 INTERRUPT FUNCTIONS Table 17-1. Interrupt Source List (2/2) Interrupt Default Interrupt Source Internal/ Vector Basic Note 1 Type Priority External Table Configuration Name Trigger Note 2 Address Type Maskable INTAD End of A/D conversion Internal 0034H INTRTC Fixed-cycle signal of real-time counter/alarm 0036H match detection INTRTCI...
Page 636
CHAPTER 17 INTERRUPT FUNCTIONS Figure 17-1. Basic Configuration of Interrupt Function (1/2) (A) Internal maskable interrupt Internal bus ISP1 ISP0 Vector table Interrupt Priority controller address generator request Standby release signal <R> (B) External maskable interrupt (INTPn) Internal bus External interrupt edge enable register ISP1 ISP0...
CHAPTER 17 INTERRUPT FUNCTIONS 17.3 Registers Controlling Interrupt Functions The following 6 types of registers are used to control the interrupt functions. • Interrupt request flag registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H) • Interrupt mask flag registers (MK0L, MK0H, MK1L, MK1H, MK2L, MK2H) •...
Page 640
CHAPTER 17 INTERRUPT FUNCTIONS (1) Interrupt request flag registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H) The interrupt request flags are set to 1 when the corresponding interrupt request is generated or an instruction is executed. They are cleared to 0 when an instruction is executed upon acknowledgment of an interrupt request or upon reset signal generation.
Page 641
CHAPTER 17 INTERRUPT FUNCTIONS Figure 17-2. Format of Interrupt Request Flag Registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H) (2/2) Address: FFFD1H After reset: 00H Symbol <0> IF2H PIF11 XXIFX Interrupt request flag No interrupt request signal is generated Interrupt request is generated, interrupt request status Cautions 1.
Page 642
CHAPTER 17 INTERRUPT FUNCTIONS Figure 17-3. Format of Interrupt Mask Flag Registers (MK0L, MK0H, MK1L, MK1H, MK2L, MK2H) Address: FFFE4H After reset: FFH Symbol <7> <6> <5> <4> <3> <2> <1> <0> MK0L PMK5 PMK4 PMK3 PMK2 PMK1 PMK0 LVIMK WDTIMK Address: FFFE5H After reset: FFH...
Page 643
CHAPTER 17 INTERRUPT FUNCTIONS (3) Priority specification flag registers (PR00L, PR00H, PR01L, PR01H, PR02L, PR02H, PR10L, PR10H, PR11L, PR11H, PR12L, PR12H) The priority specification flag registers are used to set the corresponding maskable interrupt priority level. A priority level is set by using the PR0xy and PR1xy registers in combination (xy = 0L, 0H, 1L, 1H, 2L, or 2H). PR00L, PR00H, PR01L, PR01H, PR02L, PR02H, PR10L, PR10H, PR11L, PR11H, PR12L, and PR12H can be set by a 1-bit or 8-bit memory manipulation instruction.
Page 644
CHAPTER 17 INTERRUPT FUNCTIONS Figure 17-4. Format of Priority Specification Flag Registers (PR00L, PR00H, PR01L, PR01H, PR02L, PR02H, PR10L, PR10H, PR11L, PR11H, PR12L, PR12H) (2/2) Address: FFFEBH After reset: FFH Symbol <7> <6> <5> <4> <3> <2> <1> <0> PR01H TMPR004 SREPR02 SRPR02...
Page 645
CHAPTER 17 INTERRUPT FUNCTIONS (4) External interrupt rising edge enable registers (EGP0, EGP1), external interrupt falling edge enable registers (EGN0, EGN1) These registers specify the valid edge for INTP0 to INTP11. EGP0, EGP1, EGN0, and EGN1 can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation clears these registers to 00H.
Page 647
CHAPTER 17 INTERRUPT FUNCTIONS (5) Program status word (PSW) The program status word is a register used to hold the instruction execution result and the current status for an interrupt request. The IE flag that sets maskable interrupt enable/disable and the ISP0 and ISP1 flags that controls multiple interrupt servicing are mapped to the PSW.
CHAPTER 17 INTERRUPT FUNCTIONS 17.4 Interrupt Servicing Operations 17.4.1 Maskable interrupt acknowledgment A maskable interrupt becomes acknowledgeable when the interrupt request flag is set to 1 and the mask (MK) flag corresponding to that interrupt request is cleared to 0. A vectored interrupt request is acknowledged if interrupts are in the interrupt enabled state (when the IE flag is set to 1).
Page 649
CHAPTER 17 INTERRUPT FUNCTIONS Figure 17-7. Interrupt Request Acknowledgment Processing Algorithm Start ××IF = 1? Yes (interrupt request generation) ××MK = 0? Interrupt request held pending ××PR No (Low priority) (××PR ≤ (ISP1, ISP0) Interrupt request held pending Higher priority than other interrupt requests simultaneously generated?
CHAPTER 17 INTERRUPT FUNCTIONS 17.4.3 Multiple interrupt servicing Multiple interrupt servicing occurs when another interrupt request is acknowledged during execution of an interrupt. Multiple interrupt servicing does not occur unless the interrupt request acknowledgment enabled state is selected (IE = 1). When an interrupt request is acknowledged, interrupt request acknowledgment becomes disabled (IE = 0). Therefore, to enable multiple interrupt servicing, it is necessary to set (1) the IE flag with the EI instruction during interrupt servicing to enable interrupt acknowledgment.
CHAPTER 17 INTERRUPT FUNCTIONS 17.4.4 Interrupt request hold There are instructions where, even if an interrupt request is issued while the instruction are being executed, interrupt request acknowledgment is held pending until the end of execution of the next instruction. These instructions (interrupt request hold instructions) are listed below.
CHAPTER 18 KEY INTERRUPT FUNCTION 18.1 Functions of Key Interrupt A key interrupt (INTKR) can be generated by setting the key return mode register (KRM) and inputting a falling edge to the key interrupt input pins (KR0 to KR7). Table 18-1. Assignment of Key Interrupt Detection Pins Flag Description KRM0...
CHAPTER 18 KEY INTERRUPT FUNCTION 18.3 Register Controlling Key Interrupt (1) Key return mode register (KRM) This register controls the KRM0 to KRM7 bits using the KR0 to KR7 signals, respectively. KRM can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation clears this register to 00H.
CHAPTER 19 STANDBY FUNCTION 19.1 Standby Function and Configuration 19.1.1 Standby function The standby function reduces the operating current of the system, and the following two modes are available. (1) HALT mode HALT instruction execution sets the HALT mode. In the HALT mode, the CPU operation clock is stopped. If the high-speed system clock oscillator, internal high-speed oscillator, or subsystem clock oscillator is operating before the HALT mode is set, oscillation of each clock continues.
Page 658
CHAPTER 19 STANDBY FUNCTION (1) Oscillation stabilization time counter status register (OSTC) This is the register that indicates the count status of the X1 clock oscillation stabilization time counter. The X1 clock oscillation stabilization time can be checked in the following case, •...
Page 659
CHAPTER 19 STANDBY FUNCTION (2) Oscillation stabilization time select register (OSTS) This register is used to select the X1 clock oscillation stabilization wait time when the STOP mode is released. When the X1 clock is selected as the CPU clock, the operation waits for the time set using OSTS after the STOP mode is released.
CHAPTER 19 STANDBY FUNCTION 19.2 Standby Function Operation 19.2.1 HALT mode (1) HALT mode The HALT mode is set by executing the HALT instruction. HALT mode can be set regardless of whether the CPU clock before the setting was the high-speed system clock, internal high-speed oscillation clock, or subsystem clock.
Page 661
CHAPTER 19 STANDBY FUNCTION Table 19-1. Operating Statuses in HALT Mode (1/2) HALT Mode Setting When HALT Instruction Is Executed While CPU Is Operating on Main System Clock When CPU Is Operating on When CPU Is Operating on When CPU Is Operating on Internal High-Speed X1 Clock (f External Main System Clock...
Page 662
CHAPTER 19 STANDBY FUNCTION Table 19-1. Operating Statuses in HALT Mode (2/2) HALT Mode Setting When HALT Instruction Is Executed While CPU Is Operating on Subsystem Clock Item When CPU Is Operating on XT1 Clock (f System clock Clock supply to the CPU is stopped Main system clock Status before HALT mode was set is retained Operates or stops by external clock input...
Page 663
CHAPTER 19 STANDBY FUNCTION (2) HALT mode release The HALT mode can be released by the following two sources. (a) Release by unmasked interrupt request When an unmasked interrupt request is generated, the HALT mode is released. If interrupt acknowledgment is enabled, vectored interrupt servicing is carried out.
Page 664
CHAPTER 19 STANDBY FUNCTION (b) Release by reset signal generation When the reset signal is generated, HALT mode is released, and then, as in the case with a normal reset operation, the program is executed after branching to the reset vector address. Figure 19-4.
CHAPTER 19 STANDBY FUNCTION 19.2.2 STOP mode (1) STOP mode setting and operating statuses The STOP mode is set by executing the STOP instruction, and it can be set only when the CPU clock before the setting was the main system clock. Caution Because the interrupt request signal is used to clear the standby mode, if there is an interrupt source with the interrupt request flag set and the interrupt mask flag reset, the standby mode is immediately cleared if set.
Page 666
CHAPTER 19 STANDBY FUNCTION Table 19-2. Operating Statuses in STOP Mode STOP Mode Setting When STOP Instruction Is Executed While CPU Is Operating on Main System Clock When CPU Is Operating on When CPU Is Operating on When CPU Is Operating on Internal High-Speed X1 Clock (f External Main System Clock...
Page 667
CHAPTER 19 STANDBY FUNCTION Cautions 1. To use the peripheral hardware that stops operation in the STOP mode, and the peripheral hardware for which the clock that stops oscillating in the STOP mode after the STOP mode is released, restart the peripheral hardware. 2.
Page 668
CHAPTER 19 STANDBY FUNCTION (2) STOP mode release Figure 19-5. Operation Timing When STOP Mode Is Released (Release by Unmasked Interrupt Request) STOP mode release STOP mode High-speed system clock (X1 oscillation) High-speed system clock (external clock input) Internal high-speed oscillation clock Wait for oscillation accuracy stabilization High-speed system...
Page 669
CHAPTER 19 STANDBY FUNCTION (a) Release by unmasked interrupt request When an unmasked interrupt request is generated, the STOP mode is released. After the oscillation stabilization time has elapsed, if interrupt acknowledgment is enabled, vectored interrupt servicing is carried out. If interrupt acknowledgment is disabled, the next address instruction is executed. Figure 19-6.
Page 670
CHAPTER 19 STANDBY FUNCTION Figure 19-6. STOP Mode Release by Interrupt Request Generation (2/2) (3) When internal high-speed oscillation clock is used as CPU clock Interrupt request STOP instruction Standby release signal Supply of the CPU Normal operation Normal operation clock is stopped (internal high-speed (internal high-speed...
Page 671
CHAPTER 19 STANDBY FUNCTION (b) Release by reset signal generation When the reset signal is generated, STOP mode is released, and then, as in the case with a normal reset operation, the program is executed after branching to the reset vector address. Figure 19-7.
CHAPTER 20 RESET FUNCTION The following five operations are available to generate a reset signal. (1) External reset input via RESET pin (2) Internal reset by watchdog timer program loop detection (3) Internal reset by comparison of supply voltage and detection voltage of power-on-clear (POC) circuit (4) Internal reset by comparison of supply voltage of low-voltage detector (LVI) or input voltage (EXLVI) from external input pin, and detection voltage Note...
Page 673
Figure 20-1. Block Diagram of Reset Function Internal bus Reset control flag register (RESF) TRAP WDRF LVIRF Watchdog timer reset signal Clear Clear Clear Reset signal by execution of illegal instruction RESF register read signal Reset signal to LVIM/LVIS register RESET Power-on clear circuit reset signal Reset signal...
Page 674
CHAPTER 20 RESET FUNCTION Figure 20-2. Timing of Reset by RESET Input Wait for oscillation accuracy stabilization Internal high-speed oscillation clock Starting X1 oscillation is specified by software. High-speed system clock (when X1 oscillation is selected) Normal operation Reset period CPU status Normal operation (internal high-speed oscillation clock)
Page 675
CHAPTER 20 RESET FUNCTION Figure 20-4. Timing of Reset in STOP Mode by RESET Input Wait for oscillation accuracy stabilization STOP instruction execution Internal high-speed oscillation clock Starting X1 oscillation is specified by software. High-speed system clock (when X1 oscillation is selected) Normal Stop status Reset period...
Page 676
CHAPTER 20 RESET FUNCTION Table 20-1. Operation Statuses During Reset Period Item During Reset Period System clock Clock supply to the CPU is stopped. Main system clock Operation stopped Operation stopped (X1 and X2 pins are input port mode) Clock input invalid (pin is input port mode) Subsystem clock Operation stopped (XT1 and XT2 pins are input port mode) Operation stopped...
Page 677
CHAPTER 20 RESET FUNCTION Table 20-2. Hardware Statuses After Reset Acknowledgment (1/3) Hardware After Reset Note 1 Acknowledgment Program counter (PC) The contents of the reset vector table (0000H, 0001H) are set. Stack pointer (SP) Undefined Program status word (PSW) Note 2 Data memory Undefined...
Page 678
CHAPTER 20 RESET FUNCTION Table 20-2. Hardware Statuses After Reset Acknowledgment (2/3) Hardware Status After Reset Note 1 Acknowledgment Real-time counter Subcount register (RSUBC) 0000H Second count register (SEC) Minute count register (MIN) Hour count register (HOUR) Day count register (DAY) Week count register (WEEK) Month count register (MONTH) Year count register (YEAR)
Page 679
CHAPTER 20 RESET FUNCTION Table 20-2. Hardware Statuses After Reset Acknowledgment (3/3) Hardware Status After Reset Note 1 Acknowledgment Serial interface IIC0 Shift register 0 (IIC0) Control register 0 (IICC0) Slave address register 0 (SVA0) Clock select register 0 (IICCL0) Function expansion register 0 (IICX0) Status register 0 (IICS0) Flag register 0 (IICF0)
CHAPTER 20 RESET FUNCTION 20.1 Register for Confirming Reset Source Many internal reset generation sources exist in the 78K0R/KG3. The reset control flag register (RESF) is used to store which source has generated the reset request. RESF can be read by an 8-bit memory manipulation instruction.
CHAPTER 21 POWER-ON-CLEAR CIRCUIT 21.1 Functions of Power-on-Clear Circuit The power-on-clear circuit (POC) has the following functions. • Generates internal reset signal at power on. ) exceeds 1.59 V ±0.09 V. The reset signal is released when the supply voltage (V Caution If the low-voltage detector (LVI) is set to ON by an option byte by default, the reset signal is not ) exceeds 2.07 V ±0.2 V.
CHAPTER 21 POWER-ON-CLEAR CIRCUIT 21.2 Configuration of Power-on-Clear Circuit The block diagram of the power-on-clear circuit is shown in Figure 21-1. Figure 21-1. Block Diagram of Power-on-Clear Circuit Internal reset signal − Reference voltage source 21.3 Operation of Power-on-Clear Circuit •...
CHAPTER 21 POWER-ON-CLEAR CIRCUIT Figure 21-2. Timing of Generation of Internal Reset Signal by Power-on-Clear Circuit and Low-Voltage Detector (1/2) (1) When LVI is OFF upon power application (option byte: LVIOFF = 1) Set LVI to be Set LVI to be Set LVI to be used for reset used for interrupt...
Page 684
CHAPTER 21 POWER-ON-CLEAR CIRCUIT Figure 21-2. Timing of Generation of Internal Reset Signal by Power-on-Clear Circuit and Low-Voltage Detector (2/2) (2) When LVI is ON upon power application (option byte: LVIOFF = 0) Set LVI Set LVI to be Set LVI Change LVI = 2.07 V) used for interrupt...
CHAPTER 21 POWER-ON-CLEAR CIRCUIT 21.4 Cautions for Power-on-Clear Circuit In a system where the supply voltage (V ) fluctuates for a certain period in the vicinity of the POC detection voltage (V ), the system may be repeatedly reset and released from the reset status. In this case, the time from release of reset to the start of the operation of the microcontroller can be arbitrarily set by taking the following action.
Page 686
CHAPTER 21 POWER-ON-CLEAR CIRCUIT Figure 21-3. Example of Software Processing After Reset Release (2/2) • Checking reset source Check reset source TRAP of RESF register = 1? Reset processing by Note illegal instruction execution WDRF of RESF register = 1? Reset processing by watchdog timer LVIRF of RESF...
CHAPTER 22 LOW-VOLTAGE DETECTOR 22.1 Functions of Low-Voltage Detector The low-voltage detector (LVI) has the following functions. • The LVI circuit compares the supply voltage (V ) with the detection voltage (V ) or the input voltage from an = 1.21 V ±0.1 V), and generates an internal reset Note external input pin (EXLVI) with the detection voltage (V EXLVI...
Page 690
CHAPTER 22 LOW-VOLTAGE DETECTOR Note When LVION is set to 1, operation of the comparator in the LVI circuit is started. Use software to wait for the following periods of time, between when LVION is set to 1 and when the voltage is confirmed with LVIF.
Page 691
CHAPTER 22 LOW-VOLTAGE DETECTOR (2) Low-voltage detection level select register (LVIS) This register selects the low-voltage detection level. This register can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation input sets this register to 0EH. Figure 22-3.
Page 692
CHAPTER 22 LOW-VOLTAGE DETECTOR Cautions 2. Change the LVIS value with either of the following methods. • When changing the value after stopping LVI <1> Stop LVI (LVION = 0). <2> Change the LVIS register. <3> Set to the mode used as an interrupt (LVIMD = 0). <4>...
CHAPTER 22 LOW-VOLTAGE DETECTOR 22.4 Operation of Low-Voltage Detector The low-voltage detector can be used in the following two modes. (1) Used as reset (LVIMD = 1) • If LVISEL = 0, compares the supply voltage (V ) and detection voltage (V ), generates an internal reset ≥...
CHAPTER 22 LOW-VOLTAGE DETECTOR 22.4.1 When used as reset (1) When detecting level of supply voltage (V (a) When LVI default start function stopped is set (option byte: LVIOFF = 1) • When starting operation <1> Mask the LVI interrupt (LVIMK = 1). <2>...
CHAPTER 22 LOW-VOLTAGE DETECTOR Figure 22-5. Timing of Low-Voltage Detector Internal Reset Signal Generation (Bit: LVISEL = 0, Option Byte: LVIOFF = 1) Set LVI to be used for reset Supply voltage (V = 1.59 V (TYP.) Time LVIMK flag Note 1 (set by software) <1>...
Page 696
CHAPTER 22 LOW-VOLTAGE DETECTOR (b) When LVI default start function enabled is set (option byte: LVIOFF = 0) • When starting operation Start in the following initial setting state. Set bit 7 (LVION) of LVIM to 1 (enables LVI operation) •...
Page 697
CHAPTER 22 LOW-VOLTAGE DETECTOR Figure 22-6. Timing of Low-Voltage Detector Internal Reset Signal Generation (Bit: LVISEL = 0, Option Byte: LVIOFF = 0) Interrupt operation mode is set by setting Change LVI detection Reset mode is set by LVIMD to 0 (LVI interrupt is masked) voltage (VLVI) setting LVIMD to 1 Supply voltage (V...
Page 698
CHAPTER 22 LOW-VOLTAGE DETECTOR (2) When detecting level of input voltage from external input pin (EXLVI) • When starting operation <1> Mask the LVI interrupt (LVIMK = 1). <2> Set bit 2 (LVISEL) of the low-voltage detection register (LVIM) to 1 (detects level of input voltage from external input pin (EXLVI)).
Page 699
CHAPTER 22 LOW-VOLTAGE DETECTOR Figure 22-7. Timing of Low-Voltage Detector Internal Reset Signal Generation (Bit: LVISEL = 1) Set LVI to be used for reset Input voltage from external input pin (EXLVI) EXLVI Time Note 1 LVIMK flag <1> (set by software) LVISEL flag Not cleared Not cleared...
CHAPTER 22 LOW-VOLTAGE DETECTOR 22.4.2 When used as interrupt (1) When detecting level of supply voltage (V (a) When LVI default start function stopped is set (option byte: LVIOFF = 1) • When starting operation <1> Mask the LVI interrupt (LVIMK = 1). <2>...
Page 701
CHAPTER 22 LOW-VOLTAGE DETECTOR Figure 22-8. Timing of Low-Voltage Detector Interrupt Signal Generation (Bit: LVISEL = 0, Option Byte: LVIOFF = 1) Supply voltage (V = 1.59 V (TYP.) Time Note 3 Note 3 LVIMK flag (set by software) <1> <8>...
Page 702
CHAPTER 22 LOW-VOLTAGE DETECTOR (b) When LVI default start function enabled is set (option byte: LVIOFF = 0) • When starting operation <1> Start in the following initial setting state. Set bit 7 (LVION) of LVIM to 1 (enables LVI operation) •...
Page 703
CHAPTER 22 LOW-VOLTAGE DETECTOR Figure 22-9. Timing of Low-Voltage Detector Interrupt Signal Generation (Bit: LVISEL = 0, Option Byte: LVIOFF = 0) Change LVI detection Mask LVI interrupts Cancelling the LVI interrupt voltage (V (LVIMK = 1) mask (LVIMK = 0) Supply voltage (V value after a change = 2.07 V (TYP.)
Page 704
CHAPTER 22 LOW-VOLTAGE DETECTOR (2) When detecting level of input voltage from external input pin (EXLVI) • When starting operation <1> Mask the LVI interrupt (LVIMK = 1). <2> Set bit 2 (LVISEL) of the low-voltage detection register (LVIM) to 1 (detects level of input voltage from external input pin (EXLVI)).
Page 705
CHAPTER 22 LOW-VOLTAGE DETECTOR Figure 22-10. Timing of Low-Voltage Detector Interrupt Signal Generation (Bit: LVISEL = 1) Input voltage from external input pin (EXLVI) EXLVI Time Note 3 Note 3 LVIMK flag (set by software) <1> Note 1 <7> Cleared by software LVISEL flag (set by software) <2>...
CHAPTER 22 LOW-VOLTAGE DETECTOR 22.5 Cautions for Low-Voltage Detector (1) Measures method when supply voltage (V ) frequently fluctuates in the vicinity of the LVI detection voltage (V In a system where the supply voltage (V ) fluctuates for a certain period in the vicinity of the LVI detection voltage (V ), the operation is as follows depending on how the low-voltage detector is used.
Page 707
CHAPTER 22 LOW-VOLTAGE DETECTOR Figure 22-11. Example of Software Processing After Reset Release (1/2) • If supply voltage fluctuation is 50 ms or less in vicinity of LVI detection voltage Reset Note Check the reset source, etc. Initialization processing <1> LVI reset ;...
Page 708
CHAPTER 22 LOW-VOLTAGE DETECTOR Figure 22-11. Example of Software Processing After Reset Release (2/2) • Checking reset source Check reset source TRAP of RESF register = 1? Reset processing by Note illegal instruction execution WDRF of RESF register = 1? Reset processing by watchdog timer LVIRF of RESF...
Page 709
CHAPTER 22 LOW-VOLTAGE DETECTOR Operation example 2: When used as interrupt Interrupt requests may be generated frequently. Take the following action. <Action> ) ≥ detection voltage (V Confirm that “supply voltage (V )” when detecting the falling edge of V , or “supply voltage (V ) <...
CHAPTER 23 REGULATOR 23.1 Regulator Overview The 78K0R/KG3 contains a circuit for operating the device with a constant voltage. At this time, in order to stabilize μ the regulator output voltage, connect the REGC pin to V via a capacitor (0.47 to 1 F).
Page 711
CHAPTER 23 REGULATOR Table 23-1. Regulator Output Voltage Conditions Mode Output Voltage Condition Low consumption 1.8 V During system reset current mode In STOP mode (except during OCD mode) When both the high-speed system clock (f ) and the internal high-speed oscillation clock (f ) are stopped during CPU operation with the subsystem clock When both the high-speed system clock (f...
CHAPTER 24 OPTION BYTE 24.1 Functions of Option Bytes Addresses 000C0H to 000C3H of the flash memory of the 78K0R/KG3 form an option byte area. Option bytes consist of user option byte (000C0H to 000C2H) and on-chip debug option byte (000C3H).
CHAPTER 24 OPTION BYTE 24.1.2 On-chip debug option byte (000C3H/ 010C3H) Control of on-chip debug operation • On-chip debug operation is disabled or enabled. Handling of data of flash memory in case of failure in on-chip debug security ID authentication •...
Page 714
CHAPTER 24 OPTION BYTE Figure 24-1. Format of User Option Byte (000C0H/010C0H) (2/2) Note 1 Address: 000C0H/010C0H WDTINIT WINDOW1 WINDOW0 WDTON WDCS2 WDCS1 WDCS0 WDSTBYON WDSTBYON Operation control of watchdog timer counter (HALT/STOP mode) Note 2 Counter operation stopped in HALT/STOP mode Counter operation enabled in HALT/STOP mode Notes 1.
CHAPTER 24 OPTION BYTE Figure 24-3. Format of Option Byte (000C2H/010C2H) Note Address: 000C2H/010C2H Note Be sure to set FFH to 000C2H, as these addresses are reserved areas. Also set FFH to 010C2H when the boot swap operation is used because 000C2H is replaced by 010C2H. 24.3 Format of On-chip Debug Option Byte The format of on-chip debug option byte is shown below.
CHAPTER 24 OPTION BYTE 24.4 Setting of Option Byte The user option byte and on-chip debug option byte can be set using the RA78K0R or PM+ linker option, in addition to describing to the source. When doing so, the contents set by using the linker option take precedence, even if descriptions exist in the source, as mentioned below.
Data can be written to the flash memory on-board or off-board, by using a dedicated flash memory programmer. (1) On-board programming The contents of the flash memory can be rewritten after the 78K0R/KG3 has been mounted on the target system. The connectors that connect the dedicated flash memory programmer must be mounted on the target system.
Page 718
CHAPTER 25 FLASH MEMORY Table 25-1. Wiring Between 78K0R/KG3 and Dedicated Flash Memory Programmer Pin Configuration of Dedicated Flash Memory GF Package GC Package Programmer Signal Name Pin Function Pin Name Pin No. Pin Name Pin No. Notes 1, 2...
Page 719
CHAPTER 25 FLASH MEMORY Examples of the recommended connection when using the adapter for flash memory writing are shown below. Figure 25-1. Example of Wiring Adapter for Flash Memory Writing (GF Package) (2.7 to 5.5. V) 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 VDD2 Notes 1, 2...
CHAPTER 25 FLASH MEMORY 25.2 Programming Environment The environment required for writing a program to the flash memory of the 78K0R/KG3 is illustrated below. Figure 25-3. Environment for Writing Program to Flash Memory PG-FP5, FL-PR5 QB-MINI2 FLMD0 PG-FP4, FL-PR4 RS-232C...
CHAPTER 25 FLASH MEMORY Table 25-2. Pin Connection Dedicated Flash Memory Programmer 78K0R/KG3 Connection Signal Name Pin Function Pin Name FLMD0 Output Mode signal FLMD0 voltage generation/power monitoring , EV , EV , AV , AV REF0 REF1 − Ground...
TOOL0 pin before reset is released (pulling down this pin is prohibited). Remark The SAU and IIC0 pins are not used for communication between the 78K0R/KG3 and dedicated flash memory programmer, because single-line UART is used. 25.4.3 RESET pin Signal conflict will occur if the reset signal of the dedicated flash memory programmer is connected to the RESET pin that is connected to the reset signal generator on the board.
CHAPTER 25 FLASH MEMORY 25.4.4 Port pins When the flash memory programming mode is set, all the pins not used for flash memory programming enter the same status as that immediately after reset. If external devices connected to the ports do not recognize the port status immediately after reset, the port pin must be connected to V or V via a resistor.
25.6.2 Flash memory programming mode To rewrite the contents of the flash memory by using the dedicated flash memory programmer, set the 78K0R/KG3 in the flash memory programming mode. To set the mode, set the FLMD0 pin and TOOL0 pin to V and clear the reset signal.
The 78K0R/KG3 communicates with the dedicated flash memory programmer by using commands. The signals sent from the flash memory programmer to the 78K0R/KG3 are called commands, and the signals sent from the 78K0R/KG3 to the dedicated flash memory programmer are called response.
Page 727
Baud Rate Set Sets baud rate when UART communication mode is selected. The 78K0R/KG3 returns a response for the command issued by the dedicated flash memory programmer. The response names sent from the 78K0R/KG3 are listed below. Table 25-6. Response Names...
CHAPTER 25 FLASH MEMORY 25.7 Security Settings The 78K0R/KG3 supports a security function that prohibits rewriting the user program written to the internal flash memory, so that the program cannot be changed by an unauthorized person. The operations shown below can be performed using the Security Set command. The security setting is valid when the programming mode is set next.
Page 729
CHAPTER 25 FLASH MEMORY Table 25-7. Relationship Between Enabling Security Function and Command (1) During on-board/off-board programming Valid Security Executed Command Batch Erase (Chip Erase) Block Erase Write Note Prohibition of batch erase (chip erase) Cannot be erased in batch Blocks cannot be Can be performed erased.
CHAPTER 25 FLASH MEMORY 25.8 Processing Time of Each Command When Using PG-FP4 or PG-FP5 (Reference Values) The processing time of each command (reference values) when using PG-FP4 or PG-FP5 as the dedicated flash memory programmer is shown below. Table 25-9. Processing Time of Each Command When Using PG-FP4 (Reference Values) PG-FP4 Port: UART Command...
25.9 Flash Memory Programming by Self-Programming The 78K0R/KG3 supports a self-programming function that can be used to rewrite the flash memory via a user program. Because this function allows a user application to rewrite the flash memory by using the 78K0R/KG3 self- programming library, it can be used to upgrade the program in the field.
Page 732
CHAPTER 25 FLASH MEMORY The following figure illustrates a flow of rewriting the flash memory by using a self programming library. Figure 25-11. Flow of Self Programming (Rewriting Flash Memory) Start of self programming FlashStart Setting operating environment FlashEnv CheckFLMD FlashBlockBlankCheck Normal completion? FlashBlockErase...
1 in advance. When the program has been correctly written to boot cluster 1, swap this boot cluster 1 and boot cluster 0 by using the set information function of the firmware of the 78K0R/KG3, so that boot cluster 1 is used as a boot area.
Page 734
CHAPTER 25 FLASH MEMORY Figure 25-13. Example of Executing Boot Swapping Block number Erasing block 2 Erasing block 3 Program Program Boot cluster 1 Program 0 1 0 0 0 H Boot program Boot program Boot program Boot cluster 0 Boot program Boot program Boot program...
CHAPTER 25 FLASH MEMORY 25.9.2 Flash shield window function The flash shield window function is provided as one of the security functions for self programming. It disables writing to and erasing areas outside the range specified as a window only during self programming. The window range can be set by specifying the start and end blocks.
(QB-MINI2). Caution The 78K0R/KG3 has an on-chip debug function, which is provided for development and evaluation. Do not use the on-chip debug function in products designated for mass production, because the guaranteed number of rewritable times of the flash memory may be exceeded when this function is used, and product reliability therefore cannot be guaranteed.
26.2 On-Chip Debug Security ID The 78K0R/KG3 has an on-chip debug operation control bit in the flash memory at 000C3H (see CHAPTER 24 OPTION BYTE) and an on-chip debug security ID setting area at 000C4H to 000CDH, to prevent third parties from reading memory content.
Page 738
CHAPTER 26 ON-CHIP DEBUG FUNCTION Figure 26-2. Memory Spaces Where Debug Monitor Programs Are Allocated Internal ROM Internal RAM Note 1 (1 KB) Stack area for debugging Internal RAM Note 3 (6 bytes) area 0 2 0 0 0 H Use prohibited 0 1 0 D 8 H Debug monitor area...
CHAPTER 27 BCD CORRECTION CIRCUIT 27.1 BCD Correction Circuit Function The result of addition/subtraction of the BCD (binary-coded decimal) code and BCD code can be obtained as BCD code with this circuit. The decimal correction operation result is obtained by performing addition/subtraction having the A register as the operand and then adding/ subtracting the BCDADJ register.
CHAPTER 27 BCD CORRECTION CIRCUIT 27.3 BCD Correction Circuit Operation The basic operation of the BCD correction circuit is as follows. (1) Addition: Calculating the result of adding a BCD code value and another BCD code value by using a BCD code value <1>...
Page 741
CHAPTER 27 BCD CORRECTION CIRCUIT (2) Subtraction: Calculating the result of subtracting a BCD code value from another BCD code value by using a BCD code value <1> The BCD code value from which subtraction is performed is stored in the A register. <2>...
CHAPTER 28 INSTRUCTION SET This chapter lists the instructions in the 78K0R microcontroller instruction set. For details of each operation and instruction code, refer to the separate document 78K0R Microcontrollers Instructions User’s Manual (U17792E). Remark The shaded parts of the tables in Table 28-5 Operation List indicate the operation or instruction format that is newly added for the 78K0R microcontrollers.
CHAPTER 28 INSTRUCTION SET 28.1 Conventions Used in Operation List 28.1.1 Operand identifiers and specification methods Operands are described in the “Operand” column of each instruction in accordance with the description method of the instruction operand identifier (refer to the assembler specifications for details). When there are two or more description methods, select one of them.
CHAPTER 28 INSTRUCTION SET 28.1.2 Description of operation column The operation when the instruction is executed is shown in the “Operation” column using the following symbols. Table 28-2. Symbols in “Operation” Column Symbol Function A register; 8-bit accumulator X register B register C register D register...
CHAPTER 28 INSTRUCTION SET 28.1.3 Description of flag operation column The change of the flag value when the instruction is executed is shown in the “Flag” column using the following symbols. Table 28-3. Symbols in “Flag” Column Symbol Change of Flag Value (Blank) Unchanged Cleared to 0...
CHAPTER 28 INSTRUCTION SET 28.2 Operation List Table 28-5. Operation List (1/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − r ← byte 8-bit data r, #byte transfer − (saddr) ← byte saddr, #byte −...
Page 747
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (2/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY A ← (HL + byte) 8-bit data A, [HL + byte] transfer (HL + byte) ← A −...
Page 748
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (3/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY A ← (ES, HL) 8-bit data A, ES:[HL] transfer (ES, HL) ← A − ES:[HL], A −...
Page 749
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (4/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − A ←→ (ES, addr16) 8-bit data A, ES:!addr16 transfer A ←→ (ES, DE) − A, ES:[DE] −...
Page 750
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (5/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY AX ← (addr16) 16-bit MOVW AX, !addr16 data (addr16) ← AX − !addr16, AX transfer AX ← (DE) AX, [DE] −...
Page 751
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (6/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY AX ← ((ES, HL) + byte) 16-bit MOVW AX, ES:[HL + byte] data ((ES, HL) + byte) ← AX −...
Page 752
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (7/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − A, CY ← A + byte + CY × × × 8-bit ADDC A, #byte operation −...
Page 753
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (8/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − A, CY ← A − byte − CY × × × 8-bit SUBC A, #byte operation −...
Page 754
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (9/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − A ← A ∨ byte × 8-bit A, #byte operation − (saddr) ← (saddr) ∨ byte ×...
Page 755
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (10/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − A − byte × × × 8-bit A, #byte operation − (saddr) − byte × ×...
Page 756
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (11/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − AX, CY ← AX + word × × × 16-bit ADDW AX, #word operation − AX, CY ←...
Page 757
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (12/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − r ← r + 1 × × Increment/ decrement (saddr) ← (saddr) + 1 − ×...
Page 758
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (13/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − ← A ← A ) × 1 × Rotate A, 1 (CY, A m−1 − ←...
Page 759
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (14/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − CY ← CY ∨ (saddr).bit × XOR1 CY, saddr.bit manipulate − CY ← CY ∨ sfr.bit ×...
Page 760
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (15/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − (SP − 2) ← (PC + 2) , (SP − 3) ← (PC + 2) Call/ CALL (SP −...
Page 761
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (16/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − (SP − 1) ← PSW, (SP − 2) ← 00H, Stack PUSH SP ← SP − 2 manipulate −...
Page 762
CHAPTER 28 INSTRUCTION SET Table 28-5. Operation List (17/17) Instruction Mnemonic Operands Bytes Clocks Operation Flag Group Note 1 Note 2 Z AC CY − PC ← PC + 4 + jdisp8 if (saddr).bit = 0 Note 3 saddr.bit, $addr20 Conditional branch PC ←...
PD78F1162A, 78F1163A, 78F1164A, 78F1165A, 78F1166A, 78F1167A, 78F1168A Caution The 78K0R/KG3 has an on-chip debug function, which is provided for development and evaluation. Do not use the on-chip debug function in products designated for mass production, because the guaranteed number of rewritable times of the flash memory may be exceeded when this function is used, and product reliability therefore cannot be guaranteed.
Page 764
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products Absolute Maximum Ratings (T = 25°C) (2/2) Parameter Symbols Conditions Ratings Unit −0.3 to AV Note Analog input voltage ANI0 to ANI15 + 0.3 REF0 and −0.3 to V Note + 0.3 −0.3 to AV Analog output voltage ANO0, ANO1...
Page 765
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products X1 Oscillator Characteristics <R> = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) Recommended Resonator Parameter Conditions MIN.
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products Internal Oscillator Characteristics = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) Oscillators Parameters Conditions MIN. TYP.
Page 767
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products <R> XT1 Oscillator Characteristics = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) Recommended Resonator Parameter Conditions MIN.
When doing so, check the conditions for using the AMPH bit, RMC register, and whether to enter or exit the STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. User’s Manual U17894EJ9V0UD...
Page 769
When doing so, check the conditions for using the AMPH bit, RMC register, and whether to enter or exit the STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. User’s Manual U17894EJ9V0UD...
Page 770
When doing so, check the conditions for using the AMPH bit, RMC register, and whether to enter or exit the STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. User’s Manual U17894EJ9V0UD...
Page 771
When doing so, check the conditions for using the AMPH bit, RMC register, and whether to enter or exit the STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. User’s Manual U17894EJ9V0UD...
Page 772
When doing so, check the conditions for using the RMC register, and whether to enter or exit the STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. = −20 to +70°C)
Page 773
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (1/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV = EV...
Page 774
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (2/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV = EV...
Page 775
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (3/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV = EV...
Page 776
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (4/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV = EV...
Page 777
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (5/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV = EV...
Page 778
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (6/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV = EV...
Page 779
Note It is recommended to leave the FLMD0 pin open. If the pin is required to be pulled down externally, set to 100 kΩ or more. FLMD0 78K0R/KG3 FLMD0 pin FLMD0 Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Page 780
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (8/16) μ PD78F1162, 78F1162A, 78F1163, 78F1163A, 78F1164, 78F1164A, 78F1165, 78F1165A, 78F1166, 78F1166A = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤...
Page 781
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (9/16) μ PD78F1162, 78F1162A, 78F1163, 78F1163A, 78F1164, 78F1164A, 78F1165, 78F1165A, 78F1166, 78F1166A = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤...
Page 782
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (10/16) μ PD78F1162, 78F1162A, 78F1163, 78F1163A, 78F1164, 78F1164A, 78F1165, 78F1165A, 78F1166, 78F1166A = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤...
Page 783
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (11/16) μ PD78F1162, 78F1162A, 78F1163, 78F1163A, 78F1164, 78F1164A, 78F1165, 78F1165A, 78F1166, 78F1166A = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤...
Page 784
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (12/16) μ PD78F1167, 78F1167A, 78F1168, 78F1168A = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0...
Page 785
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (13/16) μ PD78F1167, 78F1167A, 78F1168, 78F1168A = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0...
Page 786
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (14/16) μ PD78F1167, 78F1167A, 78F1168, 78F1168A = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0...
Page 787
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products DC Characteristics (15/16) μ PD78F1167, 78F1167A, 78F1168, 78F1168A = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0...
Page 788
I and I when the D/A converter operates in an operation mode or the HALT mode. 6. Current flowing only to the LVI circuit. The current value of the 78K0R/KG3 is the sum of I or I and I when the LVI circuit operates in the operation mode, HALT or STOP mode.
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products AC Characteristics (1) Basic operation (1/6) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1...
Page 790
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (1) Basic operation (2/6) Minimum instruction execution time during main system clock operation (FSEL = 0, RMC = 00H) Guaranteed range of main system clock operation (FSEL = 0, RMC = 00H) The range enclosed in dotted lines applies when the internal high-speed oscillator is selected.
Page 791
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (1) Basic operation (3/6) Minimum instruction execution time during main system clock operation (FSEL = 1, RMC = 00H) Guaranteed range of main system clock operation (FSEL = 1, RMC = 00H) The range enclosed in dotted lines applies when the internal high-speed oscillator is selected.
Page 792
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (1) Basic operation (4/6) Minimum instruction execution time during main system clock operation (FSEL = 0, RMC = 5AH) Guaranteed range of main system clock operation (FSEL = 0, RMC = 5AH) The range enclosed in dotted lines applies when the internal high-speed oscillator is selected.
Page 793
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (1) Basic operation (5/6) Minimum instruction execution time during self programming mode (RMC = 00H) Guaranteed range of self programming mode (RMC = 00H) The range enclosed in dotted lines applies when the internal high-speed oscillator is selected.
Page 794
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (1) Basic operation (6/6) AC Timing Test Points (Excluding external bus interface) Test points External Main System Clock Timing 0.8V (MIN.) EXCLK 0.2V (MAX.) TI Timing TI00 to TI07 Interrupt Request Input Timing INTL INTH INTP0 to INTP11...
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (2) External bus interface (1/3) (a) Read/write cycle (CLKOUT synchronous) μ • Conventional-specification products ( PD78F116x) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV...
Page 796
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products μ • Expanded-specification products ( PD78F116xA) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) Parameter Symbol Conditions MIN.
Page 797
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (2) External bus interface (2/3) Read/write cycle (CLKOUT synchronous): In separate bus mode <1> CLKOUT <2> <3> <5> <8> <8> <6> WR0, WR1 <9> <9> D7 to D0 Data Data D15 to D0 <13>...
Page 798
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (2) External bus interface (3/3) (b) Read/write cycle (CLKOUT asynchronous) μ • Conventional-specification products ( PD78F116x) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV...
Page 799
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products Read/write cycle (CLKOUT asynchronous): In separate bus mode <18> CLKOUT <19> <20> WR0, WR1 D7 to D0 Data Data D15 to D0 <24> <23> <21> <22> A19 to A0 Address Address <26> <25>...
Page 800
Unit Transfer rate = 20 MHz, f Mbps UART mode connection diagram (during communication at same potential) TxDq 78K0R/KG3 User's device RxDq UART mode bit width (during communication at same potential) (reference) 1/Transfer rate High-/Low-bit width Baud rate error tolerance...
Page 801
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (2/18) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) <R>...
Page 802
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (3/18) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (c) During communication at same potential (CSI mode) (slave mode, SCKp...
Page 803
(3) Serial interface: Serial array unit (4/18) CSI mode connection diagram (during communication at same potential) SCKp 78K0R/KG3 User's device CSI mode serial transfer timing (during communication at same potential) (When DAPmn = 0 and CKPmn = 0, or DAPmn = 1 and CKPmn = 1)
Page 804
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (5/18) (d) During communication at same potential (simplified I C mode) μ • Conventional-specification products ( PD78F116x) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, V = EV = EV = EV...
Page 805
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (6/18) Simplified I C mode connection diagram (during communication at same potential) SDAr 78K0R/KG3 User's device SCLr Simplified I C mode serial transfer timing (during communication at same potential) HIGH...
Page 806
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (7/18) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (e) During communication at different potential (2.5 V, 3 V) (UART mode) (dedicated baud rate generator output) (1/2) Parameter...
Page 807
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (8/18) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (e) During communication at different potential (2.5 V, 3 V) (UART mode) (dedicated baud rate generator output) (2/2) Parameter...
Page 808
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (9/18) Remarks 1. R [Ω]: Communication line (TxDq) pull-up resistance, [F]: Communication line (TxDq) load capacitance, V [V]: Communication line voltage 2. q: UART number (q = 1, 2), g: PIM and POM number (g = 0, 14) 3.
Page 809
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (10/18) UART mode connection diagram (during communication at different potential) TxDq 78K0R/KG3 User's device RxDq UART mode bit width (during communication at different potential) (reference) 1/Transfer rate...
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (11/18) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) <R>...
Page 811
Note When DAPmn = 0 and CKPmn = 1, or DAPmn = 1 and CKPmn = 0. CSI mode connection diagram (during communication at different potential) <Master> SCKp 78K0R/KG3 User's device Caution Select the TTL input buffer for SIp and the N-ch open-drain output (V tolerance) mode for SOp and SCKp by using the PIMg and POMg registers.
Page 812
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (13/18) CSI mode serial transfer timing (during communication at different potential) (When DAPmn = 0 and CKPmn = 0, or DAPmn = 1 and CKPmn = 1) KCY1 SCKp SIK1...
Page 813
“from SCKp↑” when DAPmn = 0 and CKPmn = 1, or DAPmn = 1 and CKPmn = 0. CSI mode connection diagram (during communication at different potential) <Slave> SCKp 78K0R/KG3 User's device (Caution and Remarks are given on the next page.) User’s Manual U17894EJ9V0UD...
Page 814
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (15/18) Caution Select the TTL input buffer for SIp and SCKp and the N-ch open-drain output (V tolerance) mode for SOp by using the PIMg and POMg registers. Remarks 1.
Page 815
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (16/18) CSI mode serial transfer timing (during communication at different potential) (When DAPmn = 0 and CKPmn = 0, or DAPmn = 1 and CKPmn = 1) KCY2 SCKp SIK2...
Page 816
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (17/18) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (h) During communication at different potential (2.5 V, 3 V) (simplified I C mode) Parameter...
Page 817
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (3) Serial interface: Serial array unit (18/18) Simplified I C mode connection diagram (during communication at different potential) SDAr 78K0R/KG3 User's device SCLr Simplified I C mode serial transfer timing (during communication at different potential) HIGH...
Page 818
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (4) Serial interface: IIC0 = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (a) IIC0 Parameter Symbol Conditions Standard Mode...
Page 819
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products (5) Serial interface: On-chip debug (UART) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (a) On-chip debug (UART) Parameter Symbol Conditions...
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products A/D Converter Characteristics (1/2) = −40 to +85°C, 2.3 V ≤ V ≤ 5.5 V, 2.3 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV = EV REF0 REF1...
Page 821
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products A/D Converter Characteristics (2/2) = −40 to +85°C, 2.3 V ≤ V ≤ 5.5 V, 2.3 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV = EV REF0 REF1...
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products μ Temperature Sensor (Expanded-Specification Products ( PD78F116xA) Only) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, 2.7 V ≤ AV ≤ V = EV = EV = EV = EV = 0 V) REF0 Parameter...
Page 823
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products = −40 to +85°C, V POC Circuit Characteristics (T = 0 V) Parameter Symbol Conditions MIN. TYP. MAX. Unit Detection voltage 1.59 1.68 POC0 : 0 V → V Power supply voltage rise Change inclination of V V/ms POC0...
Page 824
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products = −40 to +85°C, V ≤ V ≤ 5.5 V, V LVI Circuit Characteristics (T = EV = EV = EV = EV = 0 V) Parameter Symbol Conditions MIN. TYP. MAX. Unit Detection Supply voltage level...
Page 825
CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Standard Products = −40 to +85°C) Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics (T Parameter Symbol Conditions MIN. TYP. MAX. Unit Note Data retention supply voltage DDDR Note The value depends on the POC detection voltage. When the voltage drops, the data is retained until a POC reset is effected, but data is not retained when a POC reset is effected.
Number of rewrites (number Used for updating programs Retained Times of deletes per block) When using flash memory programmer for 15 and NEC Electronics self programming years library Used for updating data Retained 10,000 Times When using NEC Electronics EEPROM...
78F1168A(A) Caution The 78K0R/KG3 has an on-chip debug function, which is provided for development and evaluation. Do not use the on-chip debug function in products designated for mass production, because the guaranteed number of rewritable times of the flash memory may be exceeded when this function is used, and product reliability therefore cannot be guaranteed.
Page 828
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products Absolute Maximum Ratings (T = 25°C) (2/2) Parameter Symbols Conditions Ratings Unit −0.3 to AV Note Analog input voltage ANI0 to ANI15 + 0.3 REF0 and −0.3 to V Note + 0.3 −0.3 to AV Analog output voltage...
Page 829
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products X1 Oscillator Characteristics <R> = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) Recommended Resonator Parameter Conditions...
Page 830
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products Internal Oscillator Characteristics = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) Oscillators Parameters Conditions MIN.
Page 831
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products <R> XT1 Oscillator Characteristics = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) Recommended Resonator Parameter Conditions...
Page 832
When doing so, check the conditions for using the AMPH bit, RMC register, and whether to enter or exit the STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. User’s Manual U17894EJ9V0UD...
Page 833
When doing so, check the conditions for using the AMPH bit, RMC register, and whether to enter or exit the STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. User’s Manual U17894EJ9V0UD...
Page 834
When doing so, check the conditions for using the AMPH bit, RMC register, and whether to enter or exit the STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. User’s Manual U17894EJ9V0UD...
Page 835
When doing so, check the conditions for using the AMPH bit, RMC register, and whether to enter or exit the STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. User’s Manual U17894EJ9V0UD...
Page 836
When doing so, check the conditions for using the RMC register, and whether to enter or exit the STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. = −20 to +70°C)
Page 837
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (1/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV...
Page 838
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (2/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV...
Page 839
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (3/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV...
Page 840
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (4/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV...
Page 841
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (5/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV...
Page 842
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (6/16) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0 REF1 = EV...
Page 843
Note It is recommended to leave the FLMD0 pin open. If the pin is required to be pulled down externally, set to 100 kΩ or more. FLMD0 78K0R/KG3 FLMD0 pin FLMD0 Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Page 844
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (8/16) μ PD78F1162A(A), 78F1163A(A), 78F1164A(A), 78F1165A(A), 78F1166A(A) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤...
Page 845
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (9/16) μ PD78F1162A(A), 78F1163A(A), 78F1164A(A), 78F1165A(A), 78F1166A(A) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤...
Page 846
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (10/16) μ PD78F1162A(A), 78F1163A(A), 78F1164A(A), 78F1165A(A), 78F1166A(A) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤...
Page 847
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (11/16) μ PD78F1162A(A), 78F1163A(A), 78F1164A(A), 78F1165A(A), 78F1166A(A) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤...
Page 848
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (12/16) μ PD78F1167A(A), 78F1168A(A) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0...
Page 849
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (13/16) μ PD78F1167A(A), 78F1168A(A) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0...
Page 850
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (14/16) μ PD78F1167A(A), 78F1168A(A) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0...
Page 851
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products DC Characteristics (15/16) μ PD78F1167A(A), 78F1168A(A) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV REF0...
Page 852
I and I when the D/A converter operates in an operation mode or the HALT mode. 6. Current flowing only to the LVI circuit. The current value of the 78K0R/KG3 is the sum of I or I and I when the LVI circuit operates in the operation mode, HALT or STOP mode.
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products AC Characteristics (1) Basic operation (1/6) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, 1.8 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ = EV = EV REF0 REF1...
Page 854
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (1) Basic operation (2/6) Minimum instruction execution time during main system clock operation (FSEL = 0, RMC = 00H) Guaranteed range of main system clock operation (FSEL = 0, RMC = 00H) The range enclosed in dotted lines applies when the internal high-speed oscillator is selected.
Page 855
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (1) Basic operation (3/6) Minimum instruction execution time during main system clock operation (FSEL = 1, RMC = 00H) Guaranteed range of main system clock operation (FSEL = 1, RMC = 00H) The range enclosed in dotted lines applies when the internal high-speed oscillator is selected.
Page 856
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (1) Basic operation (4/6) Minimum instruction execution time during main system clock operation (FSEL = 0, RMC = 5AH) Guaranteed range of main system clock operation (FSEL = 0, RMC = 5AH) The range enclosed in dotted lines applies when the internal high-speed oscillator is selected.
Page 857
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (1) Basic operation (5/6) Minimum instruction execution time during self programming mode (RMC = 00H) Guaranteed range of self programming mode (RMC = 00H) The range enclosed in dotted lines applies when the internal high-speed oscillator is selected.
Page 858
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (1) Basic operation (6/6) AC Timing Test Points (Excluding external bus interface) Test points External Main System Clock Timing 0.8V (MIN.) EXCLK 0.2V (MAX.) TI Timing TI00 to TI07 Interrupt Request Input Timing INTL INTH INTP0 to INTP11...
Page 859
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (2) External bus interface (1/3) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (a) Read/write cycle (CLKOUT synchronous) Parameter Symbol...
Page 860
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (2) External bus interface (2/3) Read/write cycle (CLKOUT synchronous): In separate bus mode <1> CLKOUT <2> <3> <5> <8> <8> <6> WR0, WR1 <9> <9> D7 to D0 Data Data D15 to D0 <13>...
Page 861
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (2) External bus interface (3/3) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (b) Read/write cycle (CLKOUT asynchronous) Parameter Symbol...
Page 862
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products Read/write cycle (CLKOUT asynchronous): In separate bus mode <18> CLKOUT <19> <20> WR0, WR1 D7 to D0 Data Data D15 to D0 <24> <23> <21> <22> A19 to A0 Address Address <26>...
Page 863
Unit Transfer rate = 20 MHz, f Mbps UART mode connection diagram (during communication at same potential) TxDq 78K0R/KG3 User's device RxDq UART mode bit width (during communication at same potential) (reference) 1/Transfer rate High-/Low-bit width Baud rate error tolerance...
Page 864
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (2/18) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) <R>...
Page 865
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (3/18) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (c) During communication at same potential (CSI mode) (slave mode, SCKp...
Page 866
(3) Serial interface: Serial array unit (4/18) CSI mode connection diagram (during communication at same potential) SCKp 78K0R/KG3 User's device CSI mode serial transfer timing (during communication at same potential) (When DAPmn = 0 and CKPmn = 0, or DAPmn = 1 and CKPmn = 1)
Page 867
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (5/18) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (d) During communication at same potential (simplified I C mode) Parameter...
Page 868
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (6/18) Simplified I C mode connection diagram (during communication at same potential) SDAr 78K0R/KG3 User's device SCLr Simplified I C mode serial transfer timing (during communication at same potential) HIGH...
Page 869
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (7/18) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (e) During communication at different potential (2.5 V, 3 V) (UART mode) (dedicated baud rate generator output) (1/2) Parameter...
Page 870
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (8/18) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (e) During communication at different potential (2.5 V, 3 V) (UART mode) (dedicated baud rate generator output) (2/2) Parameter...
Page 871
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (9/18) Remarks 1. R [Ω]: Communication line (TxDq) pull-up resistance, [F]: Communication line (TxDq) load capacitance, V [V]: Communication line voltage 2. q: UART number (q = 1, 2), g: PIM and POM number (g = 0, 14) 3.
Page 872
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (10/18) UART mode connection diagram (during communication at different potential) TxDq 78K0R/KG3 User's device RxDq UART mode bit width (during communication at different potential) (reference) 1/Transfer rate...
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (11/18) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) <R>...
Page 874
Note When DAPmn = 0 and CKPmn = 1, or DAPmn = 1 and CKPmn = 0. CSI mode connection diagram (during communication at different potential) <Master> SCKp 78K0R/KG3 User's device Caution Select the TTL input buffer for SIp and the N-ch open-drain output (V tolerance) mode for SOp and SCKp by using the PIMg and POMg registers.
Page 875
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (13/18) CSI mode serial transfer timing (during communication at different potential) (When DAPmn = 0 and CKPmn = 0, or DAPmn = 1 and CKPmn = 1) KCY1 SCKp SIK1...
Page 876
“from SCKp↑” when DAPmn = 0 and CKPmn = 1, or DAPmn = 1 and CKPmn = 0. CSI mode connection diagram (during communication at different potential) <Slave> SCKp 78K0R/KG3 User's device (Caution and Remarks are given on the next page.) User’s Manual U17894EJ9V0UD...
Page 877
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (15/18) Caution Select the TTL input buffer for SIp and SCKp and the N-ch open-drain output (V tolerance) mode for SOp by using the PIMg and POMg registers. Remarks 1.
Page 878
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (16/18) CSI mode serial transfer timing (during communication at different potential) (When DAPmn = 0 and CKPmn = 0, or DAPmn = 1 and CKPmn = 1) KCY2 SCKp SIK2...
Page 879
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (17/18) = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (h) During communication at different potential (2.5 V, 3 V) (simplified I C mode) Parameter...
Page 880
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (3) Serial interface: Serial array unit (18/18) Simplified I C mode connection diagram (during communication at different potential) SDAr 78K0R/KG3 User's device SCLr Simplified I C mode serial transfer timing (during communication at different potential) HIGH...
Page 881
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (4) Serial interface: IIC0 = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (a) IIC0 Parameter Symbol Conditions...
Page 882
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products (5) Serial interface: On-chip debug (UART) = −40 to +85°C, 1.8 V ≤ V ≤ 5.5 V, V = EV = EV = EV = EV = AV = 0 V) (a) On-chip debug (UART) Parameter Symbol...
Page 883
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products A/D Converter Characteristics = −40 to +85°C, 2.3 V ≤ V ≤ 5.5 V, 2.3 V ≤ AV ≤ V , 1.8 V ≤ AV ≤ V = EV = EV = EV REF0 REF1...
Page 884
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products Temperature Sensor = −40 to +85°C, 2.7 V ≤ V ≤ 5.5 V, 2.7 V ≤ AV ≤ V = EV = EV = EV = EV = 0 V) REF0 Parameter Symbol...
Page 885
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products = −40 to +85°C, V POC Circuit Characteristics (T = 0 V) Parameter Symbol Conditions MIN. TYP. MAX. Unit Detection voltage 1.59 1.68 POC0 : 0 V → V Power supply voltage rise Change inclination of V V/ms POC0...
Page 886
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products = −40 to +85°C, V ≤ V ≤ 5.5 V, V LVI Circuit Characteristics (T = EV = EV = EV = EV = 0 V) Parameter Symbol Conditions MIN. TYP.
Page 887
CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) (A) Grade Products = −40 to +85°C) Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics (T Parameter Symbol Conditions MIN. TYP. MAX. Unit Note Data retention supply voltage DDDR Note The value depends on the POC detection voltage. When the voltage drops, the data is retained until a POC reset is effected, but data is not retained when a POC reset is effected.
Page 888
Number of rewrites (number Used for updating programs Retained Times of deletes per block) When using flash memory programmer for 15 and NEC Electronics self programming years library Used for updating data Retained 10,000 Times When using NEC Electronics EEPROM...
CHAPTER 31 PACKAGE DRAWINGS 100-PIN PLASTIC LQFP (14x20) detail of lead end (UNIT:mm) ITEM DIMENSIONS 20.00 0.20 14.00 0.20 22.00 0.20 16.00 0.20 1.60 MAX. 0.10 0.05 1.40 0.05 0.25 0.08 0.30 0.04 0.075 0.125 0.025 0.50 0.60 0.15 NOTE 1.00 0.20 Each lead centerline is located within 0.13 mm of its true position at maximum material condition.
CHAPTER 32 RECOMMENDED SOLDERING CONDITIONS These products should be soldered and mounted under the following recommended conditions. For soldering methods and conditions other than those recommended below, contact an NEC Electronics sales representative. For technical information, see the following website.
APPENDIX A DEVELOPMENT TOOLS The following development tools are available for the development of systems that employ the 78K0R/KG3. Figure A-1 shows the development tool configuration. • Support for PC98-NX series Unless otherwise specified, products supported by IBM PC/AT compatibles are compatible with PC98-NX series computers.
Page 894
Flash memory Target system Notes 1. Download the device file for 78K0R/KG3 (DF781188) from the download site for development tools (http://www.necel.com/micro/ods/eng/index.html). The project manager PM+ is included in the assembler package. The PM+ is only used for Windows.
Page 895
Target connector Target system Notes 1. Download the device file for 78K0R/KG3 (DF781188) and the integrated debugger (ID78K0R-QB) from the download site for development tools (http://www.necel.com/micro/ods/eng/index.html). The project manager PM+ is included in the assembler package. The PM+ is only used for Windows.
APPENDIX A DEVELOPMENT TOOLS A.1 Software Package SP78K0R Development tools (software) common to the 78K0R microcontrollers are combined in 78K0R Series software package this package. μ Part number: S××××SP78K0R Remark ×××× in the part number differs depending on the host machine and OS used. μ...
APPENDIX A DEVELOPMENT TOOLS Remark ×××× in the part number differs depending on the host machine and OS used. μ S××××RA78K0R μ S××××CC78K0R ×××× Host Machine Supply Medium AB17 PC-9800 series, Windows (Japanese version) CD-ROM IBM PC/AT compatibles BB17 Windows (English version) μ...
78K0R. The QB-MINI2 is supplied with a USB interface cable and connection cables (10-pin cable and 16-pin cable), and the 78K0-OCD board. To use 78K0R/KG3, use USB interface cable and 16-pin connection cable.
The QB-MINI2 is supplied with a USB interface cable and connection cables (10-pin cable and 16-pin cable), and the 78K0-OCD board. To use 78K0R/KG3, use USB interface cable and 16-pin connection cable.
APPENDIX B LIST OF CAUTIONS This appendix lists the cautions described in this document. “Classification (hard/soft)” in the table is as follows. Hard: Cautions for microcontroller internal/external hardware Soft: Cautions for software such as register settings or programs (1/35) Function Details of Cautions Page...
Page 901
APPENDIX B LIST OF CAUTIONS (2/35) Function Details of Cautions Page Function Memory PMC: Processor Set PMC only once during the initial settings prior to operating the DMA controller. p.65 space mode control Rewriting PMC other than during the initial settings is prohibited. register After setting PMC, wait for at least one instruction and access the mirror area.
Page 902
APPENDIX B LIST OF CAUTIONS (3/35) Function Details of Cautions Page Function Port P16/TI01/TO01/ To use P16/TI01/TO01/INTP5/EX30 or P17/TI02/TO02/EX31 as a general-purpose p.114 functions INTP5/EX30, port, set bits 1 and 2 (TO01, TO02) of timer output register 0 (TO0) and bits 1 and 2 P17/TI02/TO02/ (TOE01, TOE02) of timer output enable register 0 (TOE0) to “0”, which is the same EX31...
Page 903
APPENDIX B LIST OF CAUTIONS (4/35) Function Details of Cautions Page Function Port P140/PCLBUZ0/ To use P140/PCLBUZ0/INTP6 or P141/PCLBUZ1/INTP7 as a general-purpose port, p.145 functions INTP6, set bit 7 of clock output select registers 0 and 1 (CKS0, CKS1) to “0”, which is the P141/PCLBUZ1/ same as their default status settings.
Page 904
APPENDIX B LIST OF CAUTIONS (5/35) Function Details of Cautions Page Function Clock CSC: Clock The setting of the flags of the register to stop clock oscillation (invalidate the external p.193 generator operation status clock input) and the condition before clock oscillation is to be stopped are as follows. control register (See Table 6-2.) OSTC:...
Page 905
APPENDIX B LIST OF CAUTIONS (6/35) Function Details of Cautions Page Function Clock PER0, PER1: Be sure to clear bit 1 of the PER0 register and bits 1 to 7 of the PER1 register to 0. pp.199, generator Peripheral enable registers 0, 1 OSMC: OSMC can be written only once after reset release, by an 8-bit memory manipulation...
Page 906
APPENDIX B LIST OF CAUTIONS (7/35) Function Details of Cautions Page Function Clock When LVI A voltage oscillation stabilization time is required after the supply voltage reaches p.211 generator default start 1.59 V (TYP.). If the supply voltage rises from 1.59 V (TYP.) to 2.07 V (TYP.) within operation function enabled the power supply oscillation stabilization time, the power supply oscillation...
Page 907
APPENDIX B LIST OF CAUTIONS (8/35) Function Details of Cautions Page Function Subsystem Subsystem clock The CMC register can be written only once after reset release, by an 8-bit memory p.217 clock manipulation instruction. control Therefore, it is necessary to also set the value of the EXCLK and OSCSEL bits at the same time.
Page 908
APPENDIX B LIST OF CAUTIONS (9/35) Function Details of Cautions Page Function Timer TOM0: Timer Be sure to clear bits 15 to 8 to “0”. p.253 array unit output mode register 0 ISC: Input switch Be sure to clear bits 7 to 2 to “0”. p.254 control register Channel output...
Page 909
APPENDIX B LIST OF CAUTIONS (10/35) Function Details of Cautions Page Function Operation of Input pulse The TI0n pin input is sampled using the operating clock selected with the CKS0n bit p.280 timer array interval of the TMR0n register, so an error equal to the number of operating clocks occurs. unit as measurement independent...
Page 910
APPENDIX B LIST OF CAUTIONS (11/35) Function Details of Cautions Page Function Real-time RSUBC: Sub- When a correction is made by using the SUBCUD register, the value may become p.317 counter count register 8000H or more. This register is also cleared by reset effected by writing the second count register. p.317 The value read from this register is not guaranteed if it is read during operation, p.317...
Page 911
APPENDIX B LIST OF CAUTIONS (12/35) Function Details of Cautions Page Function Watchdog Setting overflow The watchdog timer continues its operation during self-programming of the flash p.341 timer time memory and EEPROM emulation. During processing, the interrupt acknowledge time is delayed. Set the overflow time and window size taking this delay into consideration.
Page 912
APPENDIX B LIST OF CAUTIONS (13/35) Function Details of Cautions Page Function A/D conversion Set the conversion times with the following conditions. p.354 • 4.0 V ≤ AV ≤ 5.5 V: f converter time selection = 0.6 to 3.6 MHz REF0 (2.3 V ≤...
Page 913
APPENDIX B LIST OF CAUTIONS (14/35) Function Details of Cautions Page Function Registers used When rewriting FR2 to FR0, LV1, and LV0 to other than the same data, stop A/D p.366 converter by temperature conversion (ADCS = 0) beforehand. sensors The above conversion time does not include clock frequency errors.
Page 914
APPENDIX B LIST OF CAUTIONS (15/35) Function Details of Cautions Page Function Noise To maintain the 10-bit resolution, attention must be paid to noise input to the AV p.376 REF0 converter countermeasures pin and pins ANI0 to ANI15. <1> Connect a capacitor with a low equivalent resistance and a good frequency response to the power supply.
Page 915
APPENDIX B LIST OF CAUTIONS (16/35) Function Details of Cautions Page Function A/D conversion When a write operation is performed to the A/D converter mode register (ADM), p.378 converter result register analog input channel specification register (ADS), and A/D port configuration register (ADCR, (ADPC), the contents of ADCR and ADCRH may become undefined.
Page 916
APPENDIX B LIST OF CAUTIONS (17/35) Function Details of Cautions Page Function Reducing power Because the D/A converter stops operation in the STOP mode, the ANO0 and ANO1 p.387 converter consumption in pins go into a high impedance state, and the power consumption can be reduced. In STOP mode the standby modes other than the STOP mode, however, the operation continues.
Page 917
APPENDIX B LIST OF CAUTIONS (18/35) Function Details of Cautions Page Function Registers SOEm: Serial Be sure to clear bits 15 to 3 of SOE0, and bits 15 to 3 and 1 of SOE1 to “0”. p.411 controlling output enable serial array register m unit...
Page 918
APPENDIX B LIST OF CAUTIONS (19/35) Function Details of Cautions Page Function 3-wire serial I/O Slave reception After setting the PER0 register to 1, be sure to set the SPSm register after 4 or more pp.458, (CSI00, CSI01, clocks have elapsed. CSI10, CSI20) Slave Be sure to set transmit data to the SlOp register before the clock from the master is...
Page 919
APPENDIX B LIST OF CAUTIONS (20/35) Function Details of Cautions Page Function Serial IICC0: IIC The start condition is detected immediately after I C is enabled to operate (IICE0 = 1) p.537 interface control register 0 while the SCL0 line is at high level and the SDA0 line is at low level. Immediately IIC0 after enabling I C to operate (IICE0 = 1), set LREL0 (1) by using a 1-bit memory...
Page 920
APPENDIX B LIST OF CAUTIONS (21/35) Function Details of Cautions Page Function Serial STT0, SPT0: Setting STT0 and SPT0 (bits 1 and 0 of IICC0) again after they are set and before p.566 interface Bits 1, 0 of IIC they are cleared to 0 is prohibited. IIC0 control register 0 (IICC0)
Page 921
APPENDIX B LIST OF CAUTIONS (22/35) Function Details of Cautions Page Function DMA pending Even if a DMA request is generated, DMA transfer is held pending immediately after p.632 controller instruction the following instructions. • CALL !addr16 • CALL $!addr20 •...
Page 922
APPENDIX B LIST OF CAUTIONS (23/35) Function Details of Cautions Page Function Interrupt PR00L, PR00H, Be sure to set bits 1 to 7 of PR02H and PR12H to 1. p.644 functions PR01L, PR01H, PR02L, PR02H, PR10L, PR10H, PR11L, PR11H, PR12L, PR12H: Priority specification flag registers...
Page 923
APPENDIX B LIST OF CAUTIONS (24/35) Function Details of Cautions Page Function − Standby It can be selected by the option byte whether the internal low-speed oscillator p.657 function continues oscillating or stops in the HALT or STOP mode. For details, see CHAPTER 24 OPTION BYTE.
Page 924
APPENDIX B LIST OF CAUTIONS (25/35) Function Details of Cautions Page Function Standby STOP mode To shorten oscillation stabilization time after the STOP mode is released when the p.667 function CPU operates with the high-speed system clock (X1 oscillation), temporarily switch the CPU clock to the internal high-speed oscillation clock before the execution of the STOP instruction.
Page 925
APPENDIX B LIST OF CAUTIONS (26/35) Function Details of Cautions Page Function Low- LVIM: Low- When LVI is used in interrupt mode (LVIMD = 0) and LVISEL is set to 0, an interrupt p.690 voltage voltage detection request signal (INTLVI) that disables LVI operation (clears LVION) when the supply detector register voltage (V...
Page 926
APPENDIX B LIST OF CAUTIONS (27/35) Function Details of Cautions Page Function Low- Used as interrupt Even when the LVI default start function is used, if it is set to LVI operation p.702 voltage (when detecting prohibition by the software, it operates as follows: detector level of supply •...
Page 927
APPENDIX B LIST OF CAUTIONS (28/35) Function Details of Cautions Page Function Regulator RMC: Regulator The RMC register can be rewritten only in the low consumption current mode (refer p.710 mode control to Table 23-1). In other words, rewrite this register during CPU operation with the register subsystem clock (f ) while the high-speed system clock (f...
Page 928
0 takes priority. On-chip Connecting QB- The 78K0R/KG3 has an on-chip debug function, which is provided for development p.736 debug MINI2 to and evaluation. Do not use the on-chip debug function in products designated for...
Page 929
STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. The oscillator constants shown above are reference values based on evaluation in a p.772...
Page 930
APPENDIX B LIST OF CAUTIONS (31/35) Function Details of Cautions Page Function Electrical P02 to P04, P43, P45, P142 to P144 do not output high level in N-ch open-drain p.773 specifications characteristics mode. (standard The maximum value of V of pins P02 to P04, P43, P45, and P142 to P144 is V pp.775, products) even in the N-ch open-drain mode.
Page 931
(2.5 V, 3 V) (simplified C mode) − Electrical The 78K0R/KG3 has an on-chip debug function, which is provided for development p.827 specifications and evaluation. Do not use the on-chip debug function in products designated for ((A) grade mass production, because the guaranteed number of rewritable times of the flash...
Page 932
STOP mode. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use the 78K0R/KG3 so that the internal operation conditions are within the specifications of the DC and AC characteristics. The oscillator constants shown above are reference values based on evaluation in a p.836...
Page 933
APPENDIX B LIST OF CAUTIONS (34/35) Function Details of Cautions Page Function Electrical During Select the normal input buffer for SIj and the normal output mode for SOj and SCKj p.864 specifications communication by using the PIMg and POMg registers. ((A) grade at same potential products)
Page 934
Cautions Page Function − RECOMM For soldering methods and conditions other than those recommended below, p.891 ENDED contact an NEC Electronics sales representative. SOLDERI Do not use different soldering methods together (except for partial heating). pp.891, CONDITIO User’s Manual U17894EJ9V0UD...
APPENDIX C REVISION HISTORY C.1 Major Revisions in This Edition (1/5) Page Description Classification Throughout − Change of status of (A) grade products of the expanded-specification products from under development to mass production CHAPTER 1 OUTLINE μ p.18 Change of 1.1 Differences Between Conventional-Specification Products ( PD78F116x) and μ...
Page 936
APPENDIX C REVISION HISTORY (2/5) Page Description Classification CHAPTER 7 TIMER ARRAY UNIT (continuation) p.247 Change of Figure 7-13. Start Timing (In One-count Mode) p.248 Change of Figure 7-14. Start Timing (In Capture & One-count Mode) p.254 Change of description of ISC1 and ISC0 bits in Figure 7-21. Format of Input Switch Control Register (ISC) CHAPTER 8 REAL-TIME COUNTER p.309...
Page 937
APPENDIX C REVISION HISTORY (3/5) Page Description Classification CHAPTER 13 SERIAL ARRAY UNIT (continuation) p.436 Change of Figure 13-37. Flowchart of Master Reception (in Single-Reception Mode) p.437 Addition of Figure 13-38. Timing Chart of Master Reception (in Continuous Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0) p.438 Addition of Figure 13-39.
Page 938
APPENDIX C REVISION HISTORY (4/5) Page Description Classification CHAPTER 16 DMA CONTROLLER (continuation) p.627 Addition of Note to Figure 16-12. Example of Setting for Holding DMA Transfer Pending by DWAITn pp.628, 629 Change of 16.5.7 Forced termination by software p.630 Change of (1) Priority of DMA in 16.6 Cautions on Using DMA Controller p.631 Change of (2) DMA response time in 16.6 Cautions on Using DMA Controller...
Page 939
APPENDIX C REVISION HISTORY (5/5) Page Description Classification CHAPTER 29 ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) (continuation) p.826 Change of Number of rewrites of Expanded-specification products in Flash Memory Programming Characteristics CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A) GRADE PRODUCTS) Throughout Deletion of (TARGET) p.829 Deletion of Remark in X1 Oscillator Characteristics p.831...
APPENDIX C REVISION HISTORY C.2 Revision History of Preceding Editions Here is the revision history of the preceding editions. Chapter indicates the chapter of each edition. (1/24) Edition Description Chapter μ μ 2nd edition Addition of PD78F1167 and PD78F1168 to ROM, RAM capacities CHAPTER 1 OUTLINE Change of 1.3 Ordering Information μ...
Page 941
APPENDIX C REVISION HISTORY (2/24) Edition Description Chapter 2nd edition Addition of Tables 6-6 to 6-9 to 6.6.7 Time required for switchover of CPU clock CHAPTER 6 CLOCK and main system clock GENERATOR Change of bit names of timer mode register 00 (TMR00) CHAPTER 7 TIMER ARRAY UNIT Addition of description in 7.3 (14) Noise filter enable register 1 (NFEN1)
Page 942
APPENDIX C REVISION HISTORY (3/24) Edition Description Chapter 2nd edition Addition of description to 13.3 (12) Serial output register m (SOm) CHAPTER 13 SERIAL ARRAY UNIT Addition of 13.3 (13) Serial output level register m (SOLm) Addition of description to 13.3 (15) Noise filter enable register 0 (NFEN0) Addition of Error detection flag, and change of Transfer rate in 13.4.1 Master transmission Addition of MDmn0 bit, change of INTCSlp, and addition of Caution to Figure 13-28...
Page 943
APPENDIX C REVISION HISTORY (4/24) Edition Description Chapter 2nd edition Addition of Note 2 to Figure 20-5 Format of Reset Control Flag Register (RESF) CHAPTER 20 RESET FUNCTION Change of value of V CHAPTER 21 POWER- ON-CLEAR CIRCUIT Addition of Caution 2 to Figure 22-2 Format of Low-Voltage Detection Register CHAPTER 22 LOW- (LVIM) VOLTAGE DETECTOR...
Page 944
APPENDIX C REVISION HISTORY (5/24) Edition Description Chapter 3rd edition Deletion of descriptions of CALLF instruction in CHAPTER 3 CHAPTER 3 CPU ARCHITECTURE Modification of description in 3.1 Memory Space μ Addition of Note in Figure 3-5 Memory Map ( PD78F1166) and Figure 3-13 μ...
Page 945
APPENDIX C REVISION HISTORY (6/24) Edition Description Chapter 3rd edition Addition of Cautions 3 to Figure 6-3 Format of Clock Operation Status Control CHAPTER 6 CLOCK Register (CSC) GENERATOR Modification of description in 6.3 (3) Oscillation stabilization time counter status register (OSTC) Modification of Cautions 2 in Figure 6-4 Format of Oscillation Stabilization Time Counter Status Register (OSTC)
Page 946
APPENDIX C REVISION HISTORY (7/24) Edition Description Chapter 3rd edition Addition of SFR name for the lower 8 bits of registers TSR0n, TE0, TS0, TT0, TPS0, CHAPTER 7 TIMER TO0, TOE0, TOL0, and TOM0 in 7.3 Registers Controlling Timer Array Unit ARRAY UNIT Addition of description in 7.3 (2) Timer clock select register 0 (TPS0) Modification of description and change of setting in Figure 7-6 Format of Timer...
Page 947
APPENDIX C REVISION HISTORY (8/24) Edition Description Chapter 3rd edition Change of reset value of 13.3 (12) Serial output register m (Som). CHAPTER 13 SERIAL ARRAY UNIT Modification of bit 0 setting in Figure 13-36 (d) Serial mode register mn (SMRmn). Deletion of description on overrun error in 13.6 Operation of Simplified I2C (IIC10, IIC20) Communication.
Page 948
APPENDIX C REVISION HISTORY (9/24) Edition Description Chapter 3rd edition Addition of 22.4.1 When used as reset. CHAPTER 22 LOW- VOLTAGE DETECTOR Addition of 22.4.2 When used as interrupt. Addition of chapter. CHAPTER 23 REGULATOR Modification of Caution in Figure 24-2 Format of Option Byte (000C1H/010C1H). CHAPTER 24 OPTION BYTE Addition of 25.5 Registers that Control Flash Memory.
Page 949
APPENDIX C REVISION HISTORY (10/24) Edition Description Chapter μ 4th edition Addition of Note to Figure 5-1 (e) Memory map of PD78F1166 and (g) Memory CHAPTER 5 μ map of PD78F1168 EXTERNAL BUS Change of (c) No wait, 16-bit bus CLKOUT = f /2 (EXWEN = 0, MM3 = 1, MM2 = INTERFACE 1) and (d) With wait, 16-bit bus CLKOUT = f...
Page 950
APPENDIX C REVISION HISTORY (11/24) Edition Description Chapter 4th edition Change of description of 7.7.3 Operation as frequency divider CHAPTER 7 TIMER ARRAY UNIT Change of description of 7.8.3 Operation as multiple PWM output function Change of clear conditions of real-time counter CHAPTER 8 REAL- TIME COUNTER Change of description and Caution 1 in Figure 8-2 Format of Peripheral Enable...
Page 951
APPENDIX C REVISION HISTORY (12/24) Edition Description Chapter 4th edition Addition of reset processing time to Figure 21-2 Timing of Generation of Internal CHAPTER 21 POWER- Reset Signal by Power-on-Clear Circuit and Low-Voltage Detector ON-CLEAR CIRCUIT Addition of 21.4 Caution for Power-on-Clear Circuit Addition of operation stabilization time CHAPTER 22 LOW- VOLTAGE DETECTOR...
Page 952
APPENDIX C REVISION HISTORY (13/24) Edition Description Chapter Ver.4.2 Deletion of description of Temperature Correction function of Internal High-Speed Throughout Oscillation Clock and Temperature correction tables H, L from the following chapters. • CHAPTER 3 CPU ARCHITECTURE • CHAPTER 6 CLOCK GENERATOR •...
Page 953
APPENDIX C REVISION HISTORY (14/24) Edition Description Chapter Change of transfer rate in 13.4.5 Slave reception 5th edition CHAPTER 13 SERIAL ARRAY UNIT Change of transfer rate in 13.4.6 Slave transmission/reception Change of Note in 13.4.7 (2) Addition of setting and Note to Table 13-2 Selection of Operation Clock Change of transfer rate and addition of Note Change of setting of (e) Serial mode register mr (SMRmr) in Figure 13-74 Example of Contents of Registers for UART Reception of UART (UART0,...
Page 954
APPENDIX C REVISION HISTORY (15/24) Edition Description Chapter Change of 23.1 Regulator Overview 5th edition CHAPTER 23 REGULATOR Addition of Note 3 to Figure 23-1 Format of Regulator Mode Control Register (RMC) Change of description in 24.1.1 (2) 000C1H/010C1H CHAPTER 24 OPTION BYTE Change of Figure 24-2 Format of User Option Byte (000C1H/010C1H) and Caution 2...
Page 955
APPENDIX C REVISION HISTORY (16/24) Edition Description Chapter Change of Figure 13-79 Procedure for Resuming UART Reception 6th edition CHAPTER 13 SERIAL ARRAY UNIT Change of Figure 13-89 Initial Setting Procedure for Address Field Transmission Change of Figure 13-90 Timing Chart of Address Field Transmission Change of Figure 13-91 Flowchart of Address Field Transmission Change of Figure 13-94 Flowchart of Data Transmission Change of Figure 13-96 Timing Chart of Data Reception...
Page 956
APPENDIX C REVISION HISTORY (17/24) Edition Description Chapter Change of setting in (a) Serial output register m (SOm) in Figure 13-95 Example of Edition 6.1 CHAPTER 13 SERIAL Contents of Registers for Data Reception of Simplified I C (IIC10, IIC20) and (revised ARRAY UNIT addition of Note...
Page 957
APPENDIX C REVISION HISTORY (18/24) Edition Description Chapter μ − Addition of expanded-specification products, PD78F1162A, 78F1163A, 78F1164A, 8th edition 78F1165A, 78F1166A, 78F1167A, 78F1168A μ Addition of (A) grade products of expanded-specification products, PD78F1162A(A), 78F1163A(A), 78F1164A(A), 78F1165A(A), 78F1166A(A), 78F1167A(A), 78F1168A(A) Change of related documents INTRODUCTION Addition of 1.1 Differences Between Conventional-Specification Products CHAPTER 1 OUTLINE...
Page 958
APPENDIX C REVISION HISTORY (19/24) Edition Description Chapter Addition of Note 3 to Figure 6-6 Format of System Clock Control Register (CKC) 8th edition CHAPTER 6 CLOCK GENERATOR Change of Cautions 3 and 5 in Figure 6-8 Format of Operation Speed Mode Control Register (OSMC) Change of Figure 6-13 Clock Generator Operation When Power Supply Voltage Is Turned On (When LVI Default Start Function Stopped Is Set (Option Byte:...
Page 959
APPENDIX C REVISION HISTORY (20/24) Edition Description Chapter Change of description and Caution in Figure 8-4 Format of Real-Time Counter 8th edition CHAPTER 8 REAL-TIME Control Register 1 (RTCC1) COUNTER Addition of Caution 3 to Figure 8-5 Format of Real-Time Counter Control Register 2 (RTCC2) Change of description in 8.3 (7) Minute count register (MIN), (8) Hour count register (HOUR), (9) Day count register (DAY), (11) Month count register...
Page 960
APPENDIX C REVISION HISTORY (21/24) Edition Description Chapter Modification of Figure 13-36 Timing Chart of Master Reception (in Single- 8th edition CHAPTER 13 SERIAL Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0) ARRAY UNIT Change of Figure 13-40 Procedure for Stopping Master Transmission/Reception Change of Figure 13-41 Procedure for Resuming Master Transmission/Reception Modification of Figure 13-42 Timing Chart of Master Transmission/Reception (in Single-Transmission/Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0)
Page 961
APPENDIX C REVISION HISTORY (22/24) Edition Description Chapter Modification of transfer data length in 13.6.4 LIN reception 8th edition CHAPTER 13 SERIAL ARRAY UNIT Change of Note 2 in Table 13-3 Selection of Operation Clock Addition of Note to 13.7 Operation of Simplified I C (IIC10, IIC20) Communication Addition of Note to 13.7.1 Address field transmission Change of Figure 13-89 Initial Setting Procedure for Address Field Transmission...
Page 962
FP5 (Reference Values) Addition of Caution 5 to 25.9 Flash Memory Programming by Self-Programming Change of description in 25.9.2 Flash shield window function Change of Caution in 26.1 Connecting QB-MINI2 to 78K0R/KG3 CHAPTER 26 ON-CHIP DEBUG FUNCTION Addition of Caution to Figure 26-1 Connection Example of QB-MINI2 and...
Page 963
APPENDIX C REVISION HISTORY (24/24) Edition Description Chapter Change of V supply current value and number of rewrites and addition of expanded- 8th edition CHAPTER 29 specification product characteristics in Flash Memory Programming Characteristics ELECTRICAL SPECIFICATIONS (STANDARD PRODUCTS) Addition of chapter CHAPTER 30 ELECTRICAL SPECIFICATIONS ((A)
Page 964
Kawasaki, Kanagawa 211-8668, Japan Tel: 044-435-5111 http://www.necel.com/ [Asia & Oceania] [America] [Europe] NEC Electronics (China) Co., Ltd NEC Electronics America, Inc. NEC Electronics (Europe) GmbH 7th Floor, Quantum Plaza, No. 27 ZhiChunLu Haidian 2880 Scott Blvd. Arcadiastrasse 10 District, Beijing 100083, P.R.China Santa Clara, CA 95050-2554, U.S.A.
This manual is also suitable for:
Upd78f1162Upd78f1162aUpd78f1162aaUpd78f1163Upd78f1163aUpd78f1163aa...
Show all
Need help?
Do you have a question about the 78K0R/KG3 and is the answer not in the manual?
Questions and answers