UPD78F9221CS-CAC-A Renesas Electronics America, UPD78F9221CS-CAC-A Datasheet

no-image

UPD78F9221CS-CAC-A

Manufacturer Part Number
UPD78F9221CS-CAC-A
Description
MCU 8BIT 2KB FLASH 20PIN
Manufacturer
Renesas Electronics America
Series
78K0S/Kx1+r
Datasheet

Specifications of UPD78F9221CS-CAC-A

Core Processor
78K0S
Core Size
8-Bit
Speed
10MHz
Connectivity
LIN, UART/USART
Peripherals
LVD, POR, PWM, WDT
Number Of I /o
15
Program Memory Size
2KB (2K x 8)
Program Memory Type
FLASH
Ram Size
128 x 8
Voltage - Supply (vcc/vdd)
2 V ~ 5.5 V
Data Converters
A/D 4x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
*
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
To our customers,
Corporation, and Renesas Electronics Corporation took over all the business of both
companies. Therefore, although the old company name remains in this document, it is a valid
Renesas Electronics document. We appreciate your understanding.
Issued by: Renesas Electronics Corporation (http://www.renesas.com)
Send any inquiries to http://www.renesas.com/inquiry.
On April 1
st
, 2010, NEC Electronics Corporation merged with Renesas Technology
Renesas Electronics website: http://www.renesas.com
Old Company Name in Catalogs and Other Documents
April 1
Renesas Electronics Corporation
st
, 2010

Related parts for UPD78F9221CS-CAC-A

UPD78F9221CS-CAC-A Summary of contents

Page 1

To our customers, Old Company Name in Catalogs and Other Documents st On April 1 , 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took over all the business of both companies. Therefore, although the ...

Page 2

All information included in this document is current as of the date this document is issued. Such information, however, is subject to change without any prior notice. Before purchasing or using any Renesas Electronics products listed herein, please confirm ...

Page 3

User’s Manual 78K0S/KA1+ 8-bit Single-Chip Microcontrollers PD78F9221 PD78F9221(A) PD78F9221(A2) Document No. U16898EJ6V0UD00 (6th edition) Date Published February 2009 NS © 2003 Printed in Japan PD78F9222 PD78F9222(A) PD78F9222(A2) PD78F9224 ...

Page 4

User’s Manual U16898EJ6V0UD ...

Page 5

NOTES FOR CMOS DEVICES 1 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 malfunction. Take care ...

Page 6

EEPROM is a trademark of NEC Electronics Corporation. Windows is a registered trademark or a trademark of Microsoft Corporation in the United States and/or other countries. SuperFlash is a registered trademark of Silicon Storage Technology, Inc. in several countries including ...

Page 7

Target Readers <R> Purpose Organization How to Use This Manual INTRODUCTION This manual is intended for user engineers who wish to understand the functions of the 78K0S/KA1+ in order to design and develop its application systems and programs. The target ...

Page 8

Conventions Related Documents Documents Related to Devices 78K0S/KA1+ User’s Manual 78K/0S Series Instructions User’s Manual <R> Documents Related to Development Software Tools (User’s Manuals) RA78K0S Ver.2.00 Assembler Package CC78K0S Ver.2.00 C Compiler SM+ System Simulator ID78K0S-QB Ver.3.00 Integrated Debugger PM+ ...

Page 9

Documents Related to Flash Memory Writing (User’s Manuals) PG-FP5 Flash Memory Programmer QB-Programmer Programming GUI Other Related Documents SEMICONDUCTOR SELECTION GUIDE - Products and Packages - Semiconductor Device Mount Manual Quality Grades on NEC Semiconductor Devices NEC Semiconductor Device Reliability/Quality ...

Page 10

CHAPTER 1 OVERVIEW.........................................................................................................................14 1.1 Features ......................................................................................................................................14 1.2 Ordering Information .................................................................................................................16 1.3 Pin Configuration (Top View)....................................................................................................17 1.4 78K0S/Kx1+ Product Lineup .....................................................................................................18 1.5 Block Diagram ............................................................................................................................19 1.6 Functional Outline......................................................................................................................20 CHAPTER 2 PIN FUNCTIONS ...............................................................................................................21 2.1 Pin Function List ........................................................................................................................21 2.2 Pin Functions..............................................................................................................................23 ...

Page 11

Stack addressing......................................................................................................................... 52 CHAPTER 4 PORT FUNCTIONS........................................................................................................... 53 4.1 Functions of Ports ..................................................................................................................... 53 4.2 Port Configuration ..................................................................................................................... 54 4.2.1 Port 2........................................................................................................................................... 55 4.2.2 Port 3........................................................................................................................................... 56 4.2.3 Port 4........................................................................................................................................... 58 4.2.4 Port 12......................................................................................................................................... 63 4.2.5 Port 13......................................................................................................................................... 65 ...

Page 12

Operation as interval timer.........................................................................................................132 7.5 Notes on 8-bit Timer 80 ...........................................................................................................134 CHAPTER 8 8-BIT TIMER H1 .............................................................................................................135 8.1 Functions of 8-bit Timer H1.....................................................................................................135 8.2 Configuration of 8-bit Timer H1 ..............................................................................................135 8.3 Registers Controlling 8-bit Timer H1 .....................................................................................138 8.4 Operation ...

Page 13

Interrupt Function Control Registers.....................................................................................223 12.4 Interrupt Servicing Operation.................................................................................................228 12.4.1 Maskable interrupt request acknowledgment operation ............................................................ 228 12.4.2 Multiple interrupt servicing......................................................................................................... 230 12.4.3 Interrupt request pending .......................................................................................................... 232 CHAPTER 13 STANDBY FUNCTION..................................................................................................233 13.1 Standby Function and Configuration ....................................................................................233 13.1.1 Standby ...

Page 14

Flash memory programming mode............................................................................................277 18.7.2 Communication commands .......................................................................................................277 18.7.3 Security settings ........................................................................................................................278 18.8 Flash Memory Programming by Self Programming .............................................................279 18.8.1 Outline of self programming.......................................................................................................279 18.8.2 Cautions on self programming function .....................................................................................282 18.8.3 Registers used for self programming function ...

Page 15

A.4.1 When using in-circuit emulator QB-78K0SKX1 ......................................................................... 377 A.4.2 When using on-chip debug emulator with programming function QB-MINI2 ............................. 378 A.5 Debugging Tools (Software)...................................................................................................379 APPENDIX B NOTES ON DESIGNING TARGET SYSTEM ................................................................380 APPENDIX C REGISTER INDEX.........................................................................................................382 C.1 Register Index (Register ...

Page 16

Features O 78K0S CPU core O ROM and RAM capacities Item Part number PD78F9221 PD78F9222 <R> PD78F9224 O Minimum instruction execution time: 0.2 s (with 10 MHz@4.0 to 5.5 V operation) O Clock High-speed system clock … Selected from ...

Page 17

O Assembler and C language supported O Enhanced development environment Support for full-function emulator (IECUBE), simplified emulator (MINICUBE2), and simulator O Supply voltage 2 Use these products in the following voltage range because the ...

Page 18

Ordering Information Part Number PD78F9 - - - ( ) <R> " ...

Page 19

Pin Configuration (Top View) 20-pin plastic SSOP V P121/X1 P122/X2 RESET/P34 P31/TI010/TO00/INTP2 P30/TI000/INTP0 P41/INTP3 20-pin plastic SDIP P23/ANI3 P22/ANI2 P21/ANI1 P20/ANI0 AV REF Note V SS P121/X1 P122/X2 P123 V DD Pin Name ANI0 to ANI3: Analog input AV ...

Page 20

Product Lineup The following table shows the product lineup of the 78K0S/Kx1+. Part Number Item Number of pins <R> Internal Flash memory memory RAM Supply voltage Minimum instruction execution time System clock (oscillation frequency) Clock for TMH1 and ...

Page 21

Notes 4 The product without A/D converter ( PD78F95xx) is provided for the 78K0S/KU1+ and 78K0S/KY1+ respectively. This product has A/D converter. 5 There are 2 and 4 factors for the products without A/D converter in the 78K0S/KU1+ and 78K0S/KY1+, ...

Page 22

Functional Outline <R> Item Internal Flash memory memory High-speed RAM Memory space X1 input clock (oscillation frequency) Internal High speed (oscillation oscillation frequency) clock Low speed (for TMH1 and WDT) General-purpose registers Instruction execution time I/O port Timer Timer ...

Page 23

Pin Function List (1) Port functions Pin Name I/O P20 to P23 I/O Port 2. 4-bit I/O port. Can be set to input or output mode in 1-bit units. An on-chip pull-up resistor can be connected by setting software. ...

Page 24

Non-port functions Pin Name I/O INTP0 Input External interrupt input for which the valid edge (rising edge, falling edge, or both rising and falling edges) can be specified INTP1 INTP2 INTP3 RxD6 Input Serial data input for asynchronous serial ...

Page 25

Pin Functions 2.2.1 P20 to P23 (Port 2) P20 to P23 constitute a 4-bit I/O port, port 2. In addition to I/O port pins, these pins also have a function to input analog signals to the A/D converter. These ...

Page 26

P40 to P45 (Port 4) P40 to P45 constitute a 6-bit I/O port, port 4. In addition to I/O port pins, these pins also have functions to output a timer signal, input external interrupt request signals, and input/output the ...

Page 27

X1 and X2 These pins connect an oscillator to oscillate the X1 input clock. X1 and X2 also function as the P121 and P122, respectively. For the setting method for pin functions, see CHAPTER 17 OPTION BYTE. Supply an ...

Page 28

Type 2 IN Schmitt-triggered input with hysteresis characteristics Type 3-C Data Type 8-A Pull up enable V DD Data Output disable CHAPTER 2 PIN FUNCTIONS Figure 2-1. Pin I/O Circuits Type 11 Pull up enable Data Output ...

Page 29

Memory Space The 78K0S/KA1+ can access memory space. Figures 3-1 to 3-3 show the memory maps Special function registers ...

Page 30

Internal high-speed RAM Data memory space ...

Page 31

Data memory space Program memory space Remark The option byte and protect byte are 1 byte each. CHAPTER 3 CPU ARCHITECTURE Figure 3-3. Memory Map ( PD78F9224 Special function registers (SFR) 256 8 bits ...

Page 32

Internal program memory space The internal program memory space stores programs and table data. This space is usually addressed by the program counter (PC). The 78K0S/KA1+ provides the following internal ROMs (or flash memory) containing the following capacities. Part ...

Page 33

Internal data memory space <R> 128-byte internal high-speed RAM is provided in the PD78F9224. The internal high-speed RAM can also be used as a stack memory. 3.1.3 Special function register (SFR) area Special function registers (SFRs) of on-chip peripheral ...

Page 34

Figure 3-5. Data Memory Addressing ( PD78F9222 Special function registers (SFR) 256 8 bits Internal ...

Page 35

Special function registers (SFR Internal high-speed RAM ...

Page 36

Processor Registers The 78K0S/KA1+ provides the following on-chip processor registers. 3.2.1 Control registers The control registers have special functions to control the program sequence statuses and stack memory. The control registers include a program counter, a program status word, ...

Page 37

Carry flag (CY) This flag stores overflow and underflow that have occurred upon add/subtract instruction execution. It stores the shift-out value upon rotate instruction execution and functions as a bit accumulator during bit operation instruction execution. (3) Stack pointer ...

Page 38

Figure 3-11. Data to Be Restored from Stack Memory POP rp instruction Lower half SP register pairs Upper half register pairs 3.2.2 General-purpose registers A general-purpose register consists of eight 8-bit registers (X, ...

Page 39

Figure 3-12. General-Purpose Register Configuration (2/2) 16-bit processing 15 3.2.3 Special function registers (SFRs) Unlike the general-purpose registers, each special function register has a special function. The special function registers are allocated to the 256-byte area FF00H to FFFFH. The ...

Page 40

R/W Indicates whether the special function register can be read or written. R/W: Read/write R: Read only W: Write only Number of bits manipulated simultaneously Indicates the bit units (1, 8, and 16) in which the special function register can ...

Page 41

Address Symbol 7 FF00H, FF01H FF02H P2 0 FF03H P3 0 FF04H P4 0 FF05H to FF0BH FF0CH P12 0 FF0DH P13 0 FF0EH CMP01 FF0FH CMP11 FF10H, FF11H FF12H TM00 FF13H FF14H CR000 FF15H FF16H CR010 FF17H FF18H ...

Page 42

Address Symbol 7 6 FF48H WDTM 0 1 FF49H WDTE FF50H LVIM <LVI 0 ON> FF51H LVIS 0 0 FF52H, FF53H FF54H RESF 0 0 FF55H to FF57H FF58H LSRCM 0 0 FF59H to FF5FH FF60H TMC00 0 0 ...

Page 43

Address Symbol 7 FF8DH to FF8FH FF90H ASIM6 <POW ER6> FF91H FF92H RXB6 FF93H ASIS6 0 FF94H TXB6 FF95H ASIF6 0 FF96H CKSR6 0 FF97H BRGC6 MLD67 MLD66 MLD65 MLD64 MLD63 MLD62 MLD61 MLD60 FF98H ASICL6 <SBRF 6> FF99H ...

Page 44

Address Symbol 7 6 FFE2H, FFE3H FFE4H MK0 <ADM <TMM K> K010> FFE5H MK1 1 <STMK 6> FFE6H to FFEBH FFECH INTM0 ES21 ES20 FFEDH INTM1 0 0 FFEEH to FFF2H FFF3H PPCC 0 0 FFF4H OSTS 0 0 ...

Page 45

Instruction Address Addressing An instruction address is determined by the program counter (PC) contents. The PC contents are normally incremented (+1 for each byte) automatically according to the number of bytes of an instruction to be fetched each time ...

Page 46

Immediate addressing [Function] Immediate data in the instruction word is transferred to the program counter (PC) to branch. This function is carried out when the CALL !addr16 and BR !addr16 instructions are executed. CALL !addr16 and BR !addr16 instructions ...

Page 47

Register addressing [Function] The register pair (AX) contents to be specified with an instruction word are transferred to the program counter (PC) to branch. This function is carried out when the BR AX instruction is executed. [Illustration ...

Page 48

Operand Address Addressing The following methods (addressing) are available to specify the register and memory to undergo manipulation during instruction execution. 3.4.1 Direct addressing [Function] The memory indicated by immediate data in an instruction word is directly addressed. [Operand ...

Page 49

Short direct addressing [Function] The memory to be manipulated in the fixed space is directly addressed with the 8-bit data in an instruction word. The fixed space where this addressing is applied is the 160-byte space FE80H to FF1FH ...

Page 50

Special function register (SFR) addressing [Function] A memory-mapped special function register (SFR) is addressed with the 8-bit immediate data in an instruction word. This addressing is applied to the 256-byte space FF00H to FFFFH. However, SFRs mapped at FF00H ...

Page 51

Register addressing [Function] A general-purpose register is accessed as an operand. The general-purpose register to be accessed is specified with the register specify code and functional name in the instruction code. Register addressing is carried out when an instruction ...

Page 52

Register indirect addressing [Function] The memory is addressed with the contents of the register pair specified as an operand. The register pair to be accessed is specified with the register pair specify code in the instruction code. This addressing ...

Page 53

Based addressing [Function] 8-bit immediate data is added to the contents of the base register, that is, the HL register pair, and the sum is used to address the memory. Addition is performed by expanding the offset data as ...

Page 54

Stack addressing [Function] The stack area is indirectly addressed with the stack pointer (SP) contents. This addressing method is automatically employed when the PUSH, POP, subroutine call, and return instructions are executed or the register is saved/restored upon interrupt ...

Page 55

Functions of Ports The 78K0S/KA1+ has the ports shown in Figure 4-1, which can be used for various control operations. Table 4-1 shows the functions of each port. In addition to digital I/O port functions, each of these ports ...

Page 56

Pin Name I/O P20 to P23 I/O Port 2. 4-bit I/O port. Can be set to input or output mode in 1-bit units. On-chip pull-up resistor can be connected by setting software. P30 I/O Port 3 P31 Note P34 Input ...

Page 57

Port 2 Port 4-bit I/O port with an output latch. Each bit of this port can be set to the input or output mode by using port mode register 2 (PM2). When the P20 to P23 ...

Page 58

Port 3 Pins P30 and P31 constitute a 2-bit I/O port with an output latch. Each bit of this port can be set to the input or output mode by using port mode register 3 (PM3). When the P30 ...

Page 59

CHAPTER 4 PORT FUNCTIONS Figure 4-4. Block Diagram of P31 WR PU PU3 PU31 Alternate function RD WR PORT P3 Output latch (P31 PM3 PM31 Alternate function P3: Port register 3 PU3: Pull-up resistor option register 3 PM3: ...

Page 60

RD Reset RD: Read signal Caution Because the P34 pin functions alternately as the RESET pin used as an input port pin, the function to input an external reset signal to the RESET pin cannot be used. ...

Page 61

CHAPTER 4 PORT FUNCTIONS Figure 4-6. Block Diagram of P40 and P45 WR PU PU4 PU40, PU45 RD WR PORT P4 Output latch (P40, P45 PM4 PM40, PM45 P4: Port register 4 PU4: Pull-up resistor option register 4 ...

Page 62

Figure 4-7. Block Diagram of P41 and P44 WR PU PU4 PU41, PU44 Alternate function RD WR PORT P4 Output latch (P41, P44 PM4 PM41, PM44 P4: Port register 4 PU4: Pull-up resistor option register 4 PM4: Port ...

Page 63

CHAPTER 4 PORT FUNCTIONS Figure 4-8. Block Diagram of P42 WR PU PU4 PU42 RD WR PORT P4 Output latch (P42 PM4 PM42 Alternate function P4: Port register 4 PU4: Pull-up resistor option register 4 PM4: Port mode ...

Page 64

WR PU PU4 PU43 Alternate function RD WR PORT P4 Output latch (P43 PM4 PM43 Alternate function P4: Port register 4 PU4: Pull-up resistor option register 4 PM4: Port mode register 4 RD: Read signal WR : Write ...

Page 65

Port 12 Port 3-bit I/O port with an output latch. Each bit of this port can be set to the input or output mode by using port mode register 12 (PM12). When the P123 pin is ...

Page 66

WR PU PU12 PU123 RD WR PORT P12 Output latch (P123 PM12 PM123 P12: Port register 12 PU12: Pull-up resistor option register 12 PM12: Port mode register 12 RD: Read signal WR : Write signal 64 CHAPTER 4 ...

Page 67

Port 13 This is a 1-bit output-only port. Figure 4-12 shows the block diagram of port 13 PORT Output latch (P130) P13: Port register 13 RD: Read signal WR : Write signal Remark When a reset is ...

Page 68

Figure 4-13. Format of Port Mode Register Address: FF22H After reset: FFH R/W Symbol 7 6 PM2 1 1 Address: FF23H After reset: FFH R/W Symbol 7 6 PM3 1 1 Address: FF24H After reset: FFH R/W Symbol 7 6 ...

Page 69

Address: FF02H After reset: 00H (Output latch) R/W Symbol Note Address: FF03H After reset: 00H (Output latch) R/W Symbol Address: FF04H After reset: 00H (Output latch) R/W Symbol 7 6 ...

Page 70

Figure 4-15. Format of Port Mode Control Register 2 Address: FF84H After reset: 00H R/W Symbol 7 6 PMC2 0 0 PMC2n 0 Port mode 1 A/D converter mode Caution When PMC20 to PMC23 are set to 1, the P20/ANI0 ...

Page 71

Pull-up resistor option registers (PU2, PU3, PU4, PU12) These registers are used to specify whether an on-chip pull-up resistor is connected to P20 to P23, P30, P31, P40 to P45, and P123. By setting PU2, PU3, PU4, or PU12, ...

Page 72

Operation of Port Function The operation of a port differs, as follows, depending on the setting of the I/O mode. Caution Although a 1-bit memory manipulation instruction manipulates 1 bit, it accesses a port in 8-bit units. Therefore, the ...

Page 73

Functions of Clock Generators The clock generators include a circuit that generates a clock (system clock supplied to the CPU and peripheral hardware, and a circuit that generates a clock (interval time generation clock supplied ...

Page 74

Configuration of Clock Generators The clock generators consist of the following hardware. Table 5-1. Configuration of Clock Generators Item Control registers Processor clock control register (PCC) Preprocessor clock control register (PPCC) Low-speed internal oscillation mode register (LSRCM) Oscillation stabilization ...

Page 75

Figure 5-1. Block Diagram of Clock Generators Oscillation stabilization time select register (OSTS) OSTS1 OSTS0 System clock oscillation stabilization time counter STOP Watchdog timer System clock Note oscillator X1/P121 Crystal/ceramic oscillation X2/P122 X 2 External clock input ...

Page 76

Registers Controlling Clock Generators The clock generators are controlled by the following four registers. Processor clock control register (PCC) Preprocessor clock control register (PPCC) Low-speed internal oscillation mode register (LSRCM) Oscillation stabilization time select register (OSTS) (1) Processor clock ...

Page 77

The fastest instruction of the 78K0S/KA1+ is executed in two CPU clocks. Therefore, the relationship between the CPU clock (f ) and the minimum instruction execution time is as shown in Table 5-2. CPU Table 5-2. Relationship Between CPU Clock ...

Page 78

Oscillation stabilization time select register (OSTS) This register is used to select oscillation stabilization time of the clock supplied from the oscillator when the STOP mode is released. The wait time set by OSTS is valid only when the ...

Page 79

System Clock Oscillators The following three types of system clock oscillators are available. High-speed internal oscillator: Crystal/ceramic oscillator: External clock input circuit: 5.4.1 High-speed internal oscillator The 78K0S/KA1+ includes a high-speed internal oscillator (8 MHz (TYP.)). If the high-speed ...

Page 80

Figure 5-7 shows examples of incorrect resonator connection. Figure 5-7. Examples of Incorrect Resonator Connection (1/2) (a) Too long wiring of connected circuit (c) Wiring near high fluctuating current CHAPTER 5 CLOCK GENERATORS ...

Page 81

Figure 5-7. Examples of Incorrect Resonator Connection (2/2) (e) Signals are fetched 5.4.3 External clock input circuit This circuit supplies a clock from an external IC to the X1 pin. If external clock input is selected by ...

Page 82

Operation of CPU Clock Generator A clock ( supplied to the CPU from the system clock (f CPU oscillators. High-speed internal oscillator: Crystal/ceramic oscillator: External clock input circuit: The system clock oscillator is selected by the option ...

Page 83

The internal reset signal is generated by the power-on-clear function on power application, the option byte is referenced after reset, and the system clock is selected. (b) The option byte is referenced and the system clock is selected. Then ...

Page 84

Figure 5-10. Timing Chart of Default Start by Crystal/Ceramic Oscillator ( RESET H Internal reset System clock CPU clock Notes 1. Operation stop time is 276 s (MIN.), 544 s (TYP.), and 1.074 ms (MAX.). 2. The clock ...

Page 85

Figure 5-11. Status Transition of Default Start by Crystal/Ceramic Oscillation Interrupt HALT Remark PCC: Processor clock control register PPCC: Preprocessor clock control register (3) External clock input circuit If external clock input is selected by the option byte, the following ...

Page 86

Figure 5-12. Timing of Default Start by External Clock Input ( RESET H Internal reset System clock CPU clock Note Operation stop time is 277 s (MIN.), 544 s (TYP.), and 1.075 ms (MAX.). (a) The internal reset ...

Page 87

Operation of Clock Generator Supplying Clock to Peripheral Hardware The following two types of clocks are supplied to the peripheral hardware. Clock to peripheral hardware (f XP Low-speed internal oscillation clock (f (1) Clock to peripheral hardware The clock ...

Page 88

Figure 5-14. Status Transition of Low-Speed Internal Oscillation Can be stopped Clock source of WDT is selected Note by software Low-speed internal oscillator can be stopped LSRSTOP = 1 Low-speed internal oscillator stops Note The clock source of the watchdog ...

Page 89

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 6.1 Functions of 16-bit Timer/Event Counter 00 16-bit timer/event counter 00 has the following functions. (1) Interval timer 16-bit timer/event counter 00 generates interrupt requests at the preset time interval. Number of counts: 2 ...

Page 90

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 6.2 Configuration of 16-bit Timer/Event Counter 00 16-bit timer/event counter 00 consists of the following hardware. Table 6-1. Configuration of 16-bit Timer/Event Counter 00 Item Timer counter Register Timer input Timer output Control registers ...

Page 91

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (1) 16-bit timer counter 00 (TM00) TM00 is a 16-bit read-only register that counts count pulses. The counter is incremented in synchronization with the rising edge of the count clock. If the count value ...

Page 92

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Table 6-2. CR000 Capture Trigger and Valid Edges of TI000 and TI010 Pins (1) TI000 pin valid edge selected as capture trigger (CRC001 = 1, CRC000 = 1) CR000 Capture Trigger Falling edge Rising ...

Page 93

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (3) 16-bit capture/compare register 010 (CR010) CR010 is a 16-bit register which has the functions of both a capture register and a compare register. Whether it is used as a capture register or a ...

Page 94

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 6.3 Registers to Control 16-bit Timer/Event Counter 00 The following six types of registers are used to control 16-bit timer/event counter 00. 16-bit timer mode control register 00 (TMC00) Capture/compare control register 00 (CRC00) ...

Page 95

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-5. Format of 16-bit Timer Mode Control Register 00 (TMC00) Address: FF60H After reset: 00H R/W Symbol TMC00 TMC003 TMC003 TMC002 TMC001 Operating mode ...

Page 96

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (2) Capture/compare control register 00 (CRC00) This register controls the operation of the 16-bit capture/compare registers (CR000, CR010). CRC00 is set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation sets the ...

Page 97

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (3) 16-bit timer output control register 00 (TOC00) This register controls the operation of the 16-bit timer/event counter output controller. It sets timer output F/F set/reset, output inversion enable/disable, 16-bit timer/event counter 00 timer ...

Page 98

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (4) Prescaler mode register 00 (PRM00) This register is used to set the 16-bit timer counter 00 (TM00) count clock and the TI000, TI010 pin input valid edges. PRM00 is set by a 1-bit ...

Page 99

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Cautions 1. Always set data to PRM00 after stopping the timer operation the valid edge of the TI000 pin set as the count clock, do not set the clear/start ...

Page 100

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 6.4 Operation of 16-bit Timer/Event Counter 00 6.4.1 Interval timer operation Setting 16-bit timer mode control register 00 (TMC00) and capture/compare control register 00 (CRC00) as shown in Figure 6-10 allows operation as an ...

Page 101

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-10. Control Register Settings for Interval Timer Operation (a) Capture/compare control register 00 (CRC00 CRC00 (b) Prescaler mode register 00 (PRM00) ES110 ES100 ES010 ES000 ...

Page 102

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-12. Timing of Interval Timer Operation t Count clock TM00 count value 0000H 0001H Timer operation enabled CR000 N INTTM000 Remark Interval time = ( 0001H to FFFFH (settable ...

Page 103

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 The external event counter counts the number of external clock pulses to be input to the TI000 pin with using 16-bit timer counter 00 (TM00). TM00 is incremented each time the valid edge specified ...

Page 104

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-15. External Event Counter Configuration Diagram f Noise eliminator XP Valid edge of TI000 Note OVF00 is 1 only when 16-bit timer capture/compare register 000 is set to FFFFH. Figure 6-16. External Event ...

Page 105

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 6.4.3 Pulse width measurement operations It is possible to measure the pulse width of the signals input to the TI000 pin and TI010 pin using 16-bit timer counter 00 (TM00). There are two measurement ...

Page 106

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (1) Pulse width measurement with free-running counter and one capture register Specify both the rising and falling edges as the valid edges of the TI000 pin, by using bits 4 and 5 (ES000 and ...

Page 107

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-19. Configuration Diagram for Pulse Width Measurement by Free-Running Counter TI000/INTP0/P30 Figure 6-20. Timing of Pulse Width Measurement Operation by Free-Running Counter and ...

Page 108

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Caution The measurable pulse width in this operation example cycle of the timer counter. Figure 6-21. Control Register Settings for Measurement of Two Pulse Widths with Free-Running Counter (a) Capture/compare ...

Page 109

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-22. Timing of Pulse Width Measurement Operation with Free-Running Counter (with Both Edges Specified) t Count clock 0000H 0001H TM00 count value TI000 pin input CR010 capture value INTTM010 TI010 pin input CR000 ...

Page 110

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-23. Control Register Settings for Pulse Width Measurement with Free-Running Counter and Two Capture Registers (with Rising Edge Specified) (a) Capture/compare control register 00 (CRC00 CRC00 ES110 ...

Page 111

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-24. Timing of Pulse Width Measurement Operation by Free-Running Counter and Two Capture Registers (with Rising Edge Specified) t Count clock TM00 count value 0000H 0001H TI000 pin input CR010 capture value CR000 ...

Page 112

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-25. Control Register Settings for Pulse Width Measurement by Means of Restart ES110 ES100 ES010 ES000 PRM00 0/1 0 (c) 16-bit timer mode control register 00 (TMC00 ...

Page 113

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 6.4.4 Square-wave output operation Setting The basic operation setting procedure is as follows. <1> Set the count clock by using the PRM00 register. <2> Set the CRC00 register (see Figure 6-27 for the set ...

Page 114

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-27. Control Register Settings in Square-Wave Output Mode (2/2) (c) 16-bit timer output control register 00 (TOC00) 7 OSPT00 OSPE00 TOC004 LVS00 TOC00 (d) 16-bit timer mode control register ...

Page 115

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 6.4.5 PPG output operations Setting 16-bit timer mode control register 00 (TMC00) and capture/compare control register 00 (CRC00) as shown in Figure 6-29 allows operation as PPG (Programmable Pulse Generator) output. Setting The basic ...

Page 116

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-29. Control Register Settings for PPG Output Operation (a) Capture/compare control register 00 (CRC00 CRC00 (b) 16-bit timer output control register 00 (TOC00) 7 OSPT00 ...

Page 117

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-30. Configuration Diagram of PPG Output Noise TI000/INTP0/P30 eliminator f XP Figure 6-31. PPG Output Operation Timing Count clock TM00 count value N ...

Page 118

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 6.4.6 One-shot pulse output operation 16-bit timer/event counter 00 can output a one-shot pulse in synchronization with a software trigger or an external trigger (TI000 pin input). Setting The basic operation setting procedure is ...

Page 119

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-32. Control Register Settings for One-Shot Pulse Output with Software Trigger (a) Prescaler mode register 00 (PRM00) ES110 ES100 ES010 ES000 PRM00 0/1 0/1 0/1 0/1 (b) Capture/compare control register 00 (CRC00) 7 ...

Page 120

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-33. Timing of One-Shot Pulse Output Operation with Software Trigger Set TMC00 to 04H (TM00 count starts) Count clock TM00 count 0000H 0001H CR010 set value N CR000 set value M OSPT00 INTTM010 ...

Page 121

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-34. Control Register Settings for One-Shot Pulse Output with External Trigger (a) Prescaler mode register 00 (PRM00) ES110 ES100 ES010 PRM00 0/1 0/1 0 (b) Capture/compare control register 00 (CRC00 ...

Page 122

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 Figure 6-35. Timing of One-Shot Pulse Output Operation with External Trigger (with Rising Edge Specified) When TMC00 is set to 08H (TM00 count starts) t Count clock TM00 count value 0000H 0001H CR010 set ...

Page 123

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 6.5 Cautions Related to 16-bit Timer/Event Counter 00 (1) Timer start errors An error one clock may occur in the time required for a match signal to be generated after timer ...

Page 124

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (4) Capture register data retention The value of 16-bit timer capture/compare register 0n0 (CR0n0) after 16-bit timer/event counter 00 has stopped is not guaranteed. Remark (5) Setting of 16-bit timer ...

Page 125

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (12) One-shot pulse output with external trigger <1> Do not input the external trigger again while the one-shot pulse is output. To output the one-shot pulse again, wait until the current one-shot pulse output ...

Page 126

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (14) Conflicting operations If the register read period and the input of the capture trigger conflict when CR000/CR010 is used as a capture register, the capture trigger input takes precedence and the read data ...

Page 127

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (17) Changing compare register during timer operation <1> With the 16-bit timer capture/compare register 0n0 (CR0n0) used as a compare register, when changing CR0n0 around the timing of a match between 16-bit timer counter ...

Page 128

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (18) Edge detection <1> In the following cases, note with caution that the valid edge of the TI0n0 pin is detected. (a) Immediately after a system reset high level is input to ...

Page 129

CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00 (23) External clock limitation <1> When using an input pulse of the TI000 pin as a count clock (external trigger), be sure to input the pulse width which satisfies the AC characteristics. For the ...

Page 130

Function of 8-bit Timer 80 8-bit timer 80 has an 8-bit interval timer function and generates an interrupt at intervals specified in advance. Minimum Interval Time 8.0 MHz ...

Page 131

Configuration of 8-bit Timer 80 8-bit timer 80 consists of the following hardware. Table 7-2. Configuration of 8-bit Timer 80 Item Timer counter 8-bit timer counter 80 (TM80) Register 8-bit compare register 80 (CR80) Control register 8-bit timer mode ...

Page 132

This 8-bit register always compares its set value with the count value of 8-bit timer/counter 80 (TM80). It generates an interrupt request signal (INTTM80) if the two values match. CR80 is set by using ...

Page 133

Register Controlling 8-bit Timer 80 8-bit timer 80 is controlled by 8-bit timer mode control register 80 (TMC80). (1) 8-bit timer mode control register 80 (TMC80) This register is used to enable or stop the operation of 8-bit timer ...

Page 134

Operation of 8-bit Timer 80 7.4.1 Operation as interval timer When 8-bit timer 80 operates as an interval timer, it can repeatedly generate an interrupt at intervals specified by the count value set in advance to 8-bit compare register ...

Page 135

Figure 7-5. Timing of Interval Timer Operation t Count clock TM80 count value 00H 01H CR80 N TCE80 Count start INTTM80 Remark Interval time = ( 00H to FFH CHAPTER 7 8-BIT TIMER 80 N ...

Page 136

Notes on 8-bit Timer 80 (1) Error when timer starts The time from starting the timer to generation of the match signal includes an error 1.5 clocks. This is because, if the timer is started while ...

Page 137

Functions of 8-bit Timer H1 8-bit timer H1 has the following functions. Interval timer PWM output mode Square-wave output 8.2 Configuration of 8-bit Timer H1 8-bit timer H1 consists of the following hardware. Item Timer register 8-bit timer counter ...

Page 138

H mode register 1 (TMHMD1) TMHE1 CKS12 CKS11 CKS10 TMMD11 TMMD10 TOLEV1 TOEN1 3 2 Decoder ...

Page 139

H compare register 01 (CMP01) This register can be read or written by an 8-bit memory manipulation instruction. Reset signal generation clears this register to 00H. Figure 8-2. Format of 8-bit Timer H Compare Register 01 (CMP01) ...

Page 140

Registers Controlling 8-bit Timer H1 The following three registers are used to control 8-bit timer H1. 8-bit timer H mode register 1 (TMHMD1) Port mode register 4 (PM4) Port register 4 (P4) (1) 8-bit timer H mode register 1 ...

Page 141

Figure 8-4. Format of 8-bit Timer H Mode Register 1 (TMHMD1) Address: FF70H After reset: 00H <7> Symbol TMHMD1 TMHE1 CKS12 TMHE1 0 Stop timer count operation (counter is cleared Enable timer count operation (count operation started ...

Page 142

Port mode register 4 (PM4) This register sets port 4 input/output in 1-bit units. When using the P42/TOH1 pin for timer output, clear PM42 and the output latch of P42 to 0. PM4 can be set by a 1-bit ...

Page 143

Operation of 8-bit Timer H1 8.4.1 Operation as interval timer/square-wave output When 8-bit timer counter H1 and compare register 01 (CMP01) match, an interrupt request signal (INTTMH1) is generated and 8-bit timer counter H1 is cleared to 00H. Compare ...

Page 144

Timing chart The timing of the interval timer/square-wave output operation is shown below. Figure 8-7. Timing of Interval Timer/Square-Wave Output Operation (1/2) (a) Basic operation (01H Count clock Count start 00H 01H 8-bit timer counter H1 CMP01 TMHE1 INTTMH1 ...

Page 145

Figure 8-7. Timing of Interval Timer/Square-Wave Output Operation (2/2) Count clock Count start 00H 01H 8-bit timer counter H1 CMP01 TMHE1 INTTMH1 TOH1 Count clock Count start 8-bit timer counter H1 CMP01 TMHE1 INTTMH1 TOH1 Interval time CHAPTER 8 8-BIT ...

Page 146

Operation as PWM output mode In PWM output mode, a pulse with an arbitrary duty and arbitrary cycle can be output. 8-bit timer compare register 01 (CMP01) controls the cycle of timer output (TOH1). Rewriting the CMP01 register during ...

Page 147

When 8-bit timer counter H1 and the CMP11 register match, TOH1 output becomes inactive and the compare register to be compared with 8-bit timer counter H1 is changed from the CMP11 register to the CMP01 register. At this time, ...

Page 148

Timing chart The operation timing in PWM output mode is shown below. Caution Make sure that the CMP11 register setting value (M) and CMP01 register setting value (N) are within the following range. 00H CMP11 (M) < CMP01 (N) ...

Page 149

Figure 8-9. Operation Timing in PWM Output Mode (2/4) (b) Operation when CMP01 = FFH, CMP11 = 00H Count clock 8-bit timer counter H1 00H 01H CMP01 CMP11 TMHE1 INTTMH1 TOH1 (TOLEV1 = 0) (c) Operation when CMP01 = FFH, ...

Page 150

Figure 8-9. Operation Timing in PWM Output Mode (3/4) (d) Operation when CMP01 = 01H, CMP11 = 00H Count clock 8-bit timer counter H1 CMP01 CMP11 TMHE1 INTTMH1 TOH1 (TOLEV1 = 0) 148 CHAPTER 8 8-BIT TIMER H1 00H 01H ...

Page 151

Figure 8-9. Operation Timing in PWM Output Mode (4/4) (e) Operation by changing CMP11 (CMP11 = 02H Count clock 00H 01H 02H 8-bit timer counter H1 CMP01 02H CMP11 TMHE1 INTTMH1 TOH1 (TOLEV1 = 0) <1> <1> The count operation ...

Page 152

Functions of Watchdog Timer The watchdog timer is used to detect an inadvertent program loop program loop is detected, an internal reset signal is generated. When a reset occurs due to the watchdog timer, bit 4 (WDTRF) ...

Page 153

Table 9-2. Option Byte Setting and Watchdog Timer Operation Mode Low-Speed Internal Oscillator Cannot Be Stopped Low-Speed Internal Oscillator Can Be Stopped by Software Note 1 Watchdog timer clock Fixed source Operation after reset Operation starts ...

Page 154

Configuration of Watchdog Timer The watchdog timer consists of the following hardware. Table 9-3. Configuration of Watchdog Timer Item Control registers Figure 9-1. Block Diagram of Watchdog Timer 2 Clock 16-bit input counter ...

Page 155

Registers Controlling Watchdog Timer The watchdog timer is controlled by the following two registers. Watchdog timer mode register (WDTM) Watchdog timer enable register (WDTE) (1) Watchdog timer mode register (WDTM) This register sets the overflow time and operation clock ...

Page 156

Cautions 1. Set bits 7, 6, and and 1, respectively. Do not set the other values. 2. After reset is released, WDTM can be written only once by an 8-bit memory manipulation instruction. If writing is ...

Page 157

Operation of Watchdog Timer 9.4.1 Watchdog timer operation when “low-speed internal oscillator cannot be stopped” is selected by option byte The operation clock of watchdog timer is fixed to low-speed internal oscillation clock. After reset is released, operation is ...

Page 158

Figure 9-4. Status Transition Diagram When “Low-Speed Internal Oscillator Cannot Be Stopped” Is Selected by Option Byte WDTE = “ACH” Clear WDT counter. HALT instruction HALT WDT count continues. 156 CHAPTER 9 WATCHDOG TIMER Reset WDT clock Overflow ...

Page 159

Watchdog timer operation when “low-speed internal oscillator can be stopped by software” is selected by option byte The operation clock of the watchdog timer can be selected as either the low-speed internal oscillation clock or the system clock. After ...

Page 160

Figure 9-5. Status Transition Diagram When “Low-Speed Internal Oscillator Can Be Stopped by Software” Is Selected by Option Byte WDT clock = f X Select overflow time (settable only once). WDTE = “ACH” Clear WDT counter. WDT clock ...

Page 161

Watchdog timer operation in STOP mode (when “low-speed internal oscillator can be stopped by software” is selected by option byte) The watchdog timer stops counting during STOP instruction execution regardless of whether the system clock or low-speed internal oscillation ...

Page 162

When the watchdog timer operation clock is the low-speed internal oscillation clock (f instruction is executed When the STOP instruction is executed, operation of the watchdog timer is stopped. After STOP mode is released, operation stops for 34 s ...

Page 163

Watchdog timer operation in HALT mode (when “low-speed internal oscillator can be stopped by software” is selected by option byte) The watchdog timer stops counting during HALT instruction execution regardless of whether the operation clock of the watchdog timer ...

Page 164

Functions of A/D Converter The A/D converter converts an analog input signal into a digital value, and consists four channels (ANI0 to ANI3) with a resolution of 10 bits. The A/D converter has the following function. ...

Page 165

Table 10-1. Sampling Time and A/D Conversion Time Reference Sampling Conversion Note 2 Note 3 Voltage Time Time Note 1 Range AV 4.5 V 12/f 36/f REF 4.0 V 24/f 72/f REF 2.85 V ...

Page 166

Figure 10-2 shows the block diagram of A/D converter. Figure 10-2. Block Diagram of A/D Converter ANI0/P20 Sample & hold circuit ANI1/P21 ANI2/P22 ANI3/P23 2 ADS1 ADS0 ADCS FR2 Analog input channel specification register (ADS) Caution In the 78K0S/KA1+, V ...

Page 167

Successive approximation register (SAR) This register compares the sampled analog voltage and the voltage of the D/A converter, and converts the result, starting from the most significant bit (MSB). When the voltage value is converted into a digital value ...

Page 168

Registers Used by A/D Converter The A/D converter uses the following six registers. A/D converter mode register (ADM) Analog input channel specification register (ADS) 10-bit A/D conversion result register (ADCR) 8-bit A/D conversion result register (ADCRH) Port mode control ...

Page 169

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 ...

Page 170

Notes 2. Be sure to set the FR2, FR1, and FR0, in accordance with the reference voltage so that Notes 2 and 3 below are satisfied. Example When AV The sampling time is 11 more and the A/D ...

Page 171

Cautions bit other than ADCS of ADM is manipulated while A/D conversion is stopped (ADCS = 0) and then A/D conversion is started, execute two NOP instructions or an instruction equivalent to two machine cycles, and set ...

Page 172

A/D conversion result register (ADCRH) This register is an 8-bit register that stores the A/D conversion result. It stores the higher 8 bits of a 10-bit resolution result. ADCRH can be read by an 8-bit memory manipulation instruction. ...

Page 173

A/D Converter Operations 10.4.1 Basic operations of A/D converter <1> Set ADCE to 1. <2> Select one channel for A/D conversion using the analog input channel specification register (ADS), and select the conversion time using FR2 to FR0. <3> ...

Page 174

Figure 10-10. Basic Operation of A/D Converter Sampling time A/D converter Sampling operation Undefined SAR ADCR, ADCRH 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. ...

Page 175

Input voltage and conversion results The relationship between the analog input voltage input to the analog input pins (ANI0 to ANI3) and the theoretical A/D conversion result (stored in the 10-bit A/D conversion result register (ADCR)) is shown by ...

Page 176

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 ANI3 by the analog input channel specification register (ADS) and A/D conversion is executed. ...

Page 177

The setting method is described below. <1> Set bit 0 (ADCE) of the A/D converter mode register (ADM <2> Select the channel and conversion time using bits 1 and 0 (ADS1, ADS0) of the analog input channel specification ...

Page 178

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 ...

Page 179

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 ...

Page 180

Cautions for A/D Converter (1) Operating current in STOP mode To satisfy the DC characteristics of the supply current in the STOP mode, clear bit 7 (ADCS) and bit 0 (ADCE) of the A/D converter mode register (ADM) to ...

Page 181

Noise countermeasures To maintain the 10-bit resolution, attention must be paid to noise input to the AV <1> Connect a capacitor with a low equivalent resistance and a high frequency response to the power supply. <2> Because the effect ...

Page 182

Interrupt request flag (ADIF) The interrupt request flag (ADIF) is not cleared even if the analog input channel specification register (ADS) is changed. Therefore analog input pin is changed during A/D conversion, the A/D conversion result and ...

Page 183

Operating current at conversion waiting mode The DC characteristic of the operating current during the STOP mode is not satisfied due to the conversion waiting mode (only the comparator consumes power), when bit 7 (ADCS) and bit 0 (ADCE) ...

Page 184

CHAPTER 11 SERIAL INTERFACE UART6 11.1 Functions of Serial Interface UART6 Serial interface UART6 has the following two modes. (1) Operation stop mode This mode is used when serial communication is not executed and can enable a reduction in the ...

Page 185

CHAPTER 11 SERIAL INTERFACE UART6 Remark LIN stands for Local Interconnect Network and is a low-speed ( kbps) serial communication protocol intended to aid the cost reduction of an automotive network. LIN communication is single-master communication, and up ...

Page 186

Wakeup signal frame LIN bus RxD6 Disable Enable (input) Reception interrupt (INTSR6) <1> Edge detection (INTP0) Capture timer The flow for reception processing is described below. <1> The wakeup signal is detected at the edge of the pin, and enables ...

Page 187

CHAPTER 11 SERIAL INTERFACE UART6 Figure 11-3. Port Configuration for LIN Reception Operation P44 Output latch (P44) P30/INTP0/TI000 Output latch (P30) Remark ISC0, ISC1: Bits 0 and 1 of the input switch control register (ISC) (see Figure 11-11) ...

Page 188

Configuration of Serial Interface UART6 Serial interface UART6 consists of the following hardware. Table 11-1. Configuration of Serial Interface UART6 Item Registers Receive buffer register 6 (RXB6) Receive shift register 6 (RXS6) Transmit buffer register 6 (TXB6) Transmit shift ...

Page 189

Asynchronous serial interface operation mode register 6 (ASIM6 XCLK6 XP 5 (Base clock ...

Page 190

Receive buffer register 6 (RXB6) This 8-bit register stores parallel data converted by receive shift register 6 (RXS6). Each time 1 byte of data has been received, new receive data is transferred to this register from receive shift register ...

Page 191

Registers Controlling Serial Interface UART6 Serial interface UART6 is controlled by the following nine registers. Asynchronous serial interface operation mode register 6 (ASIM6) Asynchronous serial interface reception error status register 6 (ASIS6) Asynchronous serial interface transmission status register 6 ...

Page 192

Figure 11-5. Format of Asynchronous Serial Interface Operation Mode Register 6 (ASIM6) (2/2) Note 1 TXE6 0 Disable transmission (synchronously reset the transmission circuit). 1 Enable transmission Note 2 RXE6 0 Disable reception (synchronously reset the reception circuit). 1 Enable ...

Page 193

Cautions 2. At startup, reception enable status is entered by setting RXE6 to 1 after having set POWER6 to 1 and one clock of the base clock (f operation, set POWER6 to 0 after having set RXE6 ...

Page 194

Asynchronous serial interface transmission status register 6 (ASIF6) This register indicates the status of transmission by serial interface UART6. It includes two status flag bits (TXBF6 and TXSF6). Transmission can be continued without disruption even during an interrupt period, ...

Page 195

Clock selection register 6 (CKSR6) This register selects the base clock of serial interface UART6. CKSR6 can be set by an 8-bit memory manipulation instruction. Reset signal generation clears this register to 00H. Remark CKSR6 can be refreshed (the ...

Page 196

Baud rate generator control register 6 (BRGC6) This register sets the division value of the 8-bit counter of serial interface UART6. BRGC6 can be set by an 8-bit memory manipulation instruction. Reset signal generation sets this register to FFH. ...

Page 197

Asynchronous serial interface control register 6 (ASICL6) This register controls the serial communication operations of serial interface UART6. ASICL6 can be set by a 1-bit or 8-bit memory manipulation instruction. Reset signal generation sets this register to 16H. Caution ...

Page 198

Figure 11-10. Format of Asynchronous Serial Interface Control Register 6 (ASICL6) (2/2) SBL62 SBL61 DIR6 0 MSB 1 LSB TXDLV6 0 Normal output of ...

Page 199

Input switch control register (ISC) The input switch control register (ISC) is used to receive a status signal transmitted from the master during LIN (Local Interconnect Network) reception. By setting 1 to ISC0 and ISC1, the input source to ...

Page 200

Operation of Serial Interface UART6 Serial interface UART6 has the following two modes. Operation stop mode Asynchronous serial interface (UART) mode 11.4.1 Operation stop mode In this mode, serial communication cannot be executed; therefore, the power consumption can be ...

Related keywords