To our customers, Old Company Name in Catalogs and Other Documents On April 1st, 2010, NEC Electronics Corporation merged with Renesas Technology 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. Renesas Electronics website: http://www.renesas.
Notice 1. 2. 3. 4. 5. 6. 7. All information included in this document is current as of the date this document is issued. Such information, however, is subject to change without any prior notice. Before purchasing or using any Renesas Electronics products listed herein, please confirm the latest product information with a Renesas Electronics sales office.
User’s Manual 16 The revision list can be viewed directly by clicking the title page. The revision list summarizes the locations of revisions and additions. Details should always be checked by referring to the relevant text. H8S/2472, H8S/2463, H8S/2462 Group Hardware Manual Renesas 16-Bit Single-Chip Microcomputer H8S Family / H8S/2400 Series H8S/2472 R4F2472 H8S/2463 R4F2463 H8S/2462 R4F2462 Rev.2.00 2008.
Rev. 2.00 Aug.
Notes regarding these materials 1. This document is provided for reference purposes only so that Renesas customers may select the appropriate Renesas products for their use. Renesas neither makes warranties or representations with respect to the accuracy or completeness of the information contained in this document nor grants any license to any intellectual property rights or any other rights of Renesas or any third party with respect to the information in this document. 2.
General Precautions on Handling of Product 1. Treatment of NC Pins Note: Do not connect anything to the NC pins. The NC (not connected) pins are either not connected to any of the internal circuitry or are used as test pins or to reduce noise. If something is connected to the NC pins, the operation of the LSI is not guaranteed. 2. Treatment of Unused Input Pins Note: Fix all unused input pins to high or low level. Generally, the input pins of CMOS products are high-impedance input pins.
Configuration of This Manual This manual comprises the following items: 1. General Precautions on Handling of Product 2. Configuration of This Manual 3. Preface 4. Contents 5. Overview 6. Description of Functional Modules • CPU and System-Control Modules • On-Chip Peripheral Modules The configuration of the functional description of each module differs according to the module.
Preface The H8S/2472 Group, H8S/2463 Group, and H8S/2462 Group products are single-chip microcomputers made up of the high-speed H8S/2600 CPU employing Renesas Technology original architecture as its core, and the peripheral functions required to configure a system. The H8S/2600 CPU has an instruction set that is compatible with the H8/300 and H8/300H CPUs.
Related Manuals: The latest versions of all related manuals are available from our web site. Please ensure you have the latest versions of all documents you require. http://www.renesas.com/ H8S/2472 Group, H8S/2463 Group, and H8S/2462 Group manuals: Document Title Document No. H8S/2472 Group, H8S/2463 Group, and H8S/2462 Group Hardware Manual This manual H8S/2600 Series, H8S/2000 Series Software Manual REJ09B0139 User's manuals for development tools: Document Title Document No.
Rev. 2.00 Aug.
Contents Section 1 Overview................................................................................................1 1.1 1.2 1.3 Overview................................................................................................................................ 1 Block Diagram ....................................................................................................................... 3 Pin Description....................................................................................
2.8 2.9 2.7.6 Immediate#xx:8, #xx:16, or #xx:32.................................................................... 55 2.7.7 Program-Counter Relative@(d:8, PC) or @(d:16, PC)....................................... 55 2.7.8 Memory Indirect@@aa:8 ................................................................................... 56 2.7.9 Effective Address Calculation ................................................................................ 57 Processing States.......................................
5.4 5.5 5.6 5.7 Interrupt Sources.................................................................................................................. 88 5.4.1 External Interrupts .................................................................................................. 88 5.4.2 Internal Interrupts ................................................................................................... 89 Interrupt Exception Handling Vector Table............................................................
6.8 Bus Arbitration .................................................................................................................. 157 6.8.1 Overview .............................................................................................................. 157 6.8.2 Operation .............................................................................................................. 157 6.8.3 Bus Mastership Transfer Timing ..........................................................................
7.9.2 7.9.3 7.9.4 On-Chip RAM ...................................................................................................... 188 DTCE Bit Setting.................................................................................................. 188 DTC Activation by Interrupt Sources of SCI, IIC, or A/D Converter .................. 188 Section 8 I/O Ports .............................................................................................189 8.1 8.2 8.
8.3.2 Port Control Register 0 (PTCNT0) ....................................................................... 358 Section 9 14-Bit PWM Timer (PWMX) ...........................................................359 9.1 9.2 9.3 9.4 9.5 Features.............................................................................................................................. 359 Input/Output Pins...............................................................................................................
11.3 11.4 11.5 11.6 11.2.1 Timer Counter (TCNT)......................................................................................... 396 11.2.2 Time Constant Register A (TCORA).................................................................... 397 11.2.3 Time Constant Register B (TCORB) .................................................................... 397 11.2.4 Timer Control Register (TCR).............................................................................. 398 11.2.
Section 13 Serial Communication Interface (SCI)............................................431 13.1 Features.............................................................................................................................. 431 13.2 Input/Output Pins............................................................................................................... 434 13.3 Register Descriptions .........................................................................................................
13.8 Interrupt Sources................................................................................................................ 489 13.8.1 Interrupts in Normal Serial Communication Interface Mode ............................... 489 13.8.2 Interrupts in Smart Card Interface Mode .............................................................. 490 13.9 Usage Notes ....................................................................................................................... 491 13.9.
15.3.14 SCIF Control Register (SCIFCR) ......................................................................... 526 15.4 Operation ........................................................................................................................... 528 15.4.1 Baud Rate ............................................................................................................. 528 15.4.2 Operation in Asynchronous Communication........................................................ 529 15.4.
17.3.7 SS Transmit Data Registers 0 to 3 (SSTDR0 to SSTDR3)................................... 564 17.3.8 SS Receive Data Registers 0 to 3 (SSRDR0 to SSRDR3) .................................... 565 17.3.9 SS Shift Register (SSTRSR) ................................................................................. 565 17.4 Operation ........................................................................................................................... 566 17.4.1 Transfer Clock ............................
18.6 Usage Notes ....................................................................................................................... 653 Section 19 LPC Interface (LPC)........................................................................665 19.1 Features.............................................................................................................................. 665 19.2 Input/Output Pins..................................................................................................
19.4 Operation ........................................................................................................................... 733 19.4.1 LPC interface Activation ...................................................................................... 733 19.4.2 LPC I/O Cycles ..................................................................................................... 733 19.4.3 SMIC Mode Transfer Flow...................................................................................
20.3.20 Automatic PAUSE Frame Set Register (APR) ..................................................... 774 20.3.21 Manual PAUSE Frame Set Register (MPR) ......................................................... 775 20.3.22 Automatic PAUSE Frame Retransmission Count Set Register (TPAUSER) ....... 775 20.4 Operation ........................................................................................................................... 776 20.4.1 Transmission.................................................
21.3 Operation ........................................................................................................................... 815 21.3.1 Descriptor List and Data Buffers .......................................................................... 815 21.3.2 Transmission......................................................................................................... 825 21.3.3 Reception ........................................................................................................
22.6 22.7 22.8 22.9 22.10 22.5.2 Operation at Cable Disconnection ........................................................................ 864 22.5.3 Suspend and Resume Operations.......................................................................... 865 22.5.4 Control Transfer.................................................................................................... 870 22.5.5 EP1 Bulk-Out Transfer (Dual FIFOs)................................................................... 876 22.5.
23.6 A/D Conversion Accuracy Definitions .............................................................................. 907 23.7 Usage Notes ....................................................................................................................... 909 23.7.1 Setting of Module Stop Mode............................................................................... 909 23.7.2 Permissible Signal Source Impedance .................................................................. 909 23.7.
26.2 Input/Output Pins............................................................................................................. 1019 26.3 Register Descriptions ....................................................................................................... 1020 26.3.1 Instruction Register (SDIR) ................................................................................ 1021 26.3.2 Bypass Register (SDBPR) ..................................................................................
28.6 Hardware Standby Mode ................................................................................................. 1069 28.7 Module Stop Mode .......................................................................................................... 1070 28.8 Usage Notes ..................................................................................................................... 1070 28.8.1 I/O Port Status......................................................................................
Rev. 2.00 Aug.
Figures Section 1 Figure 1.1 Figure 1.2 Figure 1.3 Figure 1.4 Overview Internal Block Diagram ................................................................................................ 3 Pin Assignments (H8S/2472 Group) ............................................................................ 4 Pin Assignments (H8S/2463 Group) ............................................................................ 5 Pin Assignments (H8S/2462 Group) .............................................................
Figure 5.9 Conflict between Interrupt Generation and Disabling.............................................. 104 Section 6 Bus Controller (BSC) Figure 6.1 Block Diagram of Bus Controller............................................................................. 109 Figure 6.2 IOS Signal Output Timing ....................................................................................... 126 Figure 6.3 Access Sizes and Data Alignment Control (8-bit Access Space) ............................. 127 Figure 6.
Figure 7.5 Memory Mapping in Normal Mode ......................................................................... 178 Figure 7.6 Memory Mapping in Repeat Mode .......................................................................... 179 Figure 7.7 Memory Mapping in Block Transfer Mode ............................................................. 180 Figure 7.8 Chain Transfer Operation......................................................................................... 181 Figure 7.
Figure 10.10 Conflict between OCR Write and Compare-Match (When Automatic Addition Function is Not Used).............................................. 389 Figure 10.11 Conflict between OCR Write and Compare-Match (When Automatic Addition Function is Used)..................................................... 390 Section 11 Figure 11.1 Figure 11.2 Figure 11.3 Figure 11.4 Figure 11.5 Figure 11.6 Figure 11.7 Figure 11.8 Figure 11.9 8-Bit Timer (TMR) Block Diagram of 8-Bit Timer (TMR_0 and TMR_1)...............
Figure 13.10 Example of Communication Using Multiprocessor Format (Transmission of Data H'AA to Receiving Station A) ......................................... 463 Figure 13.11 Sample Multiprocessor Serial Transmission Flowchart ....................................... 464 Figure 13.12 Example of SCI Operation in Reception (Example with 8-Bit Data, Multiprocessor Bit, One Stop Bit)........................................................................ 465 Figure 13.
Figure 14.5 MSB-First Data Reception ..................................................................................... 504 Figure 14.6 LSB-First and MSB-First Transmit Data ............................................................... 505 Section 15 Serial Communication Interface with FIFO (SCIF) Figure 15.1 Block Diagram of SCIF.......................................................................................... 508 Figure 15.
Figure 17.15 Example of Reception Operation (Clock Synchronous Communication Mode)......................................................................................... 582 Figure 17.16 Flowchart Example of Data Reception (Clock Synchronous Communication Mode) ........................................................................................ 583 Figure 17.17 Flowchart Example of Simultaneous Transmission/Reception (Clock Synchronous Communication Mode)...............................................
Figure 18.25 Figure 18.26 Figure 18.27 Figure 18.28 Figure 18.29 Figure 18.30 Figure 18.31 Figure 18.32 Figure 18.33 Figure 18.34 Figure 18.35 IRIC Setting Timing and SCL Control (1) ........................................................... 645 IRIC Setting Timing and SCL Control (2) ........................................................... 646 IRIC Setting Timing and SCL Control (3) ........................................................... 647 Block Diagram of Noise Canceler.........................
Section 21 Figure 21.1 Figure 21.2 Figure 21.3 Figure 21.4 Figure 21.5 Figure 21.6 Figure 21.7 Ethernet Controller Direct Memory Access Controller (E-DMAC) Configuration of E-DMAC, and Descriptors and Buffers...................................... 794 Relationship between Transmit Descriptor and Transmit Buffer ........................... 818 Relationship between Receive Descriptor and Receive Buffer .............................. 822 Sample Transmission Flowchart ...........................................
Figure 23.5 Timing of External Trigger Input ........................................................................... 908 Figure 23.6 A/D Conversion Accuracy Definitions................................................................... 910 Figure 23.7 A/D Conversion Accuracy Definitions................................................................... 910 Figure 23.8 Example of Analog Input Circuit ........................................................................... 911 Figure 23.
Section 27 Figure 27.1 Figure 27.2 Figure 27.3 Figure 27.4 Figure 27.5 Clock Pulse Generator Block Diagram of Clock Pulse Generator ............................................................ 1051 Typical Connection to Crystal Resonator............................................................. 1052 Equivalent Circuit of Crystal Resonator............................................................... 1052 Example of External Clock Input ...................................................................
Figure 31.28 Figure 31.29 Figure 31.30 Figure 31.31 Figure 31.32 Figure 31.33 Figure 31.34 Figure 31.35 Figure 31.36 Figure 31.37 Figure 31.38 Figure 31.39 Figure 31.40 Figure 31.41 Figure 31.42 Figure 31.43 Figure 31.44 Figure 31.45 Figure 31.46 SSU Timing (Master, CPHS = 1) ....................................................................... 1150 SSU Timing (Master, CPHS = 0) ....................................................................... 1151 SSU Timing (Slave, CPHS = 1) .....................
Tables Section 1 Overview Table 1.1 Pin Assignments in Each Operating Mode..................................................................... 7 Table 1.2 Pin Functions................................................................................................................ 14 Section 2 Table 2.1 Table 2.2 Table 2.3 Table 2.4 Table 2.4 Table 2.5 Table 2.6 Table 2.7 Table 2.7 Table 2.8 Table 2.9 Table 2.10 Table 2.11 Table 2.12 Table 2.13 Table 2.13 CPU Instruction Classification ....................
Table 5.9 Interrupt Source Selection and Clearing Control ....................................................... 103 Section 6 Table 6.1 Table 6.2 Table 6.3 Table 6.4 Table 6.5 Table 6.6 Table 6.7 Table 6.8 Table 6.12 Table 6.13 Table 6.14 Table 6.15 Bus Controller (BSC) Pin Configuration....................................................................................................... 110 Address Ranges and External Address Spaces...........................................................
Table 8.9 Table 8.10 Table 8.11 Table 8.12 Table 8.13 Table 8.14 Table 8.15 Table 8.16 Port Functions ............................................................................................................ 273 Port 1 Input Pull-Up MOS States ............................................................................. 279 Port 2 Input Pull-Up MOS States ............................................................................. 284 Port 3 Input Pull-Up MOS States ....................................
Table 13.11 SSR Status Flags and Receive Data Handling ....................................................... 459 Table 13.12 SCI Interrupt Sources............................................................................................. 489 Table 13.13 SCI Interrupt Sources............................................................................................. 490 Section 15 Table 15.1 Table 15.2 Table 15.3 Table 15.4 Table 15.5 Table 15.6 Table 15.7 Table 15.8 Table 15.
Table 19.2 Table 19.3 Table 19.4 Table 19.5 Table 19.6 Table 19.7 Table 19.8 Table 19.9 Table 19.10 Table 19.11 Table 19.12 Table 19.13 Table 19.14 LADR1, LADR2 Initial Values ............................................................................... 686 Host Register Selection ............................................................................................ 687 Slave Selection Internal Registers............................................................................ 687 LPC I/O Cycle..
Table 25.7 Enumeration Information ......................................................................................... 953 Table 25.8 Executable MAT ...................................................................................................... 973 Table 25.9 (1) Useable Area for Programming in User Program Mode .................................... 974 Table 25.9 (2) Useable Area for Erasure in User Program Mode .............................................. 976 Table 25.
Table 31.11 Table 31.12 Table 31.13 Table 31.14 Table 31.15 Timing of On-Chip Peripheral Modules (2)......................................................... 1148 I2C Bus Timing .................................................................................................... 1153 LPC Module Timing ............................................................................................ 1154 Ethernet Controller Signal Timing .......................................................................
Rev. 2.00 Aug.
Section 1 Overview Section 1 Overview 1.
Section 1 Overview • On-chip memory ROM Type Model ROM RAM Remarks Flash memory Version R4F2472 512 Kbytes 40 Kbytes 176 pins, USB incorporated R4F2463 512 Kbytes 40 Kbytes 144 pins, USB and PECI not incorporated R4F2462 512 Kbytes 40 Kbytes 144 pins, USB not incorporated • Reprogramming count: 1000 times (Tpy.
Section 1 Overview Block Diagram DTC H8S/2600 CPU RAM 40K ROM (Flash) 512K (+16K UB) Port E Port 2 Port F Port 1 Clock pulse generator LPC EtherC E-DMAC JTAG 8-bit timer × 4 SSU CRC calculator FRT USB* 1 IIC_0 to IIC_5 PECI* 2 Port 5 SCIF Port 7 Port 8 Port C A/D converter Port B Port 4 SCI_1, SCI_3 Bus controller 14-bit PWM × 4 Interrupt controller Port D EVC Port A Port 3 WDT × 2 Port 6 1.
Section 1 Overview 1.3 Pin Description 1.3.
P75/AN5 P76/AN6 P77/AN7 AVCC P60/IRQ14/PWX0/D0 P61/IRQ15/PWX1/D1 P62/PWX2/D2 P63/PWX3/D3 P64/ExIRQ11/CTS P65/ExIRQ10/RTS P66/ExIRQ9/SCS P67/ExIRQ8/SSCK VCC ETMS ETDO ETDI ETCK ETRST NC PF1/RS9/MDC PF0/RS8/MDIO VSS P27/DTR P26/DSR P25/RI P24/DCD P23/A11/AD11 P22/A10/AD10 P21/A9/AD9 P20/A8/AD8 P17/A7/AD7 P16/A6/AD6 P15/A5/AD5 P14/A4/AD4 P13/A3/AD3 P12/A2/AD2 Section 1 Overview 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 7
P75/AN5 P76/AN6 P77/AN7 AVCC AVref P60/IRQ14/PWX0/D0 P61/IRQ15/PWX1/D1 P62/PWX2/D2 P63/PWX3/D3 P64/ExIRQ11/CTS P65/ExIRQ10/RTS P66/ExIRQ9/SCS P67/ExIRQ8/SSCK VCC ETMS ETDO ETDI ETCK ETRST PF1/RS9/MDC PF0/RS8/MDIO VSS P27/DTR P26/DSR P25/RI P24/DCD P23/A11/AD11 P22/A10/AD10 P21/A9/AD9 P20/A8/AD8 P17/A7/AD7 P16/A6/AD6 P15/A5/AD5 P14/A4/AD4 P13/A3/AD3 P12/A2/AD2 Section 1 Overview 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 8
Section 1 Overview 1.3.2 Table 1.1 Pin Assignment in Each Operating Mode Pin Assignments in Each Operating Mode Pin No.
Section 1 Overview Pin No.
Section 1 Overview Pin No.
Section 1 Overview Pin No.
Section 1 Overview Pin No.
Section 1 Overview Pin No.
Section 1 Overview Pin No.
Section 1 Overview 1.3.3 Table 1.2 Pin Functions Pin Functions Pin No. H8S/2462 H8S/2463 H8S/2472 I/O Name and Function Type Symbol 144-Pin Power supply VCC 1, 36, 1, 36, A1, N2, Input 86, 120 86, 120 P9, K12, A11, C5 Power supply pins. Connect all these pins to the system power supply. Connect the bypass capacitor between VCC and VSS (near VCC). VCL 13 External capacitance pin for internal step-down power.
Section 1 Overview Pin No. H8S/2462 H8S/2463 H8S/2472 Type Symbol 144-Pin 144-Pin 176-Pin I/O Name and Function System control RESO 142 142 B3 142 Outputs a reset signal to an external device. STBY 12 12 E1 12 When this pin is low, a transition is made to hardware standby mode. FWE 137 135 D6 Input Pin for use by flash memory.
Section 1 Overview Pin No.
Section 1 Overview Pin No. H8S/2462 H8S/2463 H8S/2472 Type Symbol 144-Pin 144-Pin 176-Pin I/O Name and Function Bus control RD 25 25 J2 Output Low level on this pin indicates that the MCU is reading from an external address space. HWR 6 6 C1 Output Low level on this pin indicates that the MCU is writing to an external address space. The upper byte of the data bus is valid. LWR 26 26 K4 Output Low level on this pin indicates that the MCU is writing to an external address space.
Section 1 Overview Pin No. H8S/2462 H8S/2463 H8S/2472 Type Symbol 144-Pin 144-Pin 176-Pin 14-bit PWM timer (PWMX) PWX0 to PWX3 ExPWX0 to ExPWX2 78 to 81, 21, 20, 10 77 to 80, 21, 20, 10 Output M13, N15, M14, L12, H3, H4, E3 ExPWX3 D4 TxD1, TxD3 135, 43 133, 43 A7, N5 Output Transmit data output pins RxD1, RxD3 136, 44 134, 44 B7, P5 Input Receive data input pins SCK1, SCK3 45, 46 45, 46 R5, M6 Input/ Output Clock input/output pins.
Section 1 Overview Pin No. H8S/2462 H8S/2463 H8S/2472 Type Symbol 144-Pin 144-Pin 176-Pin I C bus interface (IIC) SDA0 to SDA5 49, 47, 31, 29, 27, 59 49, 47, 31, 29, 27, 59 P6, N6, Input/ L4, K2, Output K3, M10 A/D converter AN7 to AN0 75 to 68 75 to 68 N13, R15, P14, R14, P13, M12, R13, N12 Input Analog input pins AVCC 76 76 P15 Input Analog power supply pins. When the A/D converter is not used, these pins should be connected to the system power supply (+3.3 V).
Section 1 Overview Pin No. H8S/2462 H8S/2463 H8S/2472 Type Symbol 144-Pin 144-Pin 176-Pin I/O Name and Function LPC Interface (LPC) GA20 63 63 N11 Input/ Output GATE A20 control signal output pin; also used as the input pin for monitoring the output state. CLKRUN 62 62 P10 Input/ Output Input/output pin used to request starting the LCLK operation while LCLK is stopped.
Section 1 Overview Pin No. H8S/2462 H8S/2463 H8S/2472 Type Symbol 144-Pin 144-Pin 176-Pin Event Counter EVENT15 112 to to 119, EVENT0 33 to 35, 37 to 41 112 to 119, 33 to 35, 37 to 41 Input B13, C12, A13, B12, D11, A12, C11, B11, M3, N1, M4, P1, P2, N3, P3, R3 Event counter input pins 10 10 E3 A4, B4, D4, G13 RS9 to RS0 92, 93, 4 to 2, 140, 132 to 129 92,93,4 to 2, 138, 132 to 129 G15, G14, C2, B1, C3, B6, B8, A8, C8, D8 Retain state output pins.
Section 1 Overview Pin No. H8S/2462 H8S/2463 H8S/2472 Type Symbol 144-Pin 144-Pin 176-Pin Large current output pins HC7 to HC0 4 to 2, 140, 132 to 129 4 to 2, 138, 132 to 129 C2, B1, Output C3, B6, B8, A8, C8, D8 These pins can be used to drive LEDs or for other purposes where large currents are required.
Section 1 Overview Pin No.
Section 1 Overview Pin No. H8S/2462 H8S/2463 H8S/2472 Type Symbol 144-Pin I/O ports PD7 to PD0 59 to 66 59 to 66 M10, N10, R10, P10, N11, R11, P11, M11 I/O Name and Function Input/ Output 8-bit input/output pins PE7 to PE0 51 to 58 51 to 58 R7, M8, Input/ N8, R8, Output P8, M9, N9, R9 8-bit input/output pins PF6 10 10 E3 PF5 to PF2 A4, B4, D4, G13 7-bit input/output pins. Pins PF5 to PF2 are supported only by the H8S/2472 Group. 92, 93 G15, G14 PF1, PF0 92, 93 144-Pin Rev. 2.
Section 2 CPU Section 2 CPU The H8S/2600 CPU is a high-speed central processing unit with an internal 32-bit architecture that is upward-compatible with the H8/300 and H8/300H CPUs. The H8S/2600 CPU has sixteen 16-bit general registers, can address a 16-Mbyte linear address space, and is ideal for realtime control. This section describes the H8S/2600 CPU. The usable modes and address spaces differ depending on the product. For details on each product, refer to section 3, MCU Operating Modes. 2.
Section 2 CPU 16 ÷ 8-bit register-register divide: 12 states 16 × 16-bit register-register multiply: 3 states 32 ÷ 16-bit register-register divide: 20 states • Two CPU operating modes Normal mode* Advanced mode • Power-down state Transition to power-down state by the SLEEP instruction CPU clock speed selection Note: * Normal mode is not available in this LSI. 2.1.
Section 2 CPU 2.1.2 Differences from H8/300 CPU In comparison to the H8/300 CPU, the H8S/2600 CPU has the following enhancements: • More general registers and control registers Eight 16-bit extended registers, and one 8-bit and two 32-bit control registers, have been added. • Expanded address space Normal mode supports the same 64-kbyte address space as the H8/300 CPU. Advanced mode supports a maximum 16-Mbyte address space.
Section 2 CPU 2.2 CPU Operating Modes The H8S/2600 CPU has two operating modes: normal and advanced. Normal mode supports a maximum 64-kbyte address space. Advanced mode supports a maximum 16-Mbyte total address space. The mode is selected by the mode pins. 2.2.1 Normal Mode The exception vector table and stack have the same structure as in the H8/300 CPU. • Address Space Linear access to a 64-kbyte maximum address space is provided.
Section 2 CPU H'0000 H'0001 H'0002 H'0003 H'0004 H'0005 H'0006 H'0007 H'0008 H'0009 H'000A H'000B Exception vector 1 Exception vector 2 Exception vector 3 Exception vector table Exception vector 4 Exception vector 5 Exception vector 6 Figure 2.1 Exception Vector Table (Normal Mode) SP PC (16 bits) EXR*1 SP (SP * 2 Reserved*1,*3 ) CCR CCR*3 PC (16 bits) (a) Subroutine Branch (b) Exception Handling Notes: 1. When EXR is not used it is not stored on the stack. 2. SP when EXR is not used. 3.
Section 2 CPU 2.2.2 Advanced Mode • Address Space Linear access to a 16-Mbyte maximum address space is provided. • Extended Registers (En) The extended registers (E0 to E7) can be used as 16-bit registers, or as the upper 16-bit segments of 32-bit registers or address registers. • Instruction Set All instructions and addressing modes can be used.
Section 2 CPU The memory indirect addressing mode (@@aa:8) employed in the JMP and JSR instructions uses an 8-bit absolute address included in the instruction code to specify a memory operand that contains a branch address. In advanced mode the operand is a 32-bit longword operand, providing a 32-bit branch address. The upper 8 bits of these 32 bits is a reserved area that is regarded as H'00. Branch addresses can be stored in the area from H'00000000 to H'000000FF.
Section 2 CPU 2.3 Address Space Figure 2.5 shows a memory map for the H8S/2600 CPU. The H8S/2600 CPU provides linear access to a maximum 64-kbyte address space in normal mode, and a maximum 16-Mbyte (architecturally 4-Gbyte) address space in advanced mode. The usable modes and address spaces differ depending on the product. For details on each product, refer to section 3, MCU Operating Modes.
Section 2 CPU 2.4 Registers The H8S/2600 CPU has the internal registers shown in figure 2.6. There are two types of registers; general registers and control registers. The control registers are a 24-bit program counter (PC), an 8-bit extended control register (EXR), an 8-bit condition code register (CCR), and a 64-bit multiply-accumulate register (MAC).
Section 2 CPU 2.4.1 General Registers The H8S/2600 CPU has eight 32-bit general registers. These general registers are all functionally identical and can be used as both address registers and data registers. When a general register is used as a data register, it can be accessed as a 32-bit, 16-bit, or 8-bit register. Figure 2.7 illustrates the usage of the general registers. When the general registers are used as 32-bit registers or address registers, they are designated by the letters ER (ER0 to ER7).
Section 2 CPU Free area SP (ER7) Stack area Figure 2.8 Stack 2.4.2 Program Counter (PC) This 24-bit counter indicates the address of the next instruction the CPU will execute. The length of all CPU instructions is 2 bytes (one word), so the least significant PC bit is ignored. (When an instruction is fetched, the least significant PC bit is regarded as 0). 2.4.3 Extended Control Register (EXR) EXR is an 8-bit register that manipulates the LDC, STC, ANDC, ORC, and XORC instructions.
Section 2 CPU 2.4.4 Condition-Code Register (CCR) This 8-bit register contains internal CPU status information, including an interrupt mask bit (I) and half-carry (H), negative (N), zero (Z), overflow (V), and carry (C) flags. Operations can be performed on the CCR bits by the LDC, STC, ANDC, ORC, and XORC instructions. The N, Z, V, and C flags are used as branching conditions for conditional branch (Bcc) instructions.
Section 2 CPU Bit Bit Name Initial Value 1 V Undefined R/W R/W Description Overflow Flag Set to 1 when an arithmetic overflow occurs, and cleared to 0 at other times. 0 C Undefined R/W Carry Flag Set to 1 when a carry occurs, and cleared to 0 otherwise. Used by: • Add instructions, to indicate a carry • Subtract instructions, to indicate a borrow • Shift and rotate instructions, to indicate a carry The carry flag is also used as a bit accumulator by bit manipulation instructions. 2.4.
Section 2 CPU 2.5 Data Formats The H8S/2600 CPU can process 1-bit, 4-bit (BCD), 8-bit (byte), 16-bit (word), and 32-bit (longword) data. Bit-manipulation instructions operate on 1-bit data by accessing bit n (n = 0, 1, 2, …, 7) of byte operand data. The DAA and DAS decimal-adjust instructions treat byte data as two digits of 4-bit BCD data. 2.5.1 General Register Data Formats Figure 2.9 shows the data formats in general registers.
Section 2 CPU Data Type Register Number Word data Rn Data Format 15 0 MSB Word data 15 0 MSB Longword data LSB En LSB ERn 31 16 15 MSB En 0 Rn LSB [Legend] ERn: General register ER En: General register E Rn: General register R RnH: General register RH RnL: General register RL MSB: Most significant bit LSB: Least significant bit Figure 2.9 General Register Data Formats (2) Rev. 2.00 Aug.
Section 2 CPU 2.5.2 Memory Data Formats Figure 2.10 shows the data formats in memory. The H8S/2600 CPU can access word data and longword data in memory, however word or longword data must begin at an even address. If an attempt is made to access word or longword data at an odd address, an address error does not occur, however the least significant bit of the address is regarded as 0, so access begins the preceding address. This also applies to instruction fetches.
Section 2 CPU 2.6 Instruction Set The H8S/2600 CPU has 69 instructions. The instructions are classified by function in table 2.1. Table 2.
Section 2 CPU 2.6.1 Table of Instructions Classified by Function Tables 2.3 to 2.10 summarize the instructions in each functional category. The notation used in tables 2.3 to 2.10 is defined below. Table 2.
Section 2 CPU Table 2.3 Data Transfer Instructions Instruction Size* Function MOV B/W/L (EAs) → Rd, Rs → (EAd) Moves data between two general registers or between a general register and memory, or moves immediate data to a general register. MOVFPE B Cannot be used in this LSI. MOVTPE B Cannot be used in this LSI. POP W/L @SP+ → Rn Pops a general register from the stack. POP.W Rn is identical to MOV.W @SP+, Rn. POP.L ERn is identical to MOV.L @SP+, ERn.
Section 2 CPU Table 2.4 Arithmetic Operations Instructions (1) Instruction Size* Function ADD SUB B/W/L Rd ± Rs → Rd, Rd ± #IMM → Rd Performs addition or subtraction on data in two general registers, or on immediate data and data in a general register (immediate byte data cannot be subtracted from byte data in a general register. Use the SUBX or ADD instruction.
Section 2 CPU Table 2.4 Arithmetic Operations Instructions (2) 1 Instruction Size* Function DIVXS B/W Rd ÷ Rs → Rd Performs signed division on data in two general registers: either 16 bits ÷ 8 bits → 8-bit quotient and 8-bit remainder or 32 bits ÷ 16 bits → 16-bit quotient and 16-bit remainder. CMP B/W/L Rd – Rs, Rd – #IMM Compares data in a general register with data in another general register or with immediate data, and sets CCR bits according to the result.
Section 2 CPU Table 2.5 Logic Operations Instructions Instruction Size* Function AND B/W/L Rd ∧ Rs → Rd, Rd ∧ #IMM → Rd Performs a logical AND operation on a general register and another general register or immediate data. OR B/W/L Rd ∨ Rs → Rd, Rd ∨ #IMM → Rd Performs a logical OR operation on a general register and another general register or immediate data.
Section 2 CPU Table 2.7 Bit Manipulation Instructions (1) Instruction Size* Function BSET B 1 → ( of ) Sets a specified bit in a general register or memory operand to 1. The bit number is specified by 3-bit immediate data or the lower three bits of a general register. BCLR B 0 → ( of ) Clears a specified bit in a general register or memory operand to 0. The bit number is specified by 3-bit immediate data or the lower three bits of a general register.
Section 2 CPU Table 2.7 Bit Manipulation Instructions (2) 1 Instruction Size* Function BXOR B C ⊕ ( of ) → C XORs the carry flag with a specified bit in a general register or memory operand and stores the result in the carry flag. BIXOR B BLD B BILD B C ⊕ [∼( of )] → C XORs the carry flag with the inverse of a specified bit in a general register or memory operand and stores the result in the carry flag. The bit number is specified by 3-bit immediate data. (
Section 2 CPU Table 2.8 Branch Instructions Instruction Size Function Bcc Branches to a specified address if a specified condition is true. The branching conditions are listed below.
Section 2 CPU Table 2.9 System Control Instructions Instruction Size* Function TRAPA Starts trap-instruction exception handling. RTE Returns from an exception-handling routine. SLEEP Causes a transition to a power-down state. LDC B/W (EAs) → CCR, (EAs) → EXR Moves general register or memory contents or immediate data to CCR or EXR. Although CCR and EXR are 8-bit registers, word-size transfers are performed between them and memory. The upper 8 bits are valid.
Section 2 CPU Table 2.10 Block Data Transfer Instructions Instruction Size Function EEPMOV.B if R4L ≠ 0 then Repeat @ER5+ → @ER6+ R4L–1 → R4L Until R4L = 0 else next; EEPMOV.W if R4 ≠ 0 then Repeat @ER5+ → @ER6+ R4–1 → R4 Until R4 = 0 else next; Transfers a data block. Starting from the address set in ER5, transfers data for the number of bytes set in R4L or R4 to the address location set in ER6. Execution of the next instruction begins as soon as the transfer is completed. Rev. 2.00 Aug.
Section 2 CPU 2.6.2 Basic Instruction Formats The H8S/2600 CPU instructions consist of 2-byte (1-word) units. An instruction consists of an operation field (op field), a register field (r field), an effective address extension (EA field), and a condition field (cc). Figure 2.11 shows examples of instruction formats. • Operation Field Indicates the function of the instruction, the addressing mode, and the operation to be carried out on the operand.
Section 2 CPU 2.7 Addressing Modes and Effective Address Calculation The H8S/2600 CPU supports the eight addressing modes listed in table 2.11. Each instruction uses a subset of these addressing modes. Arithmetic and logic instructions can use the register direct and immediate modes. Data transfer instructions can use all addressing modes except programcounter relative and memory indirect.
Section 2 CPU 2.7.3 Register Indirect with Displacement@(d:16, ERn) or @(d:32, ERn) A 16-bit or 32-bit displacement contained in the instruction is added to an address register (ERn) specified by the register field of the instruction, and the sum gives the address of a memory operand. A 16-bit displacement is sign-extended when added. 2.7.
Section 2 CPU Table 2.12 Absolute Address Access Ranges Absolute Address Data address Normal Mode* Advanced Mode 8 bits (@aa:8) H'FF00 to H'FFFF H'FFFF00 to H'FFFFFF 16 bits (@aa:16) H'0000 to H'FFFF H'000000 to H'007FFF, H'FF8000 to H'FFFFFF 32 bits (@aa:32) Program instruction address H'000000 to H'FFFFFF 24 bits (@aa:24) Note: Normal mode is not available in this LSI. 2.7.
Section 2 CPU 2.7.8 Memory Indirect@@aa:8 This mode can be used by the JMP and JSR instructions. The instruction code contains an 8-bit absolute address specifying a memory operand. This memory operand contains a branch address. The upper bits of the absolute address are all assumed to be 0, so the address range is 0 to 255 (H'0000 to H'00FF in normal mode, H'000000 to H'0000FF in advanced mode). In normal mode, the memory operand is a word operand and the branch address is 16 bits long.
Section 2 CPU 2.7.9 Effective Address Calculation Table 2.13 indicates how effective addresses are calculated in each addressing mode. In normal mode the upper 8 bits of the effective address are ignored in order to generate a 16-bit address. Note: Normal mode is not available in this LSI. Table 2.13 Effective Address Calculation (1) No 1 Addressing Mode and Instruction Format op 2 Effective Address Calculation Effective Address (EA) Register direct(Rn) rm Operand is general register contents.
Section 2 CPU Table 2.13 Effective Address Calculation (2) No 5 Addressing Mode and Instruction Format Effective Address Calculation Effective Address (EA) Absolute address @aa:8 31 op @aa:16 31 op 0 H'FFFF 24 23 16 15 0 Don't care Sign extension abs @aa:24 31 op 8 7 24 23 Don't care abs 24 23 0 Don't care abs @aa:32 op 31 6 Immediate #xx:8/#xx:16/#xx:32 op 7 0 24 23 Don't care abs Operand is immediate data.
Section 2 CPU 2.8 Processing States The H8S/2600 CPU has four main processing states: the reset state, exception handling state, program execution state and power-down state. Figure 2.13 indicates the state transitions. • Reset State In this state, the CPU and all on-chip peripheral modules are initialized and not operating. When the RES input goes low, all current processing stops and the CPU enters the reset state. All interrupts are masked in the reset state.
Section 2 CPU End of bus request Bus request Program execution state End of bus request SLEEP instruction with PSS = 0 and SSBY = 1 Bus request SLEEP instruction with SSBY = 0 Bus-released state Request for exception handling End of exception handling Sleep mode Interrupt request Exception-handling state External interrupt request Software standby mode RES = high Reset state*1 STBY = High, RES = Low Hardware standby mode*2 Power-down state Notes: 1.
Section 2 CPU 2.9 Usage Note 2.9.1 Notes on Using the Bit Operation Instruction Instructions BSET, BCLR, BNOT, BST, and BIST read data in byte units, and write data in byte units after bit operation. Therefore, attention must be paid when these instructions are used for ports or registers including write-only bits. Instruction BCLR can be used to clear the flag in the internal I/O register to 0.
Section 2 CPU Rev. 2.00 Aug.
Section 3 MCU Operating Modes Section 3 MCU Operating Modes 3.1 Operating Mode Selection This LSI supports one operating mode (mode 2). The operating mode is determined by the setting of the mode pins (MD2 and MD1). Table 3.1 shows the MCU operating mode selection. Table 3.1 MCU Operating Mode Selection MCU Operating Mode MD2 CPU Operating Description MD1 Mode 2 1 1 Advanced Extended mode with on-chip ROM Single-chip mode Mode 2 is single-chip mode after a reset.
Section 3 MCU Operating Modes 3.2 Register Descriptions The following registers are related to the operating mode. For details on the bus control register (BCR), see section 6.3.1, Bus Control Register (BCR), and for details on bus control register 2 (BCR2), see section 6.3.2, Bus Control Register 2 (BCR2). • Mode control register (MDCR) • System control register (SYSCR) • Serial timer control register (STCR) 3.2.
Section 3 MCU Operating Modes 3.2.2 System Control Register (SYSCR) SYSCR selects a system pin function, monitors a reset source, selects the interrupt control mode and the detection edge for NMI, enables or disables register access to the on-chip peripheral modules, and enables or disables on-chip RAM address space. Bit Bit Name Initial Value R/W Description 7 CS256E 0 R/W Chip Select 256 Enable Enables or disables P97/WAIT/CS256 pin function in extended mode.
Section 3 MCU Operating Modes Bit Bit Name Initial Value R/W Description 3 XRST 1 R External Reset This bit indicates the reset source. A reset is caused by an external reset input, or when the watchdog timer overflows. 0: A reset is caused when the watchdog timer overflows. 1: A reset is caused by an external reset. 2 NMIEG 0 R/W NMI Edge Select Selects the valid edge of the NMI interrupt input.
Section 3 MCU Operating Modes Bit Bit Name Initial Value R/W Description 4 0 R/W Reserved The initial value should not be changed. 3 FLSHE 0 R/W Flash Memory Control Register Enable Enables or disables CPU access for flash memory registers (FCCS, FPCS, FECS, FKEY, FMATS, FTDAR), control registers of power-down states (SBYCR, LPWRCR, MSTPCRH, MSTPCRL), and control registers of on-chip peripheral modules (BCR2, WSCR2, PCSR, SYSCR2). 0: Area from H'FFFE88 to H'FFFE8F is reserved.
Section 3 MCU Operating Modes 3.3 Operating Mode Descriptions 3.3.1 Mode 2 The CPU can access a 16 Mbytes address space in advanced mode. The on-chip ROM is enabled. After a reset, the LSI is set to single-chip mode. To access an external address space, bit EXPE in MDCR should be set to 1. • Normal extended mode In extended mode, ports 1, 2 (P23 to P20), and 4 (P47 to P44) function as input ports after a reset.
Section 3 MCU Operating Modes 3.4 Address Map Figure 3.1 shows the memory map in operating modes.
Section 3 MCU Operating Modes Rev. 2.00 Aug.
Section 4 Exception Handling Section 4 Exception Handling 4.1 Exception Handling Types and Priority As table 4.1 indicates, exception handling may be caused by a reset, interrupt, illegal instruction, or trap instruction. Exception handling is prioritized as shown in table 4.1. If two or more exceptions occur simultaneously, they are accepted and processed in order of priority. Table 4.
Section 4 Exception Handling 4.2 Exception Sources and Exception Vector Table Different vector addresses are assigned to different exception sources. Table 4.2 lists the exception sources and their vector addresses. Table 4.
Section 4 Exception Handling Vector Address Exception Source Vector Number Advanced Mode Reserved for system use 30 H'000078 to H'00007B 33 H'000084 to H'000087 Internal interrupt* 34 55 H'000088 to H'00008B H'0000DC to H'0000DF External interrupt IRQ8 56 H'0000E0 to H'0000E3 IRQ9 57 H'0000E4 to H'0000E7 IRQ10 58 H'0000E8 to H'0000EB IRQ11 59 H'0000EC to H'0000EF IRQ12 60 H'0000F0 to H'0000F3 IRQ13 61 H'0000F4 to H'0000F7 IRQ14 62 H'0000F8 to H'0000FB IRQ15 63 H'
Section 4 Exception Handling 4.3 Reset A reset has the highest exception priority. When the RES pin goes low, all processing halts and this LSI enters the reset. To ensure that this LSI is reset, hold the RES pin low for at least 20 ms at power-on. To reset the chip during operation, hold the RES pin low for at least 20 states. A reset initializes the internal state of the CPU and the registers of on-chip peripheral modules. The chip can also be reset by overflow of the watchdog timer.
Section 4 Exception Handling Vector fetch Internal processing Prefetch of first program instruction φ RES Internal address bus (1) U (1) L (3) Internal read signal High Internal write signal Internal data bus (2) U (2) L (4) (1) Reset exception handling vector address (1) U = H'000000 (1) L = H'000002 (2) Start address (contents of reset exception handling vector address) (3) Start address ((3) = (2)U + (2)L) (4) First program instruction Figure 4.1 Reset Sequence 4.3.
Section 4 Exception Handling 4.4 Interrupt Exception Handling Interrupts are controlled by the interrupt controller. The sources to start interrupt exception handling are external interrupt sources (NMI and IRQ15 to IRQ0) and internal interrupt sources from the on-chip peripheral modules. NMI is an interrupt with the highest priority. For details, see section 5, Interrupt Controller. Interrupt exception handling is conducted as follows: 1.
Section 4 Exception Handling 4.6 Stack Status after Exception Handling Figure 4.2 shows the stack after completion of trap instruction exception handling and interrupt exception handling. Advanced mode SP CCR PC (24 bits) Figure 4.2 Stack Status after Exception Handling Rev. 2.00 Aug.
Section 4 Exception Handling 4.7 Usage Note When accessing word data or longword data, this LSI assumes that the lowest address bit is 0. The stack should always be accessed in words or longwords, and the value of the stack pointer (SP: ER7) should always be kept even. Use the following instructions to save registers: PUSH.W Rn (or MOV.W Rn, @-SP) PUSH.L ERn (or MOV.L ERn, @-SP) Use the following instructions to restore registers: POP.W Rn (or MOV.W @SP+, Rn) POP.L ERn (or MOV.
Section 5 Interrupt Controller Section 5 Interrupt Controller 5.1 Features • Two interrupt control modes Any of two interrupt control modes can be set by means of the INTM1 and INTM0 bits in the system control register (SYSCR). • Priorities settable with ICR An interrupt control register (ICR) is provided for setting interrupt priorities. Priority levels can be set for each module for all interrupts except NMI.
Section 5 Interrupt Controller CPU INTM1, INTM0 SYSCR NMIEG NMI input NMI input IRQ input IRQ input ISR ISCR IER Interrupt request Vector number Priority level determination I, UI CCR Internal interrupt sources SWDTEND to EINT ICR Interrupt controller [Legend] ICR: ISCR: IER: ISR: SYSCR: Interrupt control register IRQ sense control register IRQ enable register IRQ status register System control register Figure 5.1 Block Diagram of Interrupt Controller 5.2 Input/Output Pins Table 5.
Section 5 Interrupt Controller 5.3 Register Descriptions The interrupt controller has the following registers. For details on the system control register (SYSCR), see section 3.2.2, System Control Register (SYSCR), and for details on the IRQ sense port select registers (ISSR16 and ISSR), see section 8.3.1, IRQ Sense Port Select Register 16 (ISSR16), IRQ Sense Port Select Register (ISSR).
Section 5 Interrupt Controller Table 5.2 Correspondence between Interrupt Source and ICR Register Bit Bit Name ICRA ICRB ICRC ICRD 7 ICRn7 IRQ0 A/D converter SCI_3 IRQ8 to IRQ11 6 ICRn6 IRQ1 FRT SCI_1 IRQ12 to IRQ15 5 4 ICRn5 ICRn4 IRQ2, IRQ3 IRQ4, IRQ5 TMR_X SSU IIC_0 EtherC 3 2 ICRn3 ICRn2 IRQ6, IRQ7 DTC TMR_0 TMR_1 IIC_1 IIC_2, IIC_3 2 PECI* 1 0 ICRn1 ICRn0 WDT_0 WDT_1 TMR_Y IIC_4, IIC_5 LPC 1 USB* SCIF [Legend] n: A to D : Reserved.
Section 5 Interrupt Controller 5.3.3 Break Address Registers A to C (BARA to BARC) The BAR registers specify an address that is to be a break address. An address in which the first byte of an instruction exists should be set as a break address. • BARA Bit Bit Name Initial Value R/W Description 7 to 0 A23 to A16 All 0 R/W Addresses 23 to 16 The A23 to A16 bits are compared with A23 to A16 in the internal address bus.
Section 5 Interrupt Controller 5.3.4 IRQ Sense Control Registers (ISCR16H, ISCR16L, ISCRH, ISCRL) The ISCR registers select the source that generates an interrupt request at pins IRQ15 to IRQ0 or pins ExIRQ15 to ExIRQ0.
Section 5 Interrupt Controller • ISCRH Bit Bit Name Initial Value R/W Description 7 IRQ7SCB 0 R/W 6 IRQ7SCA 0 R/W IRQn Sense Control B IRQn Sense Control A 5 IRQ6SCB 0 R/W 4 IRQ6SCA 0 R/W 3 IRQ5SCB 0 R/W 2 IRQ5SCA 0 R/W 1 IRQ4SCB 0 R/W 0 IRQ4SCA 0 R/W 00: Interrupt request generated at low level of IRQn or ExIRQn input 01: Interrupt request generated at falling edge of IRQn or ExIRQn input 10: Interrupt request generated at rising edge of IRQn or ExIRQn input 11: Inter
Section 5 Interrupt Controller 5.3.5 IRQ Enable Registers (IER16, IER) The IER registers control the enabling and disabling of interrupt requests IRQ15 to IRQ0. • IER16 Bit Bit Name 7 to 0 IRQ15E to IRQ8E Initial Value R/W Description All 0 R/W IRQn Enable (n = 15 to 8) The IRQn interrupt request is enabled when this bit is 1. • IER Bit Bit Name 7 to 0 IRQ7E to IRQ0E Initial Value R/W Description All 0 R/W IRQn Enable (n = 7 to 0) Rev. 2.00 Aug.
Section 5 Interrupt Controller 5.3.6 IRQ Status Registers (ISR16, ISR) The ISR registers are flag registers that indicate the status of IRQ15 to IRQ0 interrupt requests.
Section 5 Interrupt Controller 5.4 Interrupt Sources 5.4.1 External Interrupts There are four external interrupts: NMI, IRQ15 to IRQ0. These interrupts can be used to restore this LSI from software standby mode. NMI Interrupt: NMI is the highest-priority interrupt, and is always accepted by the CPU regardless of the interrupt control mode or the status of the CPU interrupt mask bits.
Section 5 Interrupt Controller IRQnE IRQnSCA, IRQnSCB IRQnF Edge/level detection circuit S Q IRQn interrupt request R IRQn input or ExIRQn* input Clear signal n = 15 to 0 Figure 5.2 Block Diagram of Interrupts IRQ15 to IRQ0 5.4.
Section 5 Interrupt Controller 5.5 Interrupt Exception Handling Vector Table Table 5.3 lists interrupt exception handling sources, vector addresses, and interrupt priorities. For default priorities, the lower the vector number, the higher the priority. Modules set at the same priority will conform to their default priorities. Priorities within a module are fixed. An interrupt control level can be specified for a module to which an ICR bit is assigned.
Section 5 Interrupt Controller Origin of Interrupt Source Name Vector Address Vector Number Advanced Mode IRQ8 IRQ9 IRQ10 IRQ11 56 57 58 59 IRQ12 IRQ13 IRQ14 IRQ15 TMR_0 ICR Priority H'0000E0 H'0000E4 H'0000E8 H'0000EC ICRD7 High 60 61 62 63 H'0000F0 H'0000F4 H'0000F8 H'0000FC ICRD6 CMIA0 (Compare match A) CMIB0 (Compare match B) OVI0 (Overflow) 64 65 66 H'000100 H'000104 H'000108 ICRB3 TMR_1 CMIA1 (Compare match A) CMIB1 (Compare match B) OVI1 (Overflow) 68 69 70 H'000110 H'000114 H'00
Section 5 Interrupt Controller Origin of Interrupt Source Name Vector Address Vector Number Advanced Mode PEWFCSEI PERFCSEI PETEI 108 109 110 USB*1 (only in RESUME the H8S/2472) USBINT0 USBINT2 USBINT3 USBINT1 EtherC PECI* 2 EINT ICR Priority H'0001B0 H'0001B4 H'0001B8 ICRD2 High 114 115 116 117 118 H'0001C8 H'0001CC H'0001D0 H'0001D4 H'0001D8 ICRC0 119 H'0001DC ICRD5 Notes: 1. Supported only by the H8S/2472 Group. 2. Supported only by the H8S/2472 Group and the H8S/2462 Group. Rev. 2.
Section 5 Interrupt Controller 5.6 Interrupt Control Modes and Interrupt Operation The interrupt controller has two modes: Interrupt control mode 0 and interrupt control mode 1. Interrupt operations differ depending on the interrupt control mode. NMI interrupts and address break interrupts are always accepted except for in reset state or in hardware standby mode. The interrupt control mode is selected by SYSCR. Table 5.4 shows the interrupt control modes. Table 5.
Section 5 Interrupt Controller Interrupt Acceptance Control and 3-Level Control: In interrupt control modes 0 and 1, interrupt acceptance control and 3-level mask control is performed by means of the I and UI bits in CCR and ICR (control level). Table 5.5 shows the interrupts selected in each interrupt control mode. Table 5.
Section 5 Interrupt Controller Table 5.6 Operations and Control Signal Functions in Each Interrupt Control Mode Interrupt Control Mode INTM1 INTM0 0 0 0 1 1 Interrupt Acceptance Control 3-Level Control Setting I UI ICR Default Priority Determination T (Trace) O IM PR O O IM IM PR O [Legend] O: Interrupt operation control performed IM: Used as an interrupt mask bit PR: Sets priority : Not used 5.6.
Section 5 Interrupt Controller 7. The CPU generates a vector address for the accepted interrupt and starts execution of the interrupt handling routine at the address indicated by the contents of the vector address in the vector table.
Section 5 Interrupt Controller 5.6.2 Interrupt Control Mode 1 In interrupt control mode 1, mask control is applied to three levels for IRQ and on-chip peripheral module interrupt requests by comparing the I and UI bits in CCR in the CPU, and the ICR setting. • An interrupt request with interrupt control level 0 is accepted when the I bit in CCR is cleared to 0. When the I bit is set to 1, the interrupt request is held pending. EVENTI, KIN, and WUE interrupts are enabled or disabled by the I bit.
Section 5 Interrupt Controller Figure 5.6 shows a flowchart of the interrupt acceptance operation. 1. If an interrupt source occurs when the corresponding interrupt enable bit is set to 1, an interrupt request is sent to the interrupt controller. 2. According to the interrupt control level specified in ICR, the interrupt controller only accepts an interrupt request with interrupt control level 1 (priority), and holds pending an interrupt request with interrupt control level 0 (no priority).
Section 5 Interrupt Controller Program execution state No Interrupt generated? Yes Yes NMI No No An interrupt with interrupt control level 1? Pending Yes IRQ0 Yes No No IRQ0 No Yes IRQ1 No IRQ1 Yes Yes EINT EINT Yes Yes I=0 No I=0 Yes No UI = 0 No Yes Yes Save PC and CCR I 1, UI 1 Read vector address Branch to interrupt handling routine Figure 5.6 Flowchart of Procedure Up to Interrupt Acceptance in Interrupt Control Mode 1 Rev. 2.00 Aug.
REJ09B0403-0200 Rev. 2.00 Aug. 20, 2008 Page 100 of 1198 Figure 5.7 Interrupt Exception Handling (2) (4) (3) (5) (7) (1) Internal data bus (1) (2) (4) (3) Instruction prefetch address (Instruction is not executed. Address is saved as PC contents, becoming return address.) Instruction code (not executed) Instruction prefetch address (Instruction is not executed.
Section 5 Interrupt Controller 5.6.4 Interrupt Response Times Table 5.7 shows interrupt response times − the intervals between generation of an interrupt request and execution of the first instruction in the interrupt handling routine. The execution status symbols used in table 5.7 are explained in table 5.8. Table 5.7 No.
Section 5 Interrupt Controller 5.6.5 DTC Activation by Interrupt The DTC can be activated by an interrupt. In this case, the following options are available: • Interrupt request to CPU • Activation request to DTC • Both of the above For details of interrupt requests that can be used to activate the DTC, see section 7, Data Transfer Controller (DTC). Figure 5.8 shows a block diagram of the DTC and interrupt controller.
Section 5 Interrupt Controller (2) Determination of Priority The DTC activation source is selected in accordance with the default priority order, and is not affected by mask or priority levels. See section 7.5, Location of Register Information and DTC Vector Table, for the respective priorities. (3) Operation Order If the same interrupt is selected as a DTC activation source and a CPU interrupt source, the DTC data transfer is performed first, followed by CPU interrupt exception handling. Table 5.
Section 5 Interrupt Controller 5.7 Usage Notes 5.7.1 Conflict between Interrupt Generation and Disabling When an interrupt enable bit is cleared to 0 to disable interrupt requests, the disabling becomes effective after execution of the instruction.
Section 5 Interrupt Controller 5.7.2 Instructions that Disable Interrupts The instructions that disable interrupts are LDC, ANDC, ORC, and XORC. After any of these instructions are executed, all interrupts including NMI are disabled and the next instruction is always executed. When the I bit or UI bit is set by one of these instructions, the new value becomes valid two states after execution of the instruction ends. 5.7.
Section 5 Interrupt Controller Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) Section 6 Bus Controller (BSC) This LSI has an on-chip bus controller (BSC) that manages the bus width and the number of access states of the external address space. The BSC also has a bus arbitration function, and controls the operation of the internal bus masters – CPU, data transfer controller (DTC), and Ethernet controller direct memory access controller (E-DMAC). 6.
Section 6 Bus Controller (BSC) • Multiplex bus interface No Wait Inserted Wait Inserted Address Data Address Data 2 states* 2 states 2 states* (3 + wait) states IOS extended area 2 states* 2 states 2 states* (3 + wait) states 256-Kbyte extended area Note: * A wait cycle is inserted by the setting of the WC22 bit. • Basic bus interface 2-state access or 3-state access can be selected for each area. Program wait states can be inserted for each area.
Section 6 Bus Controller (BSC) Bus controller External bus control signals Internal control signals BCR BCR2 WSCR WSCR2 Internal data bus Bus mode signal Wait controller WAIT Bus arbiter CPU bus request signal DTC bus request signal E-DMAC bus request signal CPU bus acknowledge signal DTC bus acknowledge signal E-DMAC bus acknowledge signal [Legend] BCR: BCR2: WSCR: WSCR2: Bus control register Bus control register 2 Wait state control register Wait state control register 2 Figure 6.
Section 6 Bus Controller (BSC) 6.2 Input/Output Pins Table 6.1 summarizes the pin configuration of the bus controller. Table 6.1 Pin Configuration Symbol I/O Function AS Output Strobe signal indicating that address output on the address bus is enabled (when the IOSE bit in SYSCR is cleared to 0). Note that this signal is not output when the 256-Kbyte extended area is accessed (the CS256E bit in SYSCR is 1).
Section 6 Bus Controller (BSC) 6.3 Register Descriptions The following registers are provided for the bus controller. For the system control register (SYSCR), see section 3.2.2, System Control Register (SYSCR). For port control register 0 (PTCNT0), see section 8.3.2, Port Control Register 0 (PTCNT0). • Bus control register (BCR) • Bus control register 2 (BCR2) • Wait state control register (WSCR) • Wait state control register 2 (WSCR2) • System control register 2 (SYSCR2) 6.3.
Section 6 Bus Controller (BSC) Bit Bit Name Initial Value R/W Description 4 BRSTS1 1 R/W Valid only in the normal extended mode. Burst Cycle Select 1 Selects the number of states in the burst cycle of the burst ROM interface. 0: 1 state 1: 2 states 3 BRSTS0 0 R/W Valid only in the normal extended mode. Burst Cycle Select 0 Selects the number of words that can be accessed by burst access via the burst ROM interface.
Section 6 Bus Controller (BSC) 6.3.2 Bus Control Register 2 (BCR2) BCR2 is used to specify the access mode for the extended area. Bit Bit Name Initial Value R/W 7, 6 All 0 R/W Description Reserved The initial value should not be changed. 5, 4 All 1 R/W Reserved The initial value should not be changed. 3 ADFULLE 0 R/W Address Output Full Enable Controls the address output, A23 to A21, in access to the extended area. See section 8, I/O Ports. This is not supported while ADMXE = 1.
Section 6 Bus Controller (BSC) 6.3.3 Wait State Control Register (WSCR) WSCR is used to specify the data bus width, the number of access states, the wait mode, and the number of wait states for access to external address spaces (basic extended area and 256-Kbyte extended area). The bus width and the number of access states for internal memory and internal I/O registers are fixed regardless of the WSCR settings.
Section 6 Bus Controller (BSC) Bit Bit Name Initial Value R/W Description 4 AST 1 R/W Basic Extended Area Access State Control Selects the number of states for access to the basic extended area. This bit also enables or disables wait-state insertion. [ADMXE = 0] Normal extension 0: 2-state access space. Wait state insertion disabled 1: 3-state access space. Wait state insertion enabled [ADMXE = 1] Address-data multiplex extension 0: 2-state data access space.
Section 6 Bus Controller (BSC) 6.3.4 Wait State Control Register 2 (WSCR2) WSCR2 is used to specify the wait mode and number of wait states in access to the 256-Kbyte extended area. Bit Bit Name Initial Value R/W Description 7 WMS10 0 R/W 256-Kbyte Extended Area Wait Mode Select 0 Selects the wait mode for access to the 256-Kbyte extended area when the CS256E bit in SYSCR and the AST256 bit in WSCR are set to 1.
Section 6 Bus Controller (BSC) • When ADMXE = 0 Bit Bit Name Initial Value R/W Description 2 to 0 All 1 R/W Reserved • When ADMXE = 1 Bit Bit Name Initial Value R/W Description 2 WC22 1 R/W Address-Data Multiplex Extended Area Address Cycle Wait Count 2 Selects the number of program wait states to be inserted into the address cycle for access to the address-data multiplex extended area.
Section 6 Bus Controller (BSC) 6.4 Bus Control 6.4.1 Bus Specifications The external address space bus specifications consist of three elements: bus width, the number of access states, and the wait mode and the number of program wait states. The bus width and the number of access states for on-chip memory and internal I/O registers are fixed, and are not affected by the bus controller settings.
Section 6 Bus Controller (BSC) (d) Glueless Extension Setting the OBE bit in PTCNT0 selects glueless extension, which uses the RD, WR, HBE, and LBE signals to allow connection to the external space without adding an external circuit. Table 6.2 Address Ranges and External Address Spaces Area Address Range H'080000 to H'F7FFFF (15 Mbytes) H'F80000 to H'FBFFFF (256 Kbytes) Basic Extended Area 256-Kbyte Extended Area : No condition ∆: When CS256E = 0, used as basic extended area.
Section 6 Bus Controller (BSC) Table 6.
Section 6 Bus Controller (BSC) Table 6.5 Bus Specifications for 256-Kbyte Extended Area/Basic Bus Interface Bus Specifications Number of Program Wait States ABW256 AST256 WMS10 WC11 WC10 Bus Width Number of Access States 0 0 X X X 16 2 0 1 1 X X 16 3 0 0 0 0 3 0 1 1 1 1 0 2 1 3 0 X X X 8 2 0 1 1 X X 8 3 0 0 0 0 3 0 1 1 1 0 2 1 3 [Legend] X: Don't care Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) (2) In Address-Data Multiplex Extended Mode (a) Bus Width A bus width of 8 or 16 bits can be selected via the ABW and ABW256 bits in WSCR. (b) Number of Access States Two or three states can be selected for data access via the AST and AST256 bits in WSCR. When the 2-state access space is designated, wait-state insertion is disabled.
Section 6 Bus Controller (BSC) Table 6.6 Address-Data Multiplex Address Spaces Address Range Address-Data Multiplex Area H'080000 to H'F7FFFF (15 Mbytes) No condition 256-Kbyte extended area H'F80000 to H'F8FFFF O When the WAIT pin function is not selected and CS256E = 1, CS256 is output and address AD15 to AD0 or AD7 to AD0 are used.
Section 6 Bus Controller (BSC) Table 6.7 Bit Settings and Bus Specifications of Basic Bus Interface Area IOSE CS256E IOS Extended Area 256-Kbyte Extended Area 1 0 ABW, AST, WMS1, WMS0, WC1, WC0 1 0 0 ABW256, AST256, WMS10, WC11, WC10 1 Table 6.8 ABW256, AST256, WMS10, WC11, WC10 Bus Specifications for IOS Extended Area/Multiplex Bus Interface (Address Cycle) AST WMS1 WMS0 WC22 WC1 WC0 Number of Access States 0 2 1 Table 6.
Section 6 Bus Controller (BSC) Table 6.10 Bus Specifications for 256-Kbyte Extended Area/Multiplex Bus Interface (Address Cycle) AST256 WMS10 WC22 WC11 WC10 Number of Access States 0 2 1 Number of Program Wait States 0 1 Table 6.11 Bus Specifications for 256-Kbyte Extended Area/Multiplex Bus Interface (Data Cycle) AST256 WMS1 WC1 WC0 Number of Program Wait Number of Access States States 0 2 0 1 1 3 0 0 0 0 3 0 1 1 1 0 2 1 3 6.4.
Section 6 Bus Controller (BSC) 6.4.3 I/O Select Signals The LSI can output I/O select signals (IOS); the signal is driven low when the corresponding external address space is accessed. Figure 6.2 shows an example of IOS signal output timing. Bus cycle T1 T2 T3 φ Address bus External addresses selected by IOS IOS Figure 6.2 IOS Signal Output Timing Enabling or disabling IOS signal output is performed by the IOSE bit in SYSCR. In the extended mode, the IOS pin functions as an AS pin by a reset.
Section 6 Bus Controller (BSC) 6.5 Bus Interface The normal extended bus interface enables direct connection to ROM and SRAM. For details on selection of the bus specifications for the basic extended area and 256-Kbyte extended area, see table 6.5. The address-data multiplex extended bus interface enables direct connection to products that supports this bus interface. For details on selection of the bus specifications for the IOS extended area and 256-Kbyte extended area, see tables 6.8 to 6.11. 6.5.
Section 6 Bus Controller (BSC) (2) 16-Bit Access Space Figure 6.4 illustrates data alignment control for the 16-bit access space. With the 16-bit access space, the upper data bus (D15 to D8/AD15 to AD8) and lower data bus (D7 to D0/AD7 to AD0) are used for accesses. The amount of data that can be accessed at one time is one byte or one word, and a longword access is executed as two word accesses.
Section 6 Bus Controller (BSC) 6.5.2 Valid Strobes Table 6.13 shows the data buses used and valid strobes for each access space. In a read, the RD signal is valid for both the upper and lower halves of the data bus. In a write, the HWR signal is valid for the upper half of the data bus, and the LWR signal for the lower half. Table 6.
Section 6 Bus Controller (BSC) 6.5.3 Valid Strobes (in Glueless Extension) Table 6.14 shows the data buses used and valid strobes for each access space. The RD and WR signals are valid for both the upper and lower halves of the data bus. In a write, the HBE signal is valid for the upper half of the data bus, and the LBE signal for the lower half. Table 6.
Section 6 Bus Controller (BSC) 6.5.4 (1) Basic Operation Timing in Normal Extended Mode 8-Bit, 2-State Access Space Figure 6.5 shows the bus timing for an 8-bit, 2-state access space. When an 8-bit access space is accessed, the upper half (D15 to D8) of the data bus is used. Wait states cannot be inserted.
Section 6 Bus Controller (BSC) (2) 8-Bit, 3-State Access Space Figure 6.6 shows the bus timing for an 8-bit, 3-state access space. When an 8-bit access space is accessed, the upper half (D15 to D8) of the data bus is used. Wait states can be inserted.
Section 6 Bus Controller (BSC) (3) 16-Bit, 2-State Access Space Figures 6.7 to 6.9 show bus timings for a 16-bit, 2-state access space. When a 16-bit access space is accessed, the upper half (D15 to D8) of the data bus is used for even addresses, and the lower half (D7 to D0) for odd addresses. Wait states cannot be inserted.
Section 6 Bus Controller (BSC) Bus cycle T1 T2 φ Address bus IOS (IOSE = 1) CS256 (CS256E = 1) AS* (IOSE = 0) RD Read D15 to D8 Invalid D7 to D0 Valid HWR High level LWR Write D15 to D8 Undefined D7 to D0 Valid Note: * For external address space access, this signal is not output when the 256-Kbyte extended area is accessed with CS256E = 1. Figure 6.8 Bus Timing for 16-Bit, 2-State Access Space (Odd Byte Access) Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) Bus cycle T1 T2 φ Address bus IOS (IOSE = 1) CS256 (CS256E = 1) AS * (IOSE = 0) RD Read D15 to D8 Valid D7 to D0 Valid HWR LWR Write D15 to D8 Valid D7 to D0 Valid Note: * For external address space access, this signal is not output when the 256-Kbyte extended area is accessed with CS256E = 1. Figure 6.9 Bus Timing for 16-Bit, 2-State Access Space (Word Access) Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) (4) 16-Bit, 3-State Access Space Figures 6.10 to 6.12 show bus timings for a 16-bit, 3-state access space. When a 16-bit access space is accessed, the upper half (D15 to D8) of the data bus is used for even addresses, and the lower half (D7 to D0) for odd addresses. Wait states can be inserted.
Section 6 Bus Controller (BSC) Bus cycle T1 T2 T3 φ Address bus IOS (IOSE = 1) CS256 (CS256E = 1) AS* (IOSE = 0) RD Read D15 to D8 Invalid D7 to D0 Valid HWR High level LWR Write D15 to D8 Undefined D7 to D0 Valid Note: * For external address space access, this signal is not output when the 256-Kbyte extended area is accessed with CS256E = 1. Figure 6.11 Bus Timing for 16-Bit, 3-State Access Space (Odd Byte Access) Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) Bus cycle T1 T2 T3 φ Address bus IOS (IOSE = 1) CS256 (CS256E = 1) AS* (IOSE = 0) RD Read D15 to D8 Valid D7 to D0 Valid HWR LWR Write D15 to D8 Valid D7 to D0 Valid Note: * For external address space access, this signal is not output when the 256-Kbyte extended area is accessed with CS256E = 1. Figure 6.12 Bus Timing for 16-Bit, 3-State Access Space (Word Access) Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) Bus cycle φ Address bus (A23 to A0) Even CS IOS (IOSE = 1) CS256 (CS256E = 1) AS* HBE LBE High level RD Read D15 to D8 Valid D7 to D0 Invalid WR Write D15 to D8 Valid D7 to D0 Undefined Note: * For external address space access, this signal is not output when the 256-Kbyte extended area is accessed with CS256E = 1. Figure 6.13 Glueless Extension Even Byte Access (ADMXE = 0) Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) Bus cycle φ Address bus (A23 to A0) Odd CS IOS (IOSE = 1) CS256 (CS256E = 1) AS* HBE High level LBE RD Read D15 to D8 Invalid D7 to D0 Valid WR Write D15 to D8 D7 to D0 Undefined Valid Note: * For external address space access, this signal is not output when the 256-Kbyte extended area is accessed with CS256E = 1. Figure 6.14 Glueless Extension Odd Byte Access (ADMXE = 0) Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) Bus cycle φ Address bus (A23 to A0) Even CS IOS (IOSE = 1) CS256 (CS256E = 1) AS* HBE LBE RD Read D15 to D8 valid D7 to D0 valid WR Write Note: D15 to D8 Valid D7 to D0 Valid * For external address space access, this signal is not output when the 256-Kbyte extended area is accessed with CS256E = 1. Figure 6.15 Glueless Extension Word Access (ADMXE = 0) Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) 6.5.5 (1) Basic Operation Timing in Address-Data Multiplex Extended Mode 8-Bit, 2-State Data Access Space Figures 6.16 and 6.17 show the bus timing for an 8-bit, 2-state access space. When an 8-bit access space is accessed, the lower half (AD7 to AD0) of the data bus is used. Wait states cannot be inserted. Read Cycle Write Cycle Address T1 TAW Data T2 T3 Address T4 T1 TAW Data T2 T3 T4 φ CS256 IOS AH RD HWR AD7 to AD0 Address Data Address Data Figure 6.
Section 6 Bus Controller (BSC) Read Cycle Address T1 Write Cycle Data T2 T3 Address T4 T1 Data T2 T3 T4 φ CS256 IOS AH RD HWR AD7 to AD0 Data Address Data Address Figure 6.17 Bus Timing for 8-Bit, 2-State Access Space (2) 8-Bit, 3-State Data Access Space Figure 6.18 shows the bus timing for an 8-bit, 3-state access space. When an 8-bit access space is accessed, the lower half (AD7 to AD0) of the data bus is used. Wait states can be inserted.
Section 6 Bus Controller (BSC) (3) 16-Bit, 2-State Data Access Space Figures 6.19 to 6.24 show bus timings for a 16-bit, 2-state access space. When a 16-bit access space is accessed, the upper half (AD15 to AD8) of the data bus is used for even addresses, and the lower half (AD7 to AD0) for odd addresses. Wait states cannot be inserted.
Section 6 Bus Controller (BSC) Write Cycle Read Cycle Address T1 Data T2 T3 Address T4 T1 Data T2 T3 T4 φ CS256 IOS AH RD HWR LWR AD15 to AD8 Address AD7 to AD0 Address Data Data Address Address Figure 6.20 Bus Timing for 16-Bit, 2-State Access Space (2) (Even Byte Access) Write Cycle Read Cycle Address T1 TAW Data T2 T3 Data Address T4 T1 TAW T2 T3 T4 φ CS256 IOS AH RD HWR LWR AD15 to AD8 Address AD7 to AD0 Address Address Data Address Data Figure 6.
Section 6 Bus Controller (BSC) Write Cycle Read Cycle Data Address T1 T2 T3 Address T4 T1 T2 Data T3 T4 φ CK2S CS256 IOS AH RD HWR LWR AD15 to AD8 Address AD7 to AD0 Address Address Data Address Data Figure 6.22 Bus Timing for 16-Bit, 2-State Access Space (4) (Odd Byte Access) Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) Write Cycle Read Cycle Address T1 TAW Data T2 T3 Data Address T4 T1 TAW T2 T3 T4 φ CS256 IOS AH RD HWR LWR AD15 to AD8 Address Data Address Data AD7 to AD0 Address Data Address Data Figure 6.
Section 6 Bus Controller (BSC) (4) 16-Bit, 3-State Data Access Space Figures 6.25 to 6.27 show bus timings for a 16-bit, 3-state access space. When a 16-bit access space is accessed, the upper half (AD15 to AD8) of the data bus is used for even addresses, and the lower half (AD7 to AD0) for odd addresses. Wait states can be inserted.
Section 6 Bus Controller (BSC) Write Cycle Read Cycle Address T1 TAW Address Data T2 T3 T4 TDSW T5 T1 Data TAW T2 T3 T4 TDSW T5 φ CS256 IOS AH RD HWR LWR AD15 to AD8 Address AD7 to AD0 Address Address Data Data Address Figure 6.
Section 6 Bus Controller (BSC) 6.5.6 Wait Control When accessing the external address space, this LSI can extend the bus cycle by inserting one or more wait states (TW). There are three ways of inserting wait states: Program wait insertion, pin wait insertion using the WAIT pin, and the combination of program wait and the WAIT pin.
Section 6 Bus Controller (BSC) By program wait T1 T2 TW By WAIT pin TW TW T3 φ WAIT Address bus IOS (IOSE = 1) AS * (IOSE = 0) RD Read Data bus Read data WR Write Data bus Write data Note: ↓ shown in φ clock indicates the WAIT pin sampling timing. * For external address space access, this signal is not output when the 256-kbyte extended area is accessed with CS256E = 1. Figure 6.28 Example of Wait State Insertion Timing (Pin Wait Mode) Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) (2) In Address-Data Multiplex Extended Mode (a) Program Wait Mode Program wait mode includes address wait and data wait. • 256-Kbyte extended area and IOS extended area Zero or one state of address wait TAW is inserted between T1 and T2 states. Zero to three states of data wait TDSW is inserted between T4 and T5 states.
Section 6 Bus Controller (BSC) Write Cycle Read Cycle Data T3 T4 TDSW TDOW TDOW Data T5 T3 T4 TDSW TDOW TDOW T5 φ CS256 IOS WAIT AH RD HWR LWR AD15 to AD8 Data Data AD7 to AD0 Data Data Figure 6.29 Example of Wait State Insertion Timing Rev. 2.00 Aug.
Section 6 Bus Controller (BSC) 6.6 Burst ROM Interface In this LSI, the external address space can be designated as the burst ROM space by the BRSTRM bit in BCR, and the burst ROM interface enabled. Consecutive burst accesses of a maximum four or eight words can be performed only during CPU instruction fetch. 1 or 2 states can be selected for burst ROM access. 6.6.
Section 6 Bus Controller (BSC) Full access T1 T2 Burst access T1 T1 φ Only lower address changes Address bus AS/IOS (IOSE = 0) RD Data bus Read data Read data Read data Figure 6.31 Access Timing Example in Burst ROM Space (AST = BRSTS1 = 0) 6.6.2 Wait Control As with the basic bus interface, program wait insertion or pin wait insertion using the WAIT pin is possible in the initial cycle (full access) of the burst ROM interface. For details, see section 6.5.6, Wait Control.
Section 6 Bus Controller (BSC) 6.7 Idle Cycle When this LSI accesses the external address space, it can insert a 1-state idle cycle (TI) between bus cycles when a write cycle occurs immediately after a read cycle. By inserting an idle cycle it is possible, for example, to avoid data collisions between ROM with a long output floating time, and high-speed memory and I/O interfaces.
Section 6 Bus Controller (BSC) Table 6.15 shows the pin states in an idle cycle. Table 6.15 Pin States in Idle Cycle Pins Pin State A23 to A0 Contents of immediately following bus cycle D15 to D0 High impedance AS, IOS, CS256 High RD High HWR, LWR High 6.8 Bus Arbitration 6.8.1 Overview The BSC has a bus arbiter that arbitrates bus master operations. There are three bus masters – the CPU, DTC, and E-DMAC – that perform read/write operations while they have bus mastership. 6.8.
Section 6 Bus Controller (BSC) 6.8.3 Bus Mastership Transfer Timing When a bus request is received from a bus master with a higher priority than that of the bus master that has acquired the bus mastership and is currently operating, the bus mastership is not necessarily transferred immediately. Each bus master can relinquish the bus mastership at the timings given below.
Section 6 Bus Controller (BSC) (2) DTC The DTC sends the bus arbiter a request for the bus mastership when a request for DTC activation occurs. The DTC releases the bus mastership after a series of processes has completed. The DTC is the lower-priority bus master than the E-DMAC, and if a bus mastership request is received from the E-DMAC, the bus arbiter transfers the bus mastership to the E-DMAC.
Section 6 Bus Controller (BSC) Rev. 2.00 Aug.
Section 7 Data Transfer Controller (DTC) Section 7 Data Transfer Controller (DTC) This LSI includes a data transfer controller (DTC). The DTC can be activated by an interrupt or software, to transfer data. Figure 7.1 shows a block diagram of the DTC. The DTC's register information is stored in the onchip RAM. When the DTC is used, the RAME bit in SYSCR must be set to 1.
Section 7 Data Transfer Controller (DTC) Internal address bus CPU interrupt request [Legend] MRA, MRB: CRA, CRB: SAR: DAR: DTCERA to DTCERF: DTVECR: Internal data bus DTC mode register A, B DTC transfer count register A, B DTC source address register DTC destination address register DTC enable registers A to F DTC vector register Figure 7.1 Block Diagram of DTC Rev. 2.00 Aug.
Section 7 Data Transfer Controller (DTC) 7.2 Register Descriptions The DTC has the following registers. • DTC mode register A (MRA) • DTC mode register B (MRB) • DTC source address register (SAR) • DTC destination address register (DAR) • DTC transfer count register A (CRA) • DTC transfer count register B (CRB) These six registers cannot be directly accessed from the CPU.
Section 7 Data Transfer Controller (DTC) 7.2.1 DTC Mode Register A (MRA) MRA selects the DTC operating mode. Bit Bit Name Initial Value R/W 7 SM1 Undefined 6 SM0 Description Source Address Mode 1 and 0 These bits specify an SAR operation after a data transfer.
Section 7 Data Transfer Controller (DTC) 7.2.2 DTC Mode Register B (MRB) MRB selects the DTC operating mode. Bit Bit Name Initial Value R/W 7 CHNE Undefined Description DTC Chain Transfer Enable When this bit is set to 1, a chain transfer will be performed. For details, see section 7.6.4, Chain Transfer. In data transfer with CHNE set to 1, determination of the end of the specified number of data transfers, clearing of the interrupt source flag, and clearing of DTCER are not performed.
Section 7 Data Transfer Controller (DTC) 7.2.5 DTC Transfer Count Register A (CRA) CRA is a 16-bit register that designates the number of times data is to be transferred by the DTC. In normal mode, the entire CRA functions as a 16-bit transfer counter (1 to 65536). It is decremented by 1 every time data is transferred, and transfer ends when the count reaches H'0000. In repeat mode or block transfer mode, the CRA is divided into two parts; the upper eight bits (CRAH) and the lower 8 bits (CRAL).
Section 7 Data Transfer Controller (DTC) Table 7.
Section 7 Data Transfer Controller (DTC) Initial Value Bit Bit Name 6 to 0 DTVEC6 to All 0 DTVEC0 R/W Description R/W DTC Software Activation Vectors 6 to 0 These bits specify a vector number for DTC software activation. The vector address is expressed as H'0400 + (vector number × 2). For example, when DTVEC6 to DTVEC0 = H'10, the vector address is H'0420. When the SWDTE bit is 0, these bits can be written to. 7.2.
Section 7 Data Transfer Controller (DTC) 7.2.10 Event Counter Control Register (ECCR) ECCR selects the event counter channels for use and the detection edge. Bit Bit Name Initial Value R/W 7 EDSB 0 R/W Description Event Counter Edge Select Selects the detection edge for the event counter. 0: Counts the rising edges 1: Counts the falling edges 6 to 4 All 0 R Reserved These bits are always read as 0 and cannot be modified.
Section 7 Data Transfer Controller (DTC) 7.2.11 Event Counter Status Register (ECS) ECS is a 16-bit register that holds events temporarily. The DTC decides the counter to be incremented according to the state of this register. Reading this register allows the monitoring of events that are not yet counted by the event counter. Access in 8-bit unit is not allowed.
Section 7 Data Transfer Controller (DTC) 7.3 DTC Event Counter To count events of EVENT 0 to EVENT15 by the DTC event counter function, set DTC as below. Table 7.2 DTC Event Counter Conditions Register Bit Bit Name MRA 7, 6 SM1, SM0 00: SAR is fixed. 5, 4 DM1, DM0 00: DAR is fixed.
Section 7 Data Transfer Controller (DTC) The EVENTI interrupt request activates the DTC and transfers data from RAM to RAM in the same address. Data is incremented in the DTC. The lower five bits of SAR and DAR are replaced with address code that is generated by the ECS flag status. When the DTC transfer is completed, the ECS flag for transfer is cleared. Table 7.
Section 7 Data Transfer Controller (DTC) 7.3.1 Event Counter Handling Priority EVENT0 to EVENT15 count handling is operated in the priority shown as below. High Low EVENT0 > EVENT1 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ EVENT14 > EVENT15 7.3.2 Usage Notes There are following usage notes for this event counter because it uses the DTC. 1. Continuous events that are input from the same pin and out of DTC handling are ignored because the count up is operated by means of the DTC. 2.
Section 7 Data Transfer Controller (DTC) 7.4 Activation Sources The DTC is activated by an interrupt request or by a write to DTVECR by software. The interrupt request source to activate the DTC is selected by DTCER. At the end of a data transfer (or the last consecutive transfer in the case of chain transfer), the interrupt flag that became the activation source or the corresponding DTCER bit is cleared. The activation source flag, in the case of RXI0, for example, is the RDRF flag in SCI_0.
Section 7 Data Transfer Controller (DTC) 7.5 Location of Register Information and DTC Vector Table Locate the register information in the on-chip RAM (addresses: H'FFEC00 to H'FFEFFF). Register information should be located at an address that is a multiple of four within the range. The method for locating the register information in address space is shown in figure 7.3. Locate MRA, SAR, MRB, DAR, CRA, and CRB, in that order, from the start address of the register information.
Section 7 Data Transfer Controller (DTC) Table 7.
Section 7 Data Transfer Controller (DTC) 7.6 Operation The DTC stores register information in on-chip RAM. When activated, the DTC reads register information in on-chip RAM and transfers data. After the data transfer, the DTC writes updated register information back to on-chip RAM. The pre-storage of register information in memory makes it possible to transfer data over any required number of channels. The transfer mode can be specified as normal, repeat, or block transfer mode.
Section 7 Data Transfer Controller (DTC) 7.6.1 Normal Mode In normal mode, one activation source transfers one byte or one word of data. Table 7.5 lists the register functions in normal mode. From 1 to 65,536 transfers can be specified. Once the specified number of transfers has been completed, a CPU interrupt can be requested. Table 7.
Section 7 Data Transfer Controller (DTC) 7.6.2 Repeat Mode In repeat mode, one activation source transfers one byte or one word of data. Table 7.6 lists the register functions in repeat mode. From 1 to 256 transfers can be specified. Once the specified number of transfers has been completed, the initial states of the transfer counter and the address register that is specified as the repeat area is restored, and transfer is repeated.
Section 7 Data Transfer Controller (DTC) 7.6.3 Block Transfer Mode In block transfer mode, one activation source transfers one block of data. Either the transfer source or the transfer destination is designated as a block area. Table 7.7 lists the register functions in block transfer mode. The block size can be between 1 and 256. When the transfer of one block ends, the initial state of the block size counter and the address register that is specified as the block area is restored.
Section 7 Data Transfer Controller (DTC) 7.6.4 Chain Transfer Setting the CHNE bit in MRB to 1 enables a number of data transfers to be performed consecutively in response to a single transfer request. SAR, DAR, CRA, CRB, MRA, and MRB, which define data transfers, can be set independently. Figure 7.8 shows the overview of chain transfer operation.
Section 7 Data Transfer Controller (DTC) 7.6.5 Interrupt Sources An interrupt request is issued to the CPU when the DTC has completed the specified number of data transfers, or a data transfer for which the DISEL bit was set to 1. In the case of interrupt activation, the interrupt set as the activation source is generated. These interrupts to the CPU are subject to CPU mask level and priority level control by the interrupt controller.
Section 7 Data Transfer Controller (DTC) φ DTC activation request DTC request Data transfer Vector read Address Read Write Read Write Transfer information read Transfer information write Figure 7.
Section 7 Data Transfer Controller (DTC) 7.6.7 Number of DTC Execution States Table 7.8 lists the execution status for a single DTC data transfer, and table 7.9 shows the number of states required for each execution status. Table 7.8 DTC Execution Status Mode Register Information Vector Read Read/Write I J Data Read K Data Write L Internal Operations M Normal 1 6 1 1 3 Repeat 1 6 1 1 3 Block transfer 1 6 N N 3 [Legend] N: Block size (initial setting of CRAH and CRAL) Table 7.
Section 7 Data Transfer Controller (DTC) The number of execution states is calculated from using the formula below. Note that Σ is the sum of all transfers activated by one activation source (the number in which the CHNE bit is set to 1, plus 1).
Section 7 Data Transfer Controller (DTC) 7.8 Examples of Use of the DTC 7.8.1 Normal Mode An example is shown in which the DTC is used to receive 128 bytes of data via the SCI. 1. Set MRA to a fixed source address (SM1 = SM0 = 0), incrementing destination address (DM1 = 1, DM0 = 0), normal mode (MD1 = MD0 = 0), and byte size (Sz = 0). The DTS bit can have any value. Set MRB for one data transfer by one interrupt (CHNE = 0, DISEL = 0).
Section 7 Data Transfer Controller (DTC) 7.8.2 Software Activation An example is shown in which the DTC is used to transfer a block of 128 bytes of data by means of software activation. The transfer source address is H'1000 and the transfer destination address is H'2000. The vector number is H'60, so the vector address is H'04C0. 1.
Section 7 Data Transfer Controller (DTC) 7.9 Usage Notes 7.9.1 Module Stop Mode Setting DTC operation can be enabled or disabled by the module stop control register (MSTPCR). In the initial state, DTC operation is enabled. Access to DTC registers is disabled when module stop mode is set. Note that when the DTC is being activated, module stop mode cannot be specified. For details, refer to section 28, Power-Down Modes. 7.9.2 On-Chip RAM MRA, MRB, SAR, DAR, CRA, and CRB are all located in on-chip RAM.
Section 8 I/O Ports Section 8 I/O Ports 8.1 I/O Ports for the H8S/2472 Group Table 8.1 is a summary of the port functions. The pins of each port also function as input/output pins of peripheral modules and interrupt input pins. Each input/output port includes a data direction register (DDR) that controls input/output and a data register (DR) that stores output data. DDR and DR are not provided for input-only ports.
Section 8 I/O Ports Table 8.
Section 8 I/O Ports Single-Chip Mode (EXPE = 0) Extended Mode (EXPE = 1) General I/O port multiplexed with interrupt input, bus control output, system clock output, SSU I/O, and external subclock input P57 WR/HWR P56/EXCL/φ P55/IRQ13/SSI P54/IRQ12/SSO Same as left General I/O port multiplexed with interrupt input, SCIF and SCI_1 I/O P53/IRQ11/RxD1 P52/IRQ10/TxD1 P51/IRQ9/RxDF P50/IRQ8/TxDF Same as left General I/O port multiplexed with interrupt input, SCIF control I/O and SSU control I/O P67/Ex
Section 8 I/O Ports Port Description Port 9 General I/O port multiplexed with PWMX output and bus control I/O Port A Port B Port C General I/O port multiplexed with interrupt input, DTC event counter input, EtherC control I/O, and address output Single-Chip Mode (EXPE = 0) Extended Mode (EXPE = 1) P97 P97/WAIT/CS256 P96 Same as left P95 AS/IOS P94/ExPWX1 P93/ExPWX0 Same as left P92 P91 P90 P92/HBE P91/AH P90/LBE PA7/ExIRQ7/EVENT7/EXOUT PA7/ExIRQ7/EVENT7/A23 PA6/ExIRQ6/EVENT6/LNKSTA P
Section 8 I/O Ports Extended Mode (EXPE = 1) Feature of I/O General I/O port PD7/SDA5 multiplexed with IIC_5 PD6/SCL5 I/O Same as left NMOS push-pull output PD5/LPCPD General I/O port multiplexed with LPC PD4/CLKRUN PD3/GA20 I/O PD2/PME PD1/LSMI PD0/LSCI Same as left Built-in input pull-up MOS Port E General I/O port PE7/SERIRQ multiplexed with LPC PE6/LCLK I/O PE5/LRESET PE4/LFRAME PE3/LAD3 PE2/LAD2 PE1/LAD1 PE0/LAD0 Same as left Port F General I/O port multiplexed with PWMX output and EtherC
Section 8 I/O Ports 8.1.1 Port 1 Port 1 is an 8-bit I/O port. Port 1 pins can also function as the address bus and address-data multiplex bus pins. The pin functions change according to the operating mode. Port 1 has the following registers. • Port 1 data direction register (P1DDR) • Port 1 data register (P1DR) • Port 1 pull-up MOS control register (P1PCR) (1) Port 1 Data Direction Register (P1DDR) The individual bits of P1DDR specify input or output for the pins of port 1.
Section 8 I/O Ports (2) Port 1 Data Register (P1DR) P1DR stores output data for the port 1 pins. Bit Bit Name Initial Value R/W Description 7 P17DR 0 R/W 6 P16DR 0 R/W P1DR stores output data for the port 1 pins that are used as the general output port. 5 P15DR 0 R/W 4 P14DR 0 R/W 3 P13DR 0 R/W 2 P12DR 0 R/W 1 P11DR 0 R/W 0 P10DR 0 R/W (3) If this register is read, the P1DR values are read for the bits with the corresponding P1DDR bits set to 1.
Section 8 I/O Ports (4) Pin Functions The relationship between the register settings and the pin function is shown below. (a) Extended Mode (EXPE = 1) The pin function is switched as shown below according to the P1nDDR bit.
Section 8 I/O Ports 8.1.2 Port 2 Port 2 is an 8-bit I/O port. Port 2 pins can also function as the SCIF modem control signal, address bus, and address-data multiplex bus pins. The pin functions change according to the operating mode. Port 2 has the following registers. • Port 2 data direction register (P2DDR) • Port 2 data register (P2DR) • Port 2 pull-up MOS control register (P2PCR) (1) Port 2 Data Direction Register (P2DDR) The individual bits of P2DDR specify input or output for the pins of port 2.
Section 8 I/O Ports (2) Port 2 Data Register (P2DR) P2DR stores output data for the port 2 pins. Bit Bit Name Initial Value R/W Description 7 P27DR 0 R/W 6 P26DR 0 R/W P2DR stores output data for the port 2 pins that are used as the general output port. 5 P25DR 0 R/W 4 P24DR 0 R/W 3 P23DR 0 R/W 2 P22DR 0 R/W 1 P21DR 0 R/W 0 P20DR 0 R/W (3) If this register is read, the P2DR values are read for the bits with the corresponding P2DDR bits set to 1.
Section 8 I/O Ports (4) Pin Functions The relationship between the register settings and the pin function is shown below. (a) Extended Mode (EXPE = 1) • P27 to P24 The pin function is the same as that in single-chip mode. • P23 The pin function is switched as shown below according to the combination of the CS256E and IOSE bits in SYSCR, the ADFULLE bit in BCR2 of the BSC, and the P23DDR bit. Address 11 in the table below is expressed by the following logical expression.
Section 8 I/O Ports (b) Single-Chip Mode (EXPE = 0) • P27/DTR The pin function is switched as shown below according to the combination of the SCIFE bit in HICR5 of the LPC, the SCIFOE1 and SCIFOE0 bits in SCIFCR of the SCIF, and the P27DDR bit. SCIFE 0 SCIFOE1, SCIFOE0 Other than 10 P27DDR Pin function 1 10 0 1 X P27 input pin P27 output pin X1 0 DTR output P27 input pin pin X0 1 X P27 output pin DTR output pin [Legend] X: Don't care.
Section 8 I/O Ports (5) Port 2 Input Pull-Up MOS Port 2 has built-in input pull-up MOSs that can be controlled by software. The input pull-up MOS can be used regardless of the operating mode. Table 8.3 summarizes the input pull-up MOS states. Table 8.3 Port 2 Input Pull-Up MOS States Reset Hardware Standby Software Standby Mode Mode In Other Operations Off Off On/Off On/Off [Legend] Off: Always off. On/Off: On when P2DDR = 0 and P2PCR = 1; otherwise off. Rev. 2.00 Aug.
Section 8 I/O Ports 8.1.3 Port 3 Port 3 is an 8-bit I/O port. Port 3 pins can also function as the bidirectional data bus and debounced input pins. The pin functions change according to the operating mode. Port 3 has the following registers.
Section 8 I/O Ports (2) Port 3 Data Register (P3DR) P3DR stores output data for the port 3 pins. Bit Bit Name Initial Value R/W Description 7 P37DR 0 R/W • Normal extended mode (ADMXE = 0) 6 P36DR 0 R/W 5 P35DR 0 R/W 4 P34DR 0 R/W 3 P33DR 0 R/W 2 P32DR 0 R/W Since the port 3 pins function as bidirectional data bus pins, the value of this register has no effect on operation.
Section 8 I/O Ports (4) Noise Canceler Enable Register (P3NCE) P3NCE enables or disables the noise canceler circuit at port 3. Bit Bit Name Initial Value R/W Description 7 P37NCE 0 R/W • Normal extended mode (ADMXE = 0) 6 P36NCE 0 R/W 5 P35NCE 0 R/W The pins function as bidirectional data bus pins. Set this register to 0.
Section 8 I/O Ports (6) Noise Canceler Cycle Setting Register (NCCS) NCCS controls the sampling cycle of the noise cancelers. Bit Bit Name Initial Value R/W Description 7 to 3 Undefined R/W 2 NCCK2 0 R/W These bits set the sampling cycle of the noise cancelers. 1 NCCK1 0 R/W • When φ = 34 MHz 0 NCCK0 0 R/W 000: 0.06 µs φ/2 100: 963.8 µs φ/32768 001: 0.94 µs φ/32 101: 1.9 ms φ/65536 010: 15.1 µs φ/512 110: 3.9 ms φ/131072 111: 7.
Section 8 I/O Ports P3n input 1 expected P3nDR 0 expected P3nDR (n = 7 to 0) Figure 8.2 Noise Canceler Operation (7) Pin Functions (a) Normal Extended Mode Port 3 pins are automatically set to function as bidirectional data bus pins. (b) Address-Data Multiplex Extended Mode The operation is the same as that in single-chip mode. (c) Single-Chip Mode The pin function is switched as shown below according to the combination of the P3nDDR bit and the P3nNCE bit.
Section 8 I/O Ports (8) Port 3 Input Pull-Up MOS Port 3 has built-in input pull-up MOSs that can be controlled by software. The input pull-up MOS can be used in single-chip mode and address-data multiplex extended mode. Table 8.4 summarizes the input pull-up MOS states. Table 8.
Section 8 I/O Ports 8.1.4 Port 4 Port 4 is an 8-bit I/O port. Port 4 pins can also function as the external interrupt input, de-bounced input, bidirectional data bus, address bus, and address-data multiplex bus pins. Port 4 has the following registers.
Section 8 I/O Ports Bit Bit Name Initial Value R/W Description 3 P43DDR 0 W 2 P42DDR 0 W 1 P41DDR 0 W 0 P40DDR 0 W (2) • Normal extended mode (16-bit bus) These bits have no effect on operation. • Other modes If port 4 pins are specified for use as the general I/O port, the corresponding pins function as output port when the P4DDR bits are set to 1, and as input port when cleared to 0. Port 4 Data Register (P4DR) P4DR stores output data for the port 4 pins.
Section 8 I/O Ports (3) Port 4 Pull-Up MOS Control Register (P4PCR) P4PCR controls the port 4 built-in input pull-up MOSs. Bit Bit Name Initial Value R/W Description 7 P47PCR 0 R/W • Normal extended mode (ADMXE = 0) 6 P46PCR 0 R/W This register has no effect on operation. 5 P45PCR 0 R/W • Other modes 4 P44PCR 0 R/W 3 P43PCR 0 R/W When the pins are in the input state, the corresponding input pull-up MOS is turned on when a P4PCR bit is set to 1.
Section 8 I/O Ports (5) Noise Canceler Mode Control Register (P4BNCMC) P4BNCMC controls whether 1 or 0 is expected for the input signal to port 4 in bit units.
Section 8 I/O Ports φ/2, φ/32, φ/512, φ/8192, φ/32768, φ/65536, φ/131072, φ/262144 Sampling clock selection ∆t Pin input Latch Latch Latch Match detection circuit Sampling clock Figure 8.3 Noise Canceler Circuit P4n input 1 expected P4nDR 0 expected P4nDR (n = 7 to 4) Figure 8.4 Noise Canceler Operation Rev. 2.00 Aug.
Section 8 I/O Ports (7) Pin Functions The relationship between the register settings and the pin function is shown below. (a) Normal Extended Mode • P47 to P44 The pin function is switched as shown below according to the combination of the CS256E and IOSE bits in SYSCR, the ADFULLE bit in BCR2 of the BSC, and the P4nDDR bit. Address 13 in the table below is expressed by the following logical expression.
Section 8 I/O Ports (c) Single-Chip Mode The relationship between register setting values and pin functions are as follows. • P47 to P44 The pin function is switched as shown below according to the P4nDDR bit and the P4nNCE bit. When the ISSn bit in ISSR is cleared to 0 and the IRQnE bit in IER of the interrupt controller is set to 1, the pin can be used as the IRQn input pin. To use as the IRQn input pin, clear the P4nDDR bit to 0.
Section 8 I/O Ports (8) Port 4 Input Pull-Up MOS Port 4 has built-in input pull-up MOSs that can be controlled by software. The input pull-up MOS can be used in single-chip mode and address-data multiplex extended mode. Table 8.5 summarizes the input pull-up MOS states. Table 8.
Section 8 I/O Ports 8.1.5 Port 5 Port 5 is an 8-bit I/O port. Port 5 pins can also function as the SCIF, SCI_1, and SSU input/output, bus control output, system clock output, external subclock input, and interrupt input pins. Port 5 has the following registers. • Port 5 data direction register (P5DDR) • Port 5 data register (P5DR) (1) Port 5 Data Direction Register (P5DDR) The individual bits of P5DDR specify input or output for the port 5 pins.
Section 8 I/O Ports (2) Port 5 Data Register (P5DR) P5DR stores output data for the port 5 pins. Bit Bit Name Initial Value R/W Description 7 P57DR 0 R/W 6 P56DR Undefined* R P5DR stores output data for the port 5 pins that are used as the general output port. 5 P55DR 0 R/W 4 P54DR 0 R/W 3 P53DR 0 R/W 2 P52DR 0 R/W 1 P51DR 0 R/W 0 P50DR 0 R/W Note: * If this register is read, the P5DR values are read for the bits with the corresponding P5DDR bits set to 1.
Section 8 I/O Ports • P56/EXCL/φ The pin function is switched as shown below according to the combination of the EXCLE bit in LPWRCR and the P56DDR bit. P56DDR 0 EXCLE Pin function 1 0 1 X P56 input pin EXCL input pin φ output pin [Legend] X: Don't care. • P55/IRQ13/SSI The pin function is switched as shown below according to the RE bit in SSER of the SSU and the P55DDR bit.
Section 8 I/O Ports • P53/IRQ11/RxD1 The pin function is switched as shown below according to the combination of the RE bit in SCR of SCI_1 and the P53DDR bit. When the ISS11 bit in ISSR16 is cleared to 0 and the IRQ11E bit in IER16 of the interrupt controller is set to 1, this pin can be used as the IRQ11 input pin. To use as the IRQ11 input pin, clear the P53DDR bit to 0. RE 0 1 P53DDR 0 1 X Pin function P53 input pin P53 output pin RxD1 input pin IRQ11 input pin [Legend] X: Don't care.
Section 8 I/O Ports • P51/IRQ9/RxDF The pin function is switched as shown below according to the combination of the enable/disable setting of the SCIF and the P51DDR bit. When the ISS9 bit in ISSR16 is cleared to 0 and the IRQ9E bit in IER16 of the interrupt controller is set to 1, this pin can be used as the IRQ9 input pin. To use as the IRQ9 input pin, clear the P51DDR bit to 0.
Section 8 I/O Ports 8.1.6 Port 6 Port 6 is an 8-bit I/O port. Port 6 pins can also function as the bidirectional data bus, PWMX output, SCIF and SSU control input/output, and interrupt input pins. The pin functions change according to the operating mode. In addition, port 6 pins can also be used as the extended data bus pins (D0 to D0). Port 6 has the following registers.
Section 8 I/O Ports (2) Port 6 Data Register (P6DR) P6DR stores output data for the port 6 pins. Bit Bit Name Initial Value R/W Description 7 P67DR 0 R/W 6 P66DR 0 R/W These bits store output data for the port 6 pins that are used as the general output port. 5 P65DR 0 R/W 4 P64DR 0 R/W If this register is read, the P6DR values are read for the bits with the corresponding P6DDR bits set to 1. For the bits with the corresponding P6DDR bits cleared to 0, the pin states are read.
Section 8 I/O Ports (3) Port 6 Pull-Up MOS Control Register (P6PCR) P6PCR controls the port 6 built-in input pull-up MOSs. Bit Bit Name Initial Value R/W Description 7 P67PCR 0 R/W • 6 P66PCR 0 R/W 5 P65PCR 0 R/W 4 P64PCR 0 R/W 3 P23PCR 0 R/W 2 P62PCR 0 R/W 1 P61PCR 0 R/W 0 P60PCR 0 R/W (4) Pin Functions (a) Normal Extended Mode Normal extended mode (16-bit bus) This register has no effect on operation.
Section 8 I/O Ports • P67/ExIRQ8/SSCK The pin function is switched as shown below according to the SCKS bit in SSCRH of the SSU and the P67DDR bit. When the ISS8 bit in ISSR16 is set to 1, this pin can be used as the ExIRQ8 input pin. To use as the ExIRQ8 input pin, clear the P67DDR bit to 0. SCKS 0 P67DDR Pin function 1 0 1 X P67 input pin P67 output pin SSCK I/O pin ExIRQ8 input pin [Legend] X: Don't care.
Section 8 I/O Ports • P64/ExIRQ11/CTS The pin function is switched as shown below according to the combination of the enable/disable setting of the SCIF and the P64DDR bit. When the ISS10 bit in ISSR16 is set to 1, this pin can be used as the ExIRQ11 input pin. To use as the ExIRQ11 input pin, clear the P64DDR bit to 0. SCIF Disabled P64DDR Pin function Enabled 0 1 X P64 input pin P64 output pin CTS input pin IRQ11 input pin [Legend] X: Don't care.
Section 8 I/O Ports • P61/IRQ15/PWX1 The pin function is switched as shown below according to the combination of the OEB bit in DACR and the PWMXS bit in PTCNT0 of PWMX_0 and the P61DDR bit. To use this pin as the IRQ15 input pin, clear the P61DDR bit to 0. P61DDR 0 1 X PWMXS 0 1 0 1 0 OEB 0 X 0 X 1 Pin function P61 input pin P61 output pin PWX1 output pin IRQ15 input pin [Legend] X: Don't care.
Section 8 I/O Ports 8.1.7 Port 7 Port 7 is an 8-bit input port. Port 7 pins can also function as the A/D converter analog input pins. Port 7 has the following register. • Port 7 input data register (P7PIN) (1) Port 7 Input Data Register (P7PIN) P7PIN indicates the states of the port 7 pins. Bit Bit Name Initial Value R/W Description 7 P77PIN Undefined* R When this register is read, the pin states are read.
Section 8 I/O Ports • P76/AN6 The pin function is switched as shown below according to the combination of the SCANE bit in ADCR and the CH2 to CH0 bits in ADCSR of the A/D converter. Do not set these bits to other values than those shown in the following table.
Section 8 I/O Ports • P73/AN3 The pin function is switched as shown below according to the combination of the SCANE and SCANE bits in ADCR and the CH2 to CH0 bits in ADCSR of the A/D converter. Do not set these bits to other values than those shown in the following table.
Section 8 I/O Ports • P70/AN0 The pin function is switched as shown below according to the combination of the SCANE and SCANS bits in ADCR and the CH2 to CH0 bits in ADCSR of the A/D converter. Do not set these bits to other values than those shown in the following table. SCANE 0 SCANS X 1 0 1 CH2 to CH0 B'000 Other than B'000 B'000 to B'011 Other than B'000 to B'011 B'000 to B'111 Pin function AN0 input pin P70 input pin AN0 input pin P70 input pin AN0 input pin [Legend] X: Don't care.
Section 8 I/O Ports 8.1.8 Port 8 Port 8 is an 8-bit I/O port. Port 8 pins can also function as the A/D converter external trigger input, SCI_1 and SCI_3 input/output, IIC_0 and IIC_1 input/output, and interrupt input pins. Pins 83 to 80 perform the NMOS push-pull output. Port 8 has the following registers. • Port 8 data direction register (P8DDR) • Port 8 data register (P8DR) (1) Port 8 Data Direction Register (P8DDR) The individual bits of P8DDR specify input or output for the port 8 pins.
Section 8 I/O Ports (2) Port 8 Data Register (P8DR) P8DR stores output data for the port 8 pins. Bit Bit Name Initial Value R/W Description 7 P87DR 0 R/W 6 P86DR 0 R/W P8DR stores output data for the port 8 pins that are used as the general output port. 5 P85DR 0 R/W 4 P84DR 0 R/W 3 P83DR 0 R/W 2 P82DR 0 R/W 1 P81DR 0 R/W 0 P80DR 0 R/W (3) If this register is read, the P8DR values are read for the bits with the corresponding P8DDR bits set to 1.
Section 8 I/O Ports • P86/ExIRQ14/RxD3 The pin function is switched as shown below according to the combination of the RE bit in SCR of SCI_3, the SMIF bit in SCMR, and the P86DDR bit. When the ISS14 bit in ISSR16 is set to 1, this pin can be used as the ExIRQ14 input pin. To use this pin as the ExIRQ14 input pin, clear the P86DDR bit to 0.
Section 8 I/O Ports • P84/ExIRQ12/SCK3 The pin function is switched as shown below according to the combination of the C/A bit in SMR of SCI_3, the CKE1 and CKE0 bits in SCR, and the P84DDR bit. When the ISS12 bit in ISSR16 is set to 1, this pin can be used as the ExIRQ12 input pin. To use this pin as the ExIRQ12 input pin, clear the P84DDR bit to 0.
Section 8 I/O Ports • P82/SCL1 The pin function is switched as shown below according to the combination of the ICE bit in ICCR of IIC_1 and the P82DDR bit. When this pin is used as the P82 output pin, the output format is NMOS push-pull output. The output format for SCL1 is NMOS open-drain output, which allows direct bus drive. ICE 0 P82DDR Pin function 1 0 1 X P82 input pin P82 output pin SCL1 input/output pin [Legend] X: Don't care.
Section 8 I/O Ports 8.1.9 Port 9 Port 9 is an 8-bit I/O port. Port 9 pins can function as the bus control input/output pins. The pin functions change according to the operating mode. Port 9 has the following registers. • Port 9 data direction register (P9DDR) • Port 9 data register (P9DR) (1) Port 9 Data Direction Register (P9DDR) The individual bits of P9DDR specify input or output for the port 9 pins.
Section 8 I/O Ports (2) Port 9 Data Register (P9DR) P9DR stores output data for the port 9 pins. Bit Bit Name Initial Value R/W Description 7 P97DR 0 R/W 6 P96DR 0 R/W P9DR stores output data for the port 9 pins that are used as the general output port. 5 P95DR 0 R/W 4 P94DR 0 R/W 3 P93DR 0 R/W 2 P92DR 0 R/W 1 P91DR 0 R/W 0 P90DR 0 R/W (3) If this register is read, the P9DR values are read for the bits with the corresponding P9DDR bits set to 1.
Section 8 I/O Ports • P96 The pin function is switched as shown below according to the P96DDR bit. P96DDR Pin function 0 1 P96 input pin P96 output pin • P95/AS/IOS The pin function is switched as shown below according to the operating mode and the combination of the IOSE bit in SYSCR and the P95DDR bit. Operating mode Extended mode P95DDR X IOSE Pin function Single-chip mode 0 1 0 1 X X AS output pin IOS output pin P95 input pin P95 output pin [Legend] X: Don't care.
Section 8 I/O Ports • P92/HBE The pin function is switched as shown below according to the operating mode, the OBE bit in PTCNT0, and the P92DDR bit. Operating mode Extended mode OBE P92DDR Pin function 0 1 0 P92 input pin Single-chip mode 1 X X P92 output pin HBE output pin 0 1 P92 input pin P92 output pin [Legend] X: Don't care. • P91/AH The pin function is switched as shown below according to the operating mode, the ADMXE bit in SYSCR2, and the P91DDR bit.
Section 8 I/O Ports 8.1.10 Port A Port A is an 8-bit I/O port. Port A pins can also function as the address output, event counter input, EtherC control I/O, and interrupt input pins. Port A has the following registers. PADDR and PAPIN are allocated to the same address. • Port A data direction register (PADDR) • Port A output data register (PAODR) • Port A input data register (PAPIN) (1) Port A Data Direction Register (PADDR) The individual bits of PADDR specify input or output for the port A pins.
Section 8 I/O Ports (2) Port A Output Data Register (PAODR) PAODR stores output data for the port A pins. Bit Bit Name Initial Value R/W Description 7 PA7ODR 0 R/W 6 PA6ODR 0 R/W PAODR stores output data for the port A pins that are used as the general output port. 5 PA5ODR 0 R/W 4 PA4ODR 0 R/W 3 PA3ODR 0 R/W 2 PA2ODR 0 R/W 1 PA1ODR 0 R/W 0 PA0ODR 0 R/W (3) Port A Input Data Register (PAPIN) PAPIN indicates the states of the port A pins.
Section 8 I/O Ports (4) Pin Functions The relationship between the operating mode, register setting values, and pin functions are as follows. (a) Normal Extended Mode Port A pins can function as address output, interrupt input, event counter input, EtherC control I/O or I/O port pins, and input or output can be specified in bit units. Address 18 and address 13 in the following tables are expressed by the following logical expressions according to the control bits of the bus controller or other module.
Section 8 I/O Ports • PA6/ExIRQ6/EVENT6/A22/LNKSTA The pin function is switched as shown below according to the setting of address 18 and the PA6DDR bit. Setting the ISS6 bit in ISSR makes the pin to function as the ExIRQ6 input pin. When using the pin as the ExIRQ6 input, or an EVENT input pin, clear the PA6DDR bit to 0. Though the settings for the EVENT input pin have been made, set the PA6DDR bit to 1 when using the pin as the PA6 or A22 output pin.
Section 8 I/O Ports • PA4/ExIRQ4/EVENT4/A20, PA3/ExIRQ3/EVENT3/A19, PA2/ExIRQ2/EVENT2/A18 The pin function is switched as shown below according to the setting of address 18 and the PAnDDR bit. Setting the ISSn bit in ISSR makes the pin to function as the ExIRQn input pin. When using the pin as the ExIRQn input or an EVENT input pin, clear the PAnDDR bit to 0. Though the settings for the EVENT input pin have been made, set the PAnDDR bit to 1 when using the pin as the PAn or Am output pin.
Section 8 I/O Ports (b) Single-Chip Mode and Address-Data Multiplex Extended Mode Port A pins can also function as interrupt input and event counter input pins. • PA7/ExIRQ7/EVENT7/EXOUT The pin function is switched as shown below according to the PA7DDR bit. Setting the ISS7 bit in ISSR makes the pin to function as the ExIRQ7 input pin. When using this pin as the ExIRQ7 input or EVENT7 input pin, clear the PA7DDR bit to 0.
Section 8 I/O Ports • PA5/ExIRQ5/EVENT5/WOL The pin function is switched as shown below according to and the PA5DDR bit. Setting the ISS5 bit in ISSR makes the pin to function as the ExIRQ5 input pin. When using this pin as the ExIRQ5 input or EVENT5 input pin, clear the PA5DDR bit to 0. Though the settings for the EVENT input pin have been made, set the PA5DDR bit to 1 to use the pin as the PA5 output pin.
Section 8 I/O Ports (5) Input Pull-Up MOS Port A has built-in input pull-up MOSs that can be controlled by software. This input pull-up MOS can be used in any operating mode, and can be specified as on or off on a bit-by-bit basis. PAnDDR 0 PAnODR PAn pull-up MOS [Legend] 1 1 0 X ON OFF OFF n = 7 to 0, X: Don't care. The input pull-up MOS is in the off state after a reset and in hardware standby mode. The prior state is retained in software standby mode. Table 8.
Section 8 I/O Ports 8.1.11 Port B Port B is an 8-bit I/O port. Port B pins can also function as the bidirectional data bus, de-bounced input, and EtherC control I/O pins. The pin functions change according to the operating mode. Port B has the following registers.
Section 8 I/O Ports (2) Port B Output Data Register (PBODR) PBDR stores output data for the port B pins. Bit Bit Name Initial Value R/W Description 7 PB7DR 0 6 PB6DR 0 R/W PBODR stores output data for the port B pins that are used as the general output port. R/W 5 PB5DR 0 R/W 4 PB4DR 0 R/W 3 PB3DR 0 R/W 2 PB2DR 0 R/W 1 PB1DR 0 R/W 0 PB0DR 0 R/W (3) Port B Input Data Register (PBPIN) PBPIN indicates the states of the port B pins.
Section 8 I/O Ports (4) Noise Canceler Enable Register (P4BNCE) P4BNCE enables or disables the noise canceler circuits of port 4 and port B pins in bit units. Bit Initial Value R/W Description 7 to 4 P47NCE to P44NCE All 0 R/W Bits for port 4 setting 3 PB3NCE 0 2 PB2NCE 0 1 PB1NCE 0 0 PB0NCE 0 R/W Enables the noise canceler circuit for the corresponding pin and the pin state is fetched into PBDR at the R/W sampling cycle set by NCCS.
Section 8 I/O Ports (6) Noise Canceler Cycle Setting Register (NCCS) NCCS controls the sampling cycle of the noise cancelers. Bit Bit Name Initial Value R/W Description 7 to 3 Undefined R/W Reserved 2 NCCK2 0 1 NCCK1 0 R/W These bits set the sampling cycle of the noise R/W cancelers. 0 NCCK0 0 R/W • Undefined value is read from these bits. When φ = 34 MHz 000: 0.06 µs φ/2 100: 963.8 µs φ/32768 001: 0.94 µs φ/32 101: 1.9 ms φ/65536 010: 15.1 µs φ/512 110: 3.
Section 8 I/O Ports PBn input 1 expected PBnDR 0 expected PBnDR (n = 3 to 0) Figure 8.6 Noise Canceler Operation Rev. 2.00 Aug.
Section 8 I/O Ports (7) Pin Functions • PB7/EVENT15/RM_RX-ER, PB6/EVENT14/RM_CRS-DV, PB5/EVENT13/RM_REF-CLK PB4/EVENT12/RM_TX-EN The pin function is switched as shown below according to the PBnDDR bit. When using this pin as the EVENT input pin, clear the PBnDDR bit to 0. These pins can be used as EtherC I/O pins when the EtherC is enabled.
Section 8 I/O Ports 8.1.12 Port C Port C is an 8-bit I/O port. Port C pins can also function as the bus control output, and IIC_2, IIC_3, and IIC_4 input/output pins. The output format of ports C0 to C5 is NMOS push-pull output. Port C has the following registers. • Port C data direction register (PCDDR) • Port C output data register (PCODR) • Port C input data register (PCPIN) (1) Port C Data Direction Register (PCDDR) The individual bits of PCDDR specify input or output for the port C pins.
Section 8 I/O Ports (2) Port C Output Data Register (PCODR) PCODR stores output data for the port C pins. Bit Bit Name Initial Value R/W Description 7 PC7ODR 0 R/W 6 PC6ODR 0 R/W The PCODR register stores the output data for the pins that are used as the general output port. 5 PC5ODR 0 R/W 4 PC4ODR 0 R/W 3 PC3ODR 0 R/W 2 PC2ODR 0 R/W 1 PC1ODR 0 R/W 0 PC0ODR 0 R/W (3) Port C Input Data Register (PCPIN) PCPIN indicates the pin states of port C.
Section 8 I/O Ports (4) Pin Functions (a) Normal Extended Mode and Address-Data Multiplex Extended Mode Port C pins can also function as the bus control output and IIC_2, IIC_3, and IIC_4 input/output pins. The relationship between register setting values and pin functions are as follows. • PC7 The PC7 pin functions as a bus control output pin. • PC6 When set for 16-bit bus width, the PC7 pin functions as a bus control output pin.
Section 8 I/O Ports • PC4/SCL4 The pin function is switched as shown below according to the combination of the ICE bit in ICCR of the IIC_4 and the PC4DDR bit. ICE 0 PC4DDR Pin function [Legend] 1 0 1 X PC4 input pin PC4 output pin SCL4 input/output pin X: Don't care. • PC3/SDA3 The pin function is switched as shown below according to the combination of the ICE bit in ICCR of the IIC_3 and the PC3DDR bit.
Section 8 I/O Ports • PC0/SCL2 The pin function is switched as shown below according to the combination of the ICE bit in ICCR of the IIC_2 and the PC0DDR bit. ICE 0 PC0DDR Pin function [Legend] 0 1 X PC0 input pin PC0 output pin SCL2 input/output pin X: Don't care. Rev. 2.00 Aug.
Section 8 I/O Ports 8.1.13 Port D Port D is an 8-bit I/O port. Port D pins can also function as the IIC_5 input/output and LPC input/output pins. The output format of PD7 and PD6 pins is NMOS push-pull output. Port D has the following registers. • Port D data direction register (PDDDR) • Port D output data register (PDODR) • Port D input data register (PDPIN) (1) Port D Data Direction Register (PDDDR) The individual bits of PDDDR specify input or output for the port D pins.
Section 8 I/O Ports (2) Port D Output Data Register (PDODR) PDODR stores output data for the port D pins. Bit Bit Name Initial Value R/W Description 7 PD7ODR 0 R/W 6 PD6ODR 0 R/W The PCODR register stores the output data for the pins that are used as the general output port. 5 PD5ODR 0 R/W 4 PD4ODR 0 R/W 3 PD3ODR 0 R/W 2 PD2ODR 0 R/W 1 PD1ODR 0 R/W 0 PD0ODR 0 R/W (3) Port D Input Data Register (PDPIN) PDPIN indicates the pin states of port D.
Section 8 I/O Ports (4) Pin Functions Port D pins can also function as the LPC input/output and IIC_5 input/output pins. The relationship between register setting values and pin functions are as follows. The LPC is disabled when all of the bits LPC1E, LPC2E, and LPC3E in HICR0 and SCIFE in HICR5 are cleared to 0. • PD7/SDA5 The pin function is switched as shown below according to the combination of the ICE bit in ICCR of the IIC_5 and the PD7DDR bit.
Section 8 I/O Ports • PD4/CLKRUN The pin function is switched as shown below according to the PD4DDR bit. This pin can be used as the CLKRUN input pin when the LPC is enabled. LPC PD4DDR Pin function Disabled Enabled 0 1 0 PD4 input pin PD4 output pin CLKRUN input/output pin • PD3/GA20 The pin function is switched as shown below according to the combination of the FGA20E bit in HICR0 of the LPC and the PD3DDR bit.
Section 8 I/O Ports • PD0/LSCI The pin function is switched as shown below according to the combination of the LSCIE bit in HICR0 of the LPC and the PD0DDR bit. LSCIE 0 PD0DDR Pin function (5) 1 0 1 0 PD0 input pin PD0 output pin LSCI output pin Input Pull-Up MOS Port pins D5 to D0 have built-in input pull-up MOSs that can be controlled by software. This input pull-up MOS can be used in any operating mode, and can be specified as on or off on a bit-by-bit basis.
Section 8 I/O Ports 8.1.14 Port E Port E is an 8-bit I/O port. Port E pins can also function as the LPC input/output pins. Port E has the following registers. • Port E data direction register (PEDDR) • Port E output data register (PEODR) • Port E input data register (PEPIN) (1) Port E Data Direction Register (PEDDR) The individual bits of PEDDR specify input or output for the port E pins.
Section 8 I/O Ports (3) Port E Input Data Register (PEPIN) PEPIN indicates the pin states of port E. Bit Bit Name Initial Value R/W Description 7 PE7PIN Undefined* R When this register is read, the pin states are read. 6 PE6PIN Undefined* R 5 PE5PIN Undefined* R Since this register is allocated to the same address as PEDDR, writing to this register writes data to PEDDR and the port E setting is changed.
Section 8 I/O Ports • PE6/LCLK The pin function is switched as shown below according to whether the LPC is enabled or disabled and the PE6DDR bit. LPC Disabled PE6DDR Pin function [Legend] Enabled 0 1 X PE6 input pin PE6 output pin LCLK input pin X: Don't care. • PE5/LRESET The pin function is switched as shown below according to whether the LPC is enabled or disabled and the PE5DDR bit.
Section 8 I/O Ports • PE2/LAD2 The pin function is switched as shown below according to whether the LPC is enabled or disabled and the PE2DDR bit. LPC Disabled PE2DDR Pin function [Legend] Enabled 0 1 X PE2 input pin PE2 output pin LAD2 input/output pin X: Don't care. • PE1/LAD1 The pin function is switched as shown below according to whether the LPC is enabled or disabled and the PE1DDR bit.
Section 8 I/O Ports 8.1.15 Port F Port F is a 7-bit I/O port. Port F pins can also function as the PWMX output and EtherC control input/output pins. Port F has the following registers. • Port F data direction register (PFDDR) • Port F output data register (PFODR) • Port F input data register (PFPIN) (1) Port F Data Direction Register (PFDDR) The individual bits of PFDDR specify input or output for the port F pins.
Section 8 I/O Ports (2) Port F Output Data Register (PFODR) PFODR stores output data for the port F pins. PEODR is initialized only by a system reset, and retains the value even if an internal reset signal of the WDT is generated. Bit Bit Name Initial Value R/W Description 7 Reserved Undefined value is read from this bit.
Section 8 I/O Ports (4) Pin Functions Port F is a 7-bit I/O port. Port F pins can also function as the PWM output and EtherC control input/output pins. The relationship between the register settings and the pin function is shown below. • PF6/ExPWX2/RS14 The pin function is switched as shown below according to the combination of the OEA bit in DACR and the PWMXS bit in PTCNT0 of PWMX_1 and the PF6DDR bit.
Section 8 I/O Ports • PF2/RS10 The pin function is switched as shown below according to the PF2DDR bit. PF2DDR Pin function 0 1 PF2 input pin PF2 output pin • PF1/RS9/MDC, PF0/RS8/MDIO The pin function is switched as shown below according to the combination of the module stop state in the EtherC and E-DMAC and the PFnDDR bit.
Section 8 I/O Ports 8.2 I/O Ports for the H8S/2463 Group and the H8S/2462 Group Table 8.9 is a summary of the port functions. The pins of each port also function as input/output pins of peripheral modules and interrupt input pins. Each input/output port includes a data direction register (DDR) that controls input/output and a data register (DR) that stores output data. DDR and DR are not provided for input-only ports.
Section 8 I/O Ports Table 8.
Section 8 I/O Ports Single-Chip Mode (EXPE = 0) Extended Mode (EXPE = 1) General I/O port multiplexed with interrupt input, bus control output, system clock output, external subclock input, and SSU I/O P57 WR/HWR P56/EXCL/φ P55/IRQ13/SSI P54/IRQ12/SSO Same as left General I/O port multiplexed with interrupt input, SCIF and SCI_1 I/O P53/IRQ11/RxD1 P52/IRQ10/TxD1 P51/IRQ9/RxDF P50/IRQ8/TxDF Same as left General I/O port multiplexed with interrupt input, SCIF control I/O, and SSU control I/O P67/E
Section 8 I/O Ports Port Description Port 9 General I/O port multiplexed with PWMX output and bus control I/O Port A Port B Port C General I/O port multiplexed with interrupt input, DTC event counter input, EtherC control I/O, and address output Single-Chip Mode (EXPE = 0) Extended Mode (EXPE = 1) P97 P97/WAIT/CS256 P96 Same as left P95 AS/IOS P94/ExPWX1 P93/ExPWX0 Same as left P92 P91 P90 P92/HBE P91/AH P90/LBE Feature of I/O PA7/ExIRQ7/EVENT7 PA7/ExIRQ7/EVENT7/A23 PA6/ExIRQ6/EVENT6
Section 8 I/O Ports Extended Mode (EXPE = 1) Feature of I/O General I/O port PD7/SDA5 multiplexed with IIC_5 PD6/SCL5 I/O Same as left NMOS push-pull output PD5/LPCPD General I/O port multiplexed with LPC PD4/CLKRUN PD3/GA20 I/O PD2/PME PD1/LSMI PD0/LSCI Same as left Built-in input pull-up MOS Port E General I/O port PE7/SERIRQ multiplexed with LPC PE6/LCLK I/O PE5/LRESET PE4/LFRAME PE3/LAD3 PE2/LAD2 PE1/LAD1 PE0/LAD0 Same as left Port F General I/O port multiplexed with PWMX output and EtherC
Section 8 I/O Ports 8.2.1 Port 1 Port 1 is an 8-bit I/O port. Port 1 pins can also function as the address bus and address-data multiplex bus pins. The pin functions change according to the operating mode. Port 1 has the following registers. • Port 1 data direction register (P1DDR) • Port 1 data register (P1DR) • Port 1 pull-up MOS control register (P1PCR) (1) Port 1 Data Direction Register (P1DDR) The individual bits of P1DDR specify input or output for the pins of port 1.
Section 8 I/O Ports (2) Port 1 Data Register (P1DR) P1DR stores output data for the port 1 pins. Bit Bit Name Initial Value R/W Description 7 P17DR 0 R/W 6 P16DR 0 R/W P1DR stores output data for the port 1 pins that are used as the general output port. 5 P15DR 0 R/W 4 P14DR 0 R/W 3 P13DR 0 R/W 2 P12DR 0 R/W 1 P11DR 0 R/W 0 P10DR 0 R/W (3) If this register is read, the P1DR values are read for the bits with the corresponding P1DDR bits set to 1.
Section 8 I/O Ports (4) Pin Functions The relationship between the register settings and the pin function is shown below. (a) Extended Mode (EXPE = 1) The pin function is switched as shown below according to the P1nDDR bit.
Section 8 I/O Ports 8.2.2 Port 2 Port 2 is an 8-bit I/O port. Port 2 pins can also function as the SCIF modem control signal, address bus, and address-data multiplex bus pins. The pin functions change according to the operating mode. Port 2 has the following registers. • Port 2 data direction register (P2DDR) • Port 2 data register (P2DR) • Port 2 pull-up MOS control register (P2PCR) (1) Port 2 Data Direction Register (P2DDR) The individual bits of P2DDR specify input or output for the pins of port 2.
Section 8 I/O Ports (2) Port 2 Data Register (P2DR) P2DR stores output data for the port 2 pins. Bit Bit Name Initial Value R/W Description 7 P27DR 0 R/W 6 P26DR 0 R/W P2DR stores output data for the port 2 pins that are used as the general output port. 5 P25DR 0 R/W 4 P24DR 0 R/W 3 P23DR 0 R/W 2 P22DR 0 R/W 1 P21DR 0 R/W 0 P20DR 0 R/W (3) If this register is read, the P2DR values are read for the bits with the corresponding P2DDR bits set to 1.
Section 8 I/O Ports (4) Pin Functions The relationship between the register settings and the pin function is shown below. (a) Extended Mode (EXPE = 1) • P27 to P24 The pin function is the same as that in single-chip mode. • P23 The pin function is switched as shown below according to the combination of the CS256E and IOSE bits in SYSCR, the ADFULLE bit in BCR2 of the BSC, and the P23DDR bit. Address 11 in the table below is expressed by the following logical expression.
Section 8 I/O Ports (b) Single-Chip Mode (EXPE = 0) • P27/DTR The pin function is switched as shown below according to the combination of the SCIFE bit in HICR5 of the LPC, the SCIFOE1 and SCIFOE0 bits in SCIFCR of the SCIF, and the P27DDR bit. SCIFE 0 SCIFOE1, SCIFOE0 Other than 10 P27DDR Pin function [Legend] 1 10 0 1 X P27 input pin P27 output pin X1 0 DTR output P27 input pin pin X0 1 X P27 output pin DTR output pin X: Don't care.
Section 8 I/O Ports (5) Port 2 Input Pull-Up MOS Port 2 has built-in input pull-up MOSs that can be controlled by software. The input pull-up MOS can be used regardless of the operating mode. Table 8.11 summarizes the input pull-up MOS states. Table 8.11 Port 2 Input Pull-Up MOS States Reset Hardware Standby Software Standby Mode Mode In Other Operations Off Off On/Off [Legend] Off: Always off. On/Off: On when P2DDR = 0 and P2PCR = 1; otherwise off. Rev. 2.00 Aug.
Section 8 I/O Ports 8.2.3 Port 3 Port 3 is an 8-bit I/O port. Port 3 pins can also function as the bidirectional data bus and debounced input pins. The pin functions change according to the operating mode. Port 3 has the following registers.
Section 8 I/O Ports (2) Port 3 Data Register (P3DR) P3DR stores output data for the port 3 pins. Bit Bit Name Initial Value R/W Description 7 P37DR 0 R/W • Normal extended mode (ADMXE = 0) 6 P36DR 0 R/W 5 P35DR 0 R/W 4 P34DR 0 R/W 3 P33DR 0 R/W 2 P32DR 0 R/W Since the port 3 pins function as bidirectional data bus pins, the value of this register has no effect on operation.
Section 8 I/O Ports (4) Noise Canceler Enable Register (P3NCE) P3NCE enables or disables the noise canceler circuit at port 3. Bit Bit Name Initial Value R/W Description 7 P37NCE 0 R/W • Normal extended mode (ADMXE = 0) 6 P36NCE 0 R/W 5 P35NCE 0 R/W The pins function as bidirectional data bus pins. Set this register to 0.
Section 8 I/O Ports (6) Noise Canceler Cycle Setting Register (NCCS) NCCS controls the sampling cycle of the noise cancelers. Bit Bit Name Initial Value R/W Description 7 to 3 Undefined R/W 2 NCCK2 0 R/W These bits set the sampling cycle of the noise cancelers. 1 NCCK1 0 R/W • When φ = 34 MHz 0 NCCK0 0 R/W 000: 0.06 µs φ/2 100: 963.8 µs φ/32768 001: 0.94 µs φ/32 101: 1.9 ms φ/65536 010: 15.1 µs φ/512 110: 3.9 ms φ/131072 111: 7.
Section 8 I/O Ports P3n input 1 expected P3nDR 0 expected P3nDR (n = 7 to 0) Figure 8.8 Noise Canceler Operation (7) Pin Functions (a) Normal Extended Mode Port 3 pins are automatically set to function as bidirectional data bus pins. (b) Address-Data Multiplex Extended Mode The operation is the same as that in single-chip mode. (c) Single-Chip Mode The pin function is switched as shown below according to the P3nDDR bit and the P3nNCE bit.
Section 8 I/O Ports (8) Port 3 Input Pull-Up MOS Port 3 has built-in input pull-up MOSs that can be controlled by software. The input pull-up MOS can be used in single-chip mode and address-data multiplex extended mode. Table 8.12 summarizes the input pull-up MOS states. Table 8.
Section 8 I/O Ports 8.2.4 Port 4 Port 4 is an 8-bit I/O port. Port 4 pins can also function as the external interrupt input, de-bounced input, bidirectional data bus, address bus, and address-data multiplex bus pins. Port 4 has the following registers.
Section 8 I/O Ports Bit Bit Name Initial Value R/W Description 3 P43DDR 0 W 2 P42DDR 0 W 1 P41DDR 0 W 0 P40DDR 0 W (2) • Normal extended mode (16-bit bus) These bits have no effect on operation. • Other modes If port 4 pins are specified for use as the general I/O port, the corresponding pins function as output port when the P4DDR bits are set to 1, and as input port when cleared to 0. Port 4 Data Register (P4DR) P4DR stores output data for the port 4 pins.
Section 8 I/O Ports (3) Port 4 Pull-Up MOS Control Register (P4PCR) P4PCR controls the port 4 built-in input pull-up MOSs. Bit Bit Name Initial Value R/W Description 7 P47PCR 0 R/W • Normal extended mode (ADMXE = 0) 6 P46PCR 0 R/W This register has no effect on operation. 5 P45PCR 0 R/W • Other modes 4 P44PCR 0 R/W 3 P43PCR 0 R/W When the pins are in the input state, the corresponding input pull-up MOS is turned on when a P4PCR bit is set to 1.
Section 8 I/O Ports (5) Noise Canceler Mode Control Register (P4BNCMC) P4BNCMC controls whether 1 or 0 is expected for the input signal to port 4 in bit units.
Section 8 I/O Ports φ/2, φ/32, φ/512, φ/8192, φ/32768, φ/65536, φ/131072, φ/262144 Sampling clock selection ∆t Pin input Latch Latch Latch Match detection circuit Port data register Sampling clock Figure 8.9 Noise Canceler Circuit P4n input 1 expected P4nDR 0 expected P4nDR (n = 7 to 4) Figure 8.10 Noise Canceler Operation Rev. 2.00 Aug.
Section 8 I/O Ports (7) Pin Functions The relationship between the register settings and the pin function is shown below. (a) Normal Extended Mode • P47 to P44 The pin function is switched as shown below according to the combination of the CS256E and IOSE bits in SYSCR, the ADFULLE bit in BCR2 of the BSC, and the P4nDDR bit. Address 13 in the table below is expressed by the following logical expression.
Section 8 I/O Ports (c) Single-Chip Mode The relationship between register setting values and pin functions are as follows. • P47 to P40 The pin function is switched as shown below according to the P4nDDR bit and P4nNCE bit. When the ISSn bit in ISSR is cleared to 0 and the IRQnE bit in IER of the interrupt controller is set to 1, the pin can be used as the IRQn input pin. To use as the IRQn input pin, clear the P4nDDR bit to 0.
Section 8 I/O Ports (8) Port 4 Input Pull-Up MOS Port 4 has built-in input pull-up MOSs that can be controlled by software. The input pull-up MOS can be used in single-chip mode and address-data multiplex extended mode. Table 8.13 summarizes the input pull-up MOS states. Table 8.
Section 8 I/O Ports 8.2.5 Port 5 Port 5 is an 8-bit I/O port. Port 5 pins can also function as the SCIF, SCI_1, and SSU input/output, bus control output, system clock output, external subclock input, and interrupt input pins. Port 5 has the following registers. • Port 5 data direction register (P5DDR) • Port 5 data register (P5DR) (1) Port 5 Data Direction Register (P5DDR) The individual bits of P5DDR specify input or output for the port 5 pins.
Section 8 I/O Ports (2) Port 5 Data Register (P5DR) P5DR stores output data for the port 5 pins. Bit Bit Name Initial Value R/W Description 7 P57DR 0 R/W 6 P56DR Undefined* R P5DR stores output data for the port 5 pins that are used as the general output port. 5 P55DR 0 R/W 4 P54DR 0 R/W 3 P53DR 0 R/W 2 P52DR 0 R/W 1 P51DR 0 R/W 0 P50DR 0 R/W Note: * If this register is read, the P5DR values are read for the bits with the corresponding P5DDR bits set to 1.
Section 8 I/O Ports • P56/EXCL/φ The pin function is switched as shown below according to the combination of the EXCLE bit in LPWRCR and the P56DDR bit. P56DDR 0 EXCLE Pin function 1 0 1 X P56 input pin EXCL input pin φ output pin [Legend] X: Don't care. • P55/IRQ13/SSI The pin function is switched as shown below according to the RE bit in SSER of the SSU and the P55DDR bit.
Section 8 I/O Ports • P53/IRQ11/RxD1 The pin function is switched as shown below according to the combination of the RE bit in SCR of SCI_1 and the P53DDR bit. When the ISS11 bit in ISSR16 is cleared to 0 and the IRQ11E bit in IER16 of the interrupt controller is set to 1, this pin can be used as the IRQ11 input pin. To use as the IRQ11 input pin, clear the P53DDR bit to 0. RE 0 P53DDR Pin function 1 0 1 X P53 input pin P53 output pin RxD1 input pin IRQ11 input pin [Legend] X: Don't care.
Section 8 I/O Ports • P51/IRQ9/RxDF The pin function is switched as shown below according to the combination of the enable/disable setting of the SCIF and the P51DDR bit. When the ISS9 bit in ISSR16 is cleared to 0 and the IRQ9E bit in IER16 of the interrupt controller is set to 1, this pin can be used as the IRQ9 input pin. To use as the IRQ9 input pin, clear the P51DDR bit to 0.
Section 8 I/O Ports 8.2.6 Port 6 Port 6 is an 8-bit I/O port. Port 6 pins can also function as the bidirectional data bus, PWMX output, SCIF and SSU control input/output, and interrupt input pins. The pin functions change according to the operating mode. In addition, port 6 pins can also be used as the extended data bus pins (D0 to D0). Port 6 has the following registers.
Section 8 I/O Ports (2) Port 6 Data Register (P6DR) P6DR stores output data for the port 6 pins. Bit Bit Name Initial Value R/W Description 7 P67DR 0 R/W 6 P66DR 0 R/W These bits store output data for the port 6 pins that are used as the general output port. 5 P65DR 0 R/W 4 P64DR 0 R/W If this register is read, the P6DR values are read for the bits with the corresponding P6DDR bits set to 1. For the bits with the corresponding P6DDR bits cleared to 0, the pin states are read.
Section 8 I/O Ports (3) Port 6 Pull-Up MOS Control Register (P6PCR) P6PCR controls the port 6 built-in input pull-up MOSs. Bit Bit Name Initial Value R/W Description 7 P67PCR 0 R/W • 6 P66PCR 0 R/W 5 P65PCR 0 R/W 4 P64PCR 0 R/W 3 P23PCR 0 R/W 2 P62PCR 0 R/W 1 P61PCR 0 R/W 0 P60PCR 0 R/W (4) Pin Functions (a) Normal Extended Mode Normal extended mode (16-bit bus) This register has no effect on operation.
Section 8 I/O Ports (c) Single-Chip Mode Port 6 pins can operate as the PWMX output, SCIF and SSU control input/output, interrupt input, or general I/O port pins. The relationship between register setting values and pin functions are as follows. • P67/ExIRQ8/SSCK The pin function is switched as shown below according to the SCKS bit in SSCRH of the SSU and the P67DDR bit. When the ISS8 bit in ISSR16 is set to 1, this pin can be used as the ExIRQ8 input pin.
Section 8 I/O Ports • P65/ExIRQ10/RTS The pin function is switched as shown below according to the combination of the enable/disable setting of the SCIF and the P65DDR bit. When the ISS10 bit in ISSR16 is set to 1, this pin can be used as the ExIRQ10 input pin. To use as the ExIRQ10 input pin, clear the P65DDR bit to 0. SCIF Disabled P65DDR Pin function Enabled 0 1 X P65 input pin P65 output pin RTS output pin IRQ10 input pin [Legend] X: Don't care.
Section 8 I/O Ports • P62/PWX2 The pin function is switched as shown below according to the combination of the OEA bit in DACR and the PWMXS bit in PTCNT0 of PWMX_1 and the P62DDR bit. P62DDR 0 1 X PWMXS 0 1 0 1 0 OEA 0 X 0 X 1 Pin function P62 input pin P62 output pin PWX2 output pin [Legend] X: Don't care. • P61/IRQ15/PWX1 The pin function is switched as shown below according to the combination of the OEB bit in DACR and the PWMXS bit in PTCNT0 of PWMX_0 and the P61DDR bit.
Section 8 I/O Ports (5) Port 6 Input Pull-Up MOS Port 6 has built-in input pull-up MOSs that can be controlled by software. Table 8.14 summarizes the input pull-up MOS states. Table 8.14 Port 6 Input Pull-Up MOS States Reset Hardware Standby Mode Software Standby Mode In Other Operations Off Off On/Off On/Off [Legend] Off: Always off. On/Off: On when input state, P6DDR = 0, and P6PCR = 1; otherwise off. Rev. 2.00 Aug.
Section 8 I/O Ports 8.2.7 Port 7 Port 7 is an 8-bit input port. Port 7 pins can also function as the A/D converter analog input pins. Port 7 has the following register. • Port 7 input data register (P7PIN) (1) Port 7 Input Data Register (P7PIN) P7PIN indicates the states of the port 7 pins. Bit Bit Name Initial Value R/W Description 7 P77PIN Undefined* R When this register is read, the pin states are read.
Section 8 I/O Ports (2) Pin Functions Each pin of port 7 can also be used as the analog input pins of the A/D converter (AN0 to AN7). • P77/AN7 The pin function is switched as shown below according to the CH2 to CH0 bits in ADCSR of the A/D converter. Do not set these bits to other values than those shown in the following table.
Section 8 I/O Ports • P74/AN4 The pin function is switched as shown below according to the combination of the SCANE bit in ADCR and the CH2 to CH0 bits in ADCSR of the A/D converter. Do not set these bits to other values than those shown in the following table.
Section 8 I/O Ports • P71/AN1 The pin function is switched as shown below according to the combination of the SCANE and SCANS bits in ADCR and the CH2 to CH0 bits in ADCSR of the A/D converter. Do not set these bits to other values than those shown in the following table.
Section 8 I/O Ports 8.2.8 Port 8 Port 8 is an 8-bit I/O port. Port 8 pins can also function as the A/D converter external trigger input, SCI_1 and SCI_3 input/output, IIC_0 and IIC_1 input/output, and interrupt input pins. Pins 83 to 80 perform the NMOS push-pull output. Port 8 has the following registers. • Port 8 data direction register (P8DDR) • Port 8 data register (P8DR) (1) Port 8 Data Direction Register (P8DDR) The individual bits of P8DDR specify input or output for the port 8 pins.
Section 8 I/O Ports (2) Port 8 Data Register (P8DR) P8DR stores output data for the port 8 pins. Bit Bit Name Initial Value R/W Description 7 P87DR 0 R/W 6 P86DR 0 R/W P8DR stores output data for the port 8 pins that are used as the general output port. 5 P85DR 0 R/W 4 P84DR 0 R/W 3 P83DR 0 R/W 2 P82DR 0 R/W 1 P81DR 0 R/W 0 P80DR 0 R/W (3) If this register is read, the P8DR values are read for the bits with the corresponding P8DDR bits set to 1.
Section 8 I/O Ports • P86/ExIRQ14/RxD3 The pin function is switched as shown below according to the combination of the RE bit in SCR of SCI_3, the SMIF bit in SCMR, and the P86DDR bit. When the ISS14 bit in ISSR16 is set to 1, this pin can be used as the ExIRQ14 input pin. To use this pin as the ExIRQ14 input pin, clear the P86DDR bit to 0.
Section 8 I/O Ports • P84/ExIRQ12/SCK3 The pin function is switched as shown below according to the combination of the C/A bit in SMR of SCI_3, the CKE1 and CKE0 bits in SCR, and the P84DDR bit. When the ISS12 bit in ISSR16 is set to 1, this pin can be used as the ExIRQ12 input pin. To use this pin as the ExIRQ12 input pin, clear the P84DDR bit to 0.
Section 8 I/O Ports • P82/SCL1 The pin function is switched as shown below according to the combination of the ICE bit in ICCR of IIC_1 and the P82DDR bit. When this pin is used as the P82 output pin, the output format is NMOS push-pull output. The output format for SCL1 is NMOS open-drain output, which allows direct bus drive. ICE 0 P82DDR Pin function 1 0 1 X P82 input pin P82 output pin SCL1 input/output pin [Legend] X: Don't care.
Section 8 I/O Ports 8.2.9 Port 9 Port 9 is an 8-bit I/O port. Port 9 pins can function as the bus control input/output pins. The pin functions change according to the operating mode. Port 9 has the following registers. • Port 9 data direction register (P9DDR) • Port 9 data register (P9DR) (1) Port 9 Data Direction Register (P9DDR) The individual bits of P9DDR specify input or output for the port 9 pins.
Section 8 I/O Ports (2) Port 9 Data Register (P9DR) P9DR stores output data for the port 9 pins. Bit Bit Name Initial Value R/W Description 7 P97DR 0 R/W 6 P96DR 0 R/W P9DR stores output data for the port 9 pins that are used as the general output port. 5 P95DR 0 R/W 4 P94DR 0 R/W 3 P93DR 0 R/W 2 P92DR 0 R/W 1 P91DR 0 R/W 0 P90DR 0 R/W (3) If this register is read, the P9DR values are read for the bits with the corresponding P9DDR bits set to 1.
Section 8 I/O Ports • P96 The pin function is switched as shown below according to the P96DDR bit. P96DDR Pin function 0 1 P96 input pin P96 output pin • P95/AS/IOS The pin function is switched as shown below according to the operating mode and the combination of the IOSE bit in SYSCR and the P95DDR bit. Operating mode Extended mode P95DDR X IOSE Pin function Single-chip mode 0 1 0 1 X X AS output pin IOS output pin P95 input pin P95 output pin [Legend] X: Don't care.
Section 8 I/O Ports • P92/HBE The pin function is switched as shown below according to the operating mode, the OBE bit in PTCNT0, and the P92DDR bit. Operating mode Extended mode OBE P92DDR Pin function 0 1 0 P92 input pin Single-chip mode 1 X X P92 output pin HBE output pin 0 1 P92 input pin P92 output pin [Legend] X: Don't care. • P91/AH The pin function is switched as shown below according to the operating mode, the ADMXE bit in SYSCR2, and the P91DDR bit.
Section 8 I/O Ports 8.2.10 Port A Port A is an 8-bit I/O port. Port A pins can also function as the address output, event counter input, interrupt input, and EtherC control input/output pins. Port A has the following registers. PADDR and PAPIN are allocated to the same address.
Section 8 I/O Ports (2) Port A Output Data Register (PAODR) PAODR stores output data for the port A pins. Bit Bit Name Initial Value R/W Description 7 PA7ODR 0 R/W 6 PA6ODR 0 R/W PAODR stores output data for the port A pins that are used as the general output port. 5 PA5ODR 0 R/W 4 PA4ODR 0 R/W 3 PA3ODR 0 R/W 2 PA2ODR 0 R/W 1 PA1ODR 0 R/W 0 PA0ODR 0 R/W (3) Port A Input Data Register (PAPIN) PAPIN indicates the states of the port A pins.
Section 8 I/O Ports (4) Pin Functions The relationship between the operating mode, register setting values, and pin functions are as follows. (a) Normal Extended Mode Port A pins can function as address output, interrupt input, event counter input, EtherC control input/output, or I/O port pins, and input or output can be specified in bit units.
Section 8 I/O Ports • PA6/ExIRQ6/EVENT6/A22/LNKSTA The pin function is switched as shown below according to the setting of address 18 and the PA6DDR bit. Setting the ISS6 bit in ISSR makes the pin to function as the ExIRQ6 input pin. When using the pin as the ExIRQ6 input, or an EVENT input pin, clear the PA6DDR bit to 0. Though the settings for the EVENT input pin have been made, set the PA6DDR bit to 1 when using the pin as the PA6 or A22 output pin.
Section 8 I/O Ports • PA4/ExIRQ4/EVENT4/A20, PA3/ExIRQ3/EVENT3/A19, PA2/ExIRQ2/EVENT2/A18 The pin function is switched as shown below according to the setting of address 18 and the PAnDDR bit. Setting the ISSn bit in ISSR makes the pin to function as the ExIRQn input pin. When using the pin as the ExIRQn input or an EVENT input pin, clear the PAnDDR bit to 0. Though the settings for the EVENT input pin have been made, set the PAnDDR bit to 1 when using the pin as the PAn or Am output pin.
Section 8 I/O Ports (b) Single-Chip Mode and Address-Data Multiplex Extended Mode Port A pins can also function as interrupt input, EtherC control input/output, and event counter input pins. • PA7/ExIRQ7/EVENT7/EXOUT The pin function is switched as shown below according to the PA7DDR bit. Setting the ISS7 bit in ISSR makes the pin to function as the ExIRQ7 input pin. When using this pin as the ExIRQ7 input or EVENT7 input pin, clear the PA7DDR bit to 0.
Section 8 I/O Ports • PA5/ExIRQ5/EVENT5/WOL The pin function is switched as shown below according to the setting of the and the PA5DDR bit. Setting the ISS5 bit in ISSR makes the pin to function as the ExIRQ5 input pin. When using this pin as the ExIRQ5 input, or EVENT5 input pin, clear the PA5DDR bit to 0. Though the settings for the EVENT input pin have been made, set the PA5DDR bit to 1 to use the pin as the PA5 output pin.
Section 8 I/O Ports The input pull-up MOS is in the off state after a reset and in hardware standby mode. The prior state is retained in software standby mode. Table 8.15 summarizes the input pull-up MOS states. Table 8.15 Input Pull-Up MOS States Reset Hardware Standby Mode Software Standby Mode In Other Operations Off Off On/Off On/Off [Legend] Off: Always off. On/Off: On when PADDR = 0 and PAODR = 1; otherwise off. Rev. 2.00 Aug.
Section 8 I/O Ports 8.2.11 Port B Port B is an 8-bit I/O port. Port B pins can also function as the event counter input, de-bounced input, and EtherC control input/output pins. The pin functions change according to the operating mode. Port B has the following registers.
Section 8 I/O Ports (2) Port B Output Data Register (PBODR) PBDR stores output data for the port B pins. Bit Bit Name Initial Value R/W Description 7 PB7DR 0 6 PB6DR 0 R/W PBODR stores output data for the port B pins that are used as the general output port. R/W 5 PB5DR 0 R/W 4 PB4DR 0 R/W 3 PB3DR 0 R/W 2 PB2DR 0 R/W 1 PB1DR 0 R/W 0 PB0DR 0 R/W (3) Port B Input Data Register (PBPIN) PBPIN indicates the states of the port B pins.
Section 8 I/O Ports (4) Noise Canceler Enable Register (P4BNCE) P4BNCE enables or disables the noise canceler circuits of port 4 and port B pins in bit units. Bit Initial Value R/W Description 7 to 4 P47NCE to P44NCE All 0 R/W Bits for port 4 setting 3 PB3NCE 0 2 PB2NCE 0 1 PB1NCE 0 0 PB0NCE 0 R/W Enables the noise canceler circuit for the corresponding pin and the pin state is fetched into PBDR at the R/W sampling cycle set by NCCS.
Section 8 I/O Ports (6) Noise Canceler Cycle Setting Register (NCCS) NCCS controls the sampling cycle of the noise cancelers. Bit Bit Name Initial Value R/W Description 7 to 3 Undefined R/W Reserved 2 NCCK2 0 1 NCCK1 0 R/W These bits set the sampling cycle of the noise R/W cancelers. 0 NCCK0 0 R/W • Undefined value is read from these bits. When φ = 34 MHz 000: 0.06 µs φ/2 100: 963.8 µs φ/32768 001: 0.94 µs φ/32 101: 1.9 ms φ/65536 010: 15.1 µs φ/512 110: 3.
Section 8 I/O Ports PBn input 1 expected PBnDR 0 expected PBnDR (n = 3 to 0) Figure 8.12 Noise Canceler Operation (7) Pin Functions • PB7/EVENT15/RM_RX-ER, PB6/EVENT14/RM_CRS-DV, PB5/EVENT13/RM_REF-CLK PB4/EVENT12/RM_TX-EN The pin function is switched as shown below according to the PBnDDR bit. When using this pin as the EVENT input pin, clear the PBnDDR bit to 0. These pins can be used as EtherC I/O pins when the EtherC is enabled.
Section 8 I/O Ports • PB3/EVENT11/DB3/RM_RXD1, PB2/EVENT10/DB2/RM_RXD0, PB1/EVENT9/DB1/RM_TXD1, PB0/EVENT8/DB0/RM_TXD0 The pin function is switched as shown below according to the combination of the module stop state in the EtherC and E-DMAC and the PBnDDR bit.
Section 8 I/O Ports 8.2.12 Port C Port C is an 8-bit I/O port. Port C pins can also function as the bus control output, and IIC_2, IIC_3, and IIC_4 input/output pins. The output format of ports C0 to C5 is NMOS push-pull output. Port C has the following registers. • Port C data direction register (PCDDR) • Port C output data register (PCODR) • Port C input data register (PCPIN) (1) Port C Data Direction Register (PCDDR) The individual bits of PCDDR specify input or output for the port C pins.
Section 8 I/O Ports (2) Port C Output Data Register (PCODR) PCODR stores output data for the port C pins. Bit Bit Name Initial Value R/W Description 7 PC7ODR 0 R/W 6 PC6ODR 0 R/W The PCODR register stores the output data for the pins that are used as the general output port. 5 PC5ODR 0 R/W 4 PC4ODR 0 R/W 3 PC3ODR 0 R/W 2 PC2ODR 0 R/W 1 PC1ODR 0 R/W 0 PC0ODR 0 R/W (3) Port C Input Data Register (PCPIN) PCPIN indicates the pin states of port C.
Section 8 I/O Ports (4) Pin Functions (a) Normal Extended Mode and Address-Data Multiplex Extended Mode Port C pins can also function as the bus control output and IIC_2, IIC_3, and IIC_4 input/output pins. The relationship between register setting values and pin functions are as follows. • PC7 The PC7 pin functions as a bus control output pin. • PC6 When set for 16-bit bus width, the PC7 pin functions as a bus control output pin.
Section 8 I/O Ports (b) Single-Chip Mode • PC7, PC6 The pin function is switched as shown below according to the PCnDDR bit. PCnDDR Pin function 0 1 PCn input pin PCn output pin [Legend] n = 7, 6 • PC5/SDA4 The pin function is switched as shown below according to the combination of the ICE bit in ICCR of the IIC_4 and the PC5DDR bit. ICE 0 PC5DDR Pin function 1 0 1 X PC5 input pin PC5 output pin SDA4 input/output pin [Legend] X: Don't care.
Section 8 I/O Ports • PC2/SCL3 The pin function is switched as shown below according to the combination of the ICE bit in ICCR of the IIC_3 and the PC2DDR bit. ICE 0 PC2DDR Pin function [Legend] 1 0 1 X PC2 input pin PC2 output pin SCL3 input/output pin X: Don't care. • PC1/SDA2 The pin function is switched as shown below according to the combination of the ICE bit in ICCR of the IIC_2 and the PC1DDR bit.
Section 8 I/O Ports 8.2.13 Port D Port D is an 8-bit I/O port. Port D pins can also function as the IIC_5 input/output and LPC input/output pins. The output format of PD7 and PD6 pins is NMOS push-pull output. Port D has the following registers. • Port D data direction register (PDDDR) • Port D output data register (PDODR) • Port D input data register (PDPIN) (1) Port D Data Direction Register (PDDDR) The individual bits of PDDDR specify input or output for the port D pins.
Section 8 I/O Ports (2) Port D Output Data Register (PDODR) PDODR stores output data for the port D pins. Bit Bit Name Initial Value R/W Description 7 PD7ODR 0 R/W 6 PD6ODR 0 R/W The PCODR register stores the output data for the pins that are used as the general output port. 5 PD5ODR 0 R/W 4 PD4ODR 0 R/W 3 PD3ODR 0 R/W 2 PD2ODR 0 R/W 1 PD1ODR 0 R/W 0 PD0ODR 0 R/W (3) Port D Input Data Register (PDPIN) PDPIN indicates the pin states of port D.
Section 8 I/O Ports (4) Pin Functions Port D pins can also function as the LPC input/output and IIC_5 input/output pins. The relationship between register setting values and pin functions are as follows. The LPC is disabled when all of the bits LPC1E, LPC2E, and LPC3E in HICR0 and SCIFE in HICR5 are cleared to 0. • PD7/SDA5 The pin function is switched as shown below according to the combination of the ICE bit in ICCR of the IIC_5 and the PD7DDR bit.
Section 8 I/O Ports • PD4/CLKRUN The pin function is switched as shown below according to the PD4DDR bit. This pin can be used as the CLKRUN input pin when the LPC is enabled. LPC PD4DDR Pin function Disabled Enabled 0 1 0 PD4 input pin PD4 output pin CLKRUN input/output pin • PD3/GA20 The pin function is switched as shown below according to the combination of the FGA20E bit in HICR0 of the LPC and the PD3DDR bit.
Section 8 I/O Ports • PD0/LSCI The pin function is switched as shown below according to the combination of the LSCIE bit in HICR0 of the LPC and the PD0DDR bit. LSCIE 0 PD0DDR Pin function (5) 1 0 1 0 PD0 input pin PD0 output pin LSCI output pin Input Pull-Up MOS Port pins D5 to D0 have built-in input pull-up MOSs that can be controlled by software. This input pull-up MOS can be used in any operating mode, and can be specified as on or off on a bit-by-bit basis.
Section 8 I/O Ports 8.2.14 Port E Port E is an 8-bit I/O port. Port E pins can also function as the LPC input/output pins. Port E has the following registers. • Port E data direction register (PEDDR) • Port E output data register (PEODR) • Port E input data register (PEPIN) (1) Port E Data Direction Register (PEDDR) The individual bits of PEDDR specify input or output for the port E pins.
Section 8 I/O Ports (2) Port E Output Data Register (PEODR) PEODR stores output data for the port E pins. Bit Bit Name Initial Value R/W Description 7 PE7ODR 0 R/W 6 PE6ODR 0 R/W The PEODR register stores the output data for the pins that are used as the general output port. 5 PE5ODR 0 R/W 4 PE4ODR 0 R/W 3 PE3ODR 0 R/W 2 PE2ODR 0 R/W 1 PE1ODR 0 R/W 0 PE0ODR 0 R/W (3) Port E Input Data Register (PEPIN) PEPIN indicates the pin states of port E.
Section 8 I/O Ports (4) Pin Functions Port E pins can also function as LPC input/output pins. The pin function is switched according to whether the LPC module is enabled or disabled. The LPC is disabled when all of the bits LPC1E, LPC2E, and LPC3E in HICR0 and SCIFE in HICR5 are cleared to 0. • PE7/SERIRQ The pin function is switched as shown below according to whether the LPC is enabled or disabled and the PE7DDR bit.
Section 8 I/O Ports • PE4/LFRAME The pin function is switched as shown below according to whether the LPC is enabled or disabled and the PE4DDR bit. LPC Disabled PE4DDR Pin function [Legend] Enabled 0 1 X PE4 input pin PE4 output pin LFRAME input pin X: Don't care. • PE3/LAD3 The pin function is switched as shown below according to whether the LPC is enabled or disabled and the PE3DDR bit.
Section 8 I/O Ports • PE0/LAD0 The pin function is switched as shown below according to whether the LPC is enabled or disabled and the PE0DDR bit. LPC Disabled PE0DDR Pin function [Legend] 0 1 X PE0 input pin PE0 output pin LAD0 input/output pin X: Don't care. Rev. 2.00 Aug.
Section 8 I/O Ports 8.2.15 Port F Port F is a 3-bit I/O port. Port F pins can also function as the PWMX output and EtherC control I/O pins. Port F has the following registers. • Port F data direction register (PFDDR) • Port F output data register (PFODR) • Port F input data register (PFPIN) (1) Port F Data Direction Register (PFDDR) The individual bits of PFDDR specify input or output for the port F pins.
Section 8 I/O Ports (2) Port F Output Data Register (PFODR) PFODR stores output data for the port F pins. PEODR is initialized only by a system reset, and retains the value even if an internal reset signal of the WDT is generated. Bit Bit Name Initial Value R/W Description 7 Reserved Undefined value is read from this bit. 6 PF6ODR 5 to 2 0 R/W Stores the output data for the pin that is used as the general output port. Reserved Undefined values are read from these bits.
Section 8 I/O Ports (4) Pin Functions Port F is a 3-bit I/O port. Port F pins can also function as PWMX output pins and EtherC control I/O pins. The relationship between the register settings and the pin function is shown below. • PF6/ExPWX2/RS14 The pin function is switched as shown below according to the combination of the OEA bit in DACR, the PWMXS bit in PTCNT0 of PWMX_1, and the PF6DDR bit.
Section 8 I/O Ports 8.3 Change of Peripheral Function Pins The pin function assignments for the external interrupt inputs and 14-bit PWM timer outputs can be changed between multiplexed I/O ports. I/O port pins for external interrupt inputs are changed by the setting of ISSR16 and ISSR. I/O port pins for 14-bit PWM timer outputs are changed by the setting of PTCNT0.
Section 8 I/O Ports • ISSR Bit Bit Name Initial Value R/W Description 7 ISS7 0 R/W 0: P47/IRQ7 is selected 1: PA7/ExIRQ7 is selected 6 ISS6 0 R/W 0: P46/IRQ6 is selected 1: PA6/ExIRQ6 is selected 5 ISS5 0 R/W 0: P45/IRQ5 is selected 1: PA5/ExIRQ5 is selected 4 ISS4 0 R/W 0: P44/IRQ4 is selected 1: PA4/ExIRQ4 is selected 3 ISS3 0 R/W 0: P43/IRQ3 is selected 1: PA3/ExIRQ3 is selected 2 ISS2 0 R/W 0: P42/IRQ2 is selected 1: PA2/ExIRQ2 is selected 1 ISS1 0 R/W 0 ISS0 0
Section 8 I/O Ports 8.3.2 Port Control Register 0 (PTCNT0) PTCNT0 selects pins for 14-bit PWM timer outputs and the control mode for external extension. Bit Bit Name Initial Value 7 SCPFSEL1 0 R/W Description R/W Controls the internal connection of TxD1 and RxD1 with the SCI_1 as the smart card interface. 0: TxD1 and RxD1 are not internally connected. 1: TxD1 and RxD1 are internally connected.
Section 9 14-Bit PWM Timer (PWMX) Section 9 14-Bit PWM Timer (PWMX) This LSI has an on-chip 14-bit pulse-width modulator (PWM) timer with four output channels. It can be connected to an external low-pass filter to operate as a 14-bit D/A converter. 9.1 Features • Division of pulse into multiple base cycles to reduce ripple • Eight resolution settings The resolution can be set to 1, 2, 64, 128, 256, 1024, 4096, or 16384 system clock cycles.
Section 9 14-Bit PWM Timer (PWMX) 9.2 Input/Output Pins Table 9.1 lists the PWMX (D/A) module input and output pins. Table 9.1 Pin Configuration Name Abbreviation I/O Function PWMX output pin 0 PWX0 Output PWM timer pulse output of PWMX_0 channel A PWMX output pin 1 PWX1 Output PWM timer pulse output of PWMX_0 channel B PWMX output pin 2 PWX2 Output PWM timer pulse output of PWMX_1 channel A PWMX output pin 3 PWX3 Output PWM timer pulse output of PWMX_1 channel B 9.
Section 9 14-Bit PWM Timer (PWMX) 9.3.1 PWMX (D/A) Counter (DACNT) DACNT is a 14-bit readable/writable up-counter. The input clock is selected by the clock select bit (CKS) in DACR. DACNT functions as the time base for both PWMX (D/A) channels. When a channel operates with 14-bit precision, it uses all DACNT bits. When a channel operates with 12bit precision, it uses the lower 12 bits and ignores the upper two bits. DACNT cannot be accessed in 8-bit units. DACNT should always be accessed in 16-bit units.
Section 9 14-Bit PWM Timer (PWMX) 9.3.2 PWMX (D/A) Data Registers A and B (DADRA and DADRB) DADRA corresponds to PWMX (D/A) channel A, and DADRB to PWMX (D/A) channel B. The DADR registers cannot be accessed in 8-bit units. The DADR registers should always be accessed in 16-bit units. For details, see section 9.4, Bus Master Interface. • DADRA Bit Bit Name Initial Value 15 to 2 DA13 to DA0 All 1 R/W Description R/W D/A Data 13 to 0 These bits set a digital value to be converted to an analog value.
Section 9 14-Bit PWM Timer (PWMX) • DADRB Bit Bit Name Initial Value 15 to 2 DA13 to DA0 All 1 R/W Description R/W D/A Data 13 to 0 These bits set a digital value to be converted to an analog value. In each base cycle, the DACNT value is continually compared with the DADR value to determine the duty cycle of the output waveform, and to decide whether to output a fine-adjustment pulse equal in width to the resolution.
Section 9 14-Bit PWM Timer (PWMX) 9.3.3 PWMX (D/A) Control Register (DACR) DACR enables the PWM outputs, and selects the output phase and operating speed. Bit Bit Name Initial Value R/W Description 7 0 R/W Reserved 6 PWME 0 R/W The initial value should not be changed. PWMX Enable Starts or stops the PWM D/A counter (DACNT). 0: DACNT operates as a 14-bit up-counter 1: DACNT halts at H'0003 5, 4 All 1 R Reserved These bits are always read as 1 and cannot be modified.
Section 9 14-Bit PWM Timer (PWMX) 9.3.4 Peripheral Clock Select Register (PCSR) PCSR and the CKS bit of DACR select the operating speed. Bit Bit Name Initial Value R/W Description 7 PWCKX1B 0 R/W PWMX_1 Clock Select 6 PWCKX1A 0 R/W These bits select a clock cycle with the CKS bit of DACR of PWMX_1 being 1. See table 9.2. 5 PWCKX0B 0 R/W PWMX_0 Clock Select 4 PWCKX0A 0 R/W These bits select a clock cycle with the CKS bit of DACR of PWMX_0 being 1. See table 9.2.
Section 9 14-Bit PWM Timer (PWMX) 9.4 Bus Master Interface DACNT, DADRA, and DADRB are 16-bit registers. The data bus linking the bus master and the on-chip peripheral modules, however, is only 8 bits wide. When the bus master accesses these registers, it therefore uses an 8-bit temporary register (TEMP). These registers are written to and read from as follows. • Write When the upper byte is written to, the upper-byte write data is stored in TEMP.
Section 9 14-Bit PWM Timer (PWMX) 9.5 Operation A PWM waveform like the one shown in figure 9.2 is output from the PWX pin. DA13 to DA0 in DADR corresponds to the total width (TL) of the low (0) pulses output in one conversion cycle (256 pulses when CFS = 0, 64 pulses when CFS = 1). When OS = 0, this waveform is directly output. When OS = 1, the output waveform is inverted, and DA13 to DA0 in DADR value corresponds to the total width (TH) of the high (1) output pulses. Figures 9.3 and 9.
Section 9 14-Bit PWM Timer (PWMX) Settings and Operation (Examples when φ = 34 MHz) Table 9.3 PCSR Fixed DADR Bits ResoConver- B A CKS (µs) CFS Cycle 0 0 C 0.03 (φ) 1.88 µs Bit Data sion TL/TH Precision Cycle (OS = 0/OS = 1) (Bits) 481.88 µs Always low/high output DA13 to 0 = H'0000 to H'00FF 531.3 kHz (Data value) × T DA13 to 0 = H'0100 to H'3FFF 1 7.53 µs 481.88 µs Always low/high output DA13 to 0 = H'0000 to H'003F 132.8 kHz 0 0 0 1 0.06 0 (φ/2) 3.
Section 9 14-Bit PWM Timer (PWMX) PCSR Fixed DADR Bits ResoConver- C B A CKS (µs) CFS Cycle 0 1 1 1 0 7.53 (φ/256) 481.9 µs sion Cycle Bit Data TL/TH Precision (OS = 0/OS = 1) (Bits) 123.36 ms Always low/high output (Data value) × T DA13 to 0 = H'0100 to H'3FFF 1 1927.5 µs 123.36 ms Always low/high output (Data value) × T DA13 to 0 = H'0040 to H'3FFF 1 0 0 1 30.12 0 (φ/1024) 1.93 ms 493.45 ms Always low/high output (Data value) × T DA13 to 0 = H'0100 to H'3FFF 1 7.
Section 9 14-Bit PWM Timer (PWMX) 1 conversion cycle tf1 tL1 tf2 tf255 tL2 tL3 tL255 tf256 tL256 tf1 = tf2 = tf3 = ··· = tf255 = tf256 = T× 64 tL1 + tL2 + tL3+ ··· + tL255 + tL256 = TL a. CFS = 0 [base cycle = resolution (T) × 64] 1 conversion cycle tf1 tL1 tf2 tL2 tf63 tL3 tL63 tf64 tL64 tf1 = tf2 = tf3 = ··· = tf63 = tf64 = T× 256 tL1 + tL2 + tL3 + ··· + tL63 + tL64 = TL b. CFS = 1 [base cycle = resolution (T) × 256] Figure 9.3 Output Waveform (OS = 0, DADR corresponds to TL) Rev. 2.
Section 9 14-Bit PWM Timer (PWMX) 1 conversion cycle tf1 tH1 tf2 tf255 tH2 tH3 tf256 tH255 tH256 tf1 = tf2 = tf3 = ··· = tf255 = tf256 = T× 64 tH1 + tH2 + tH3 + ··· + tH255 + tH256 = TH a. CFS = 0 [base cycle = resolution (T) × 64] 1 conversion cycle tf1 tH1 tf2 tf63 tH2 tH3 tf64 tH63 tH64 tf1 = tf2 = tf3 = ··· = tf63 = tf64 = T× 256 tH1 + tH2 + tH3 + ··· + tH63 + tH64 = TH b. CFS = 1 [base cycle = resolution (T) × 256] Figure 9.
Section 9 14-Bit PWM Timer (PWMX) Since the value of the subsequent six bits is B'0000 01, an additional pulse is output only at the location of base pulse No. 63 according to table 9.4. Thus, an additional pulse of 1/256 × (T) is to be added to the base pulse. 1 conversion cycle Base cycle No. 0 Base cycle Base cycle No. 1 No. 63 Base pulse High width: 2/256 × (T) Additional pulse output location Base pulse 2/256 × (T) Additional pulse 1/256 × (T) Figure 9.
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Lower 6 bits 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0
Section 9 14-Bit PWM Timer (PWMX) Rev. 2.00 Aug.
Section 10 16-Bit Free-Running Timer (FRT) Section 10 16-Bit Free-Running Timer (FRT) This LSI has a 16-bit free-running timer (FRT). 10.1 Features • Selection of four clock sources One of the three internal clocks (φ/2, φ/8, or φ/32) can be selected. • Two independent comparators • Counter clearing The free-running counters can be cleared on compare-match A. • Three independent interrupts Two compare-match interrupts and one overflow interrupt can be requested independently.
Section 10 16-Bit Free-Running Timer (FRT) Figure 10.1 is a block diagram of the FRT.
Section 10 16-Bit Free-Running Timer (FRT) 10.2 Register Descriptions The FRT has the following registers. • Free-running counter (FRC) • Output compare register A (OCRA) • Output compare register B (OCRB) • Output compare register AR (OCRAR) • Output compare register AF (OCRAF) • Timer interrupt enable register (TIER) • Timer control/status register (TCSR) • Timer control register (TCR) • Timer output compare control register (TOCR) Note: OCRA and OCRB share the same address.
Section 10 16-Bit Free-Running Timer (FRT) 10.2.3 Output Compare Registers AR and AF (OCRAR and OCRAF) OCRAR and OCRAF are 16-bit readable/writable registers. They are accessed when the ICRS bit in TOCR is set to 1. When the OCRAMS bit in TOCR is set to 1, the operation of OCRA is changed to include the use of OCRAR and OCRAF. The contents of OCRAR and OCRAF are automatically added alternately to OCRA, and the result is written to OCRA.
Section 10 16-Bit Free-Running Timer (FRT) 10.2.4 Timer Interrupt Enable Register (TIER) TIER enables and disables interrupt requests. Bit Bit Name Initial Value R/W 7 to 4 All 0 R Description Reserved These bits are always read as 0 and cannot be modified. 3 OCIAE 0 R/W Output Compare Interrupt A Enable Selects whether to enable output compare interrupt A request (OCIA) when output compare flag A (OCFA) in TCSR is set to 1.
Section 10 16-Bit Free-Running Timer (FRT) 10.2.5 Timer Control/Status Register (TCSR) TCSR is used for counter clear selection and control of interrupt request signals. Bit Bit Name Initial Value R/W 7 to 4 All 0 R Description Reserved These bits are always read as 0 and cannot be modified. 3 OCFA 0 R/(W)* Output Compare Flag A Indicates that the FRC value matches the OCRA value.
Section 10 16-Bit Free-Running Timer (FRT) 10.2.6 Timer Control Register (TCR) TCR selects the rising or falling edge of the input capture signals, enables the input capture buffer mode, and selects the FRC clock source. Bit Bit Name Initial Value R/W Description 7 to 2 All 0 R Reserved 1 CKS1 0 R/W Clock Select 1 and 0 0 CKS0 0 R/W Select clock source for FRC. These bits are always read as 0 and cannot be modified.
Section 10 16-Bit Free-Running Timer (FRT) 10.2.7 Timer Output Compare Control Register (TOCR) TOCR enables output from the output compare pins, selects the output levels, switches access between output compare registers A and B, and controls the OCRA operating modes. Bit Bit Name Initial Value R/W Description 7 0 R Reserved 6 OCRAMS 0 R/W This bit is always read as 0 and cannot be modified.
Section 10 16-Bit Free-Running Timer (FRT) 10.3 Operation Timing 10.3.1 FRC Increment Timing Figure 10.2 shows the FRC increment timing with an internal clock source. φ Internal clock FRC input clock FRC N–1 N N+1 Figure 10.2 Increment Timing with Internal Clock Source 10.3.2 Output Compare Output Timing A compare-match signal occurs at the last state when the FRC and OCR values match (at the timing when the FRC updates the counter value). Figure 10.
Section 10 16-Bit Free-Running Timer (FRT) 10.3.3 FRC Clear Timing FRC can be cleared when compare-match A occurs. Figure 10.4 shows the timing of this operation. φ Compare-match A signal FRC N H'0000 Figure 10.4 Clearing of FRC by Compare-Match A Signal 10.3.4 Timing of Output Compare Flag (OCF) Setting The output compare flag, OCFA or OCFB, is set to 1 by a compare-match signal generated when the FRC value matches the OCRA or OCRB value.
Section 10 16-Bit Free-Running Timer (FRT) 10.3.5 Timing of FRC Overflow Flag (OVF) Setting The FRC overflow flag (OVF) is set to 1 when FRC overflows (changes from H'FFFF to H'0000). Figure 10.6 shows the timing of setting the OVF flag. φ FRC H'FFFF H'0000 Overflow signal OVF Figure 10.6 Timing of Overflow Flag (OVF) Setting Rev. 2.00 Aug.
Section 10 16-Bit Free-Running Timer (FRT) 10.3.6 Automatic Addition Timing When the OCRAMS bit in TOCR is set to 1, the contents of OCRAR and OCRAF are automatically added to OCRA alternately, and when an OCRA compare-match occurs, a write to OCRA is performed. Figure 10.7 shows the OCRA write timing. φ FRC N N +1 OCRA N N+A OCRAR, OCRAF A Compare-match signal Figure 10.7 OCRA Automatic Addition Timing 10.
Section 10 16-Bit Free-Running Timer (FRT) 10.5 Usage Notes 10.5.1 Conflict between FRC Write and Clear If an internal counter clear signal is generated during the state after an FRC write cycle, the clear signal takes priority and the write is not performed. Figure 10.8 shows the timing for this type of conflict. Write cycle of FRC T1 T2 φ Address FRC address Internal write signal Counter clear signal FRC N H'0000 Figure 10.8 Conflict between FRC Write and Clear Rev. 2.00 Aug.
Section 10 16-Bit Free-Running Timer (FRT) 10.5.2 Conflict between FRC Write and Increment If an FRC increment pulse is generated during the state after an FRC write cycle, the write takes priority and FRC is not incremented. Figure 10.9 shows the timing for this type of conflict. Write cycle of FRC T1 T2 φ Address FRC address Internal write signal FRC input clock FRC N M Write data Figure 10.9 Conflict between FRC Write and Increment Rev. 2.00 Aug.
Section 10 16-Bit Free-Running Timer (FRT) 10.5.3 Conflict between OCR Write and Compare-Match If a compare-match occurs during the state after an OCRA or OCRB write cycle, the write takes priority and the compare-match signal is disabled. Figure 10.10 shows the timing for this type of conflict.
Section 10 16-Bit Free-Running Timer (FRT) φ Address OCRAR (OCRAF) address Internal write signal OCRAR (OCRAF) Compare-match signal Old data New data Disabled FRC N OCR N N+1 Automatic addition is not performed because compare-match signals are disabled. Figure 10.11 Conflict between OCR Write and Compare-Match (When Automatic Addition Function is Used) 10.5.4 Switching of Internal Clock and FRC Operation When the internal clock is changed, the changeover may source FRC to increment.
Section 10 16-Bit Free-Running Timer (FRT) Table 10.2 Switching of Internal Clock and FRC Operation No.
Section 10 16-Bit Free-Running Timer (FRT) No. 4 Timing of Switchover by Means of CKS1 and CKS0 Bits Switching from high to high FRC Operation Clock before switchover Clock after switchover FRC clock FRC N N+1 N+2 CKS bit rewrite Note: * Generated because the switchover is assumed to take place on a falling edge, and FRC is incremented. Rev. 2.00 Aug.
Section 11 8-Bit Timer (TMR) Section 11 8-Bit Timer (TMR) This LSI has two channels of 8-bit timer modules (TMR_0 and TMR_1) which operate on the 8bit counter. This LSI also has two channels of similar 8-bit timer modules (TMR_Y and TMR_X). 11.1 Features • Selection of clock sources TMR_0, TMR_1: The counter input clock can be selected from six internal clocks. TMR_Y, TMR_X: The counter input clock can be selected from three internal clocks.
Section 11 8-Bit Timer (TMR) Figures 11.1 and 11.2 are block diagrams of 8-bit timers.
Section 11 8-Bit Timer (TMR) Internal clock TMR_X φ, φ/2, φ/4 TMR_Y φ/4, φ/256, φ/2048 Clock X Clock Y Select clock Compare match AX Compare match AY TCORA_Y TCORA1_X Comparator A_Y Comparator A_X TCNT_Y TCNT_X Overflow X Overflow Y Clear Y Control logic Compare match BX Compare match BY Internal bus Clear X Comparator B_Y Comparator B_X TCORB_Y TCORB_X TCOR_Y TCSR_X TCR_Y TCR_X Interrupt signals [Legend] TCORA_Y: TCORB_Y: TCNT_Y: TCSR_Y: TCR_Y: CMIAX CMIBX OVIX CMIAY CMIBY OVIY Ti
Section 11 8-Bit Timer (TMR) 11.2 Register Descriptions The TMR has the following registers for each channel. For details on the serial timer control register, see section 3.2.3, Serial Timer Control Register (STCR). • Timer counter (TCNT) • Time constant register A (TCORA) • Time constant register B (TCORB) • Timer control register (TCR) • Timer control/status register (TCSR) • Timer connection register S (TCONRS)* Notes: Some of the registers of TMR_X and TMR_Y use the same address.
Section 11 8-Bit Timer (TMR) 11.2.2 Time Constant Register A (TCORA) TCORA is an 8-bit readable/writable register. TCORA_0 and TCORA_1 comprise a single 16-bit register, so they can be accessed together by word access. TCORA is continually compared with the value in TCNT. When a match is detected, the corresponding compare-match flag A (CMFA) in TCSR is set to 1. However, comparison is disabled during the T2 state of a TCORA write cycle. TCORA is initialized to H'FF.
Section 11 8-Bit Timer (TMR) 11.2.4 Timer Control Register (TCR) TCR selects the TCNT clock source and the condition by which TCNT is cleared, and enables/disables interrupt requests. TCR_Y can be accessed when the TMRX/Y bit in TCONRS is 1. TCR_X can be accessed when the TMRX/Y bit in TCONRS is 0. See section 11.2.6, Timer Connection Register S (TCONRS).
Section 11 8-Bit Timer (TMR) Table 11.
Section 11 8-Bit Timer (TMR) Table 11.
Section 11 8-Bit Timer (TMR) 11.2.5 Timer Control/Status Register (TCSR) TCSR indicates the status flags and controls compare-match output. See section 11.2.6, Timer Connection Register S (TCONRS) for details on the TCSR_Y and TCSR_X accesses.
Section 11 8-Bit Timer (TMR) • TCSR_1 Bit Bit Name Initial Value R/W 7 CMFB 0 R/(W)* Compare-Match Flag B Description [Setting condition] When the values of TCNT_1 and TCORB_1 match [Clearing condition] Read CMFB when CMFB = 1, then write 0 in CMFB 6 CMFA 0 R/(W)* Compare-Match Flag A [Setting condition] When the values of TCNT_1 and TCORA_1 match [Clearing condition] Read CMFA when CMFA = 1, then write 0 in CMFA 5 OVF 0 R/(W)* Timer Overflow Flag [Setting condition] When TCNT_1 overflows f
Section 11 8-Bit Timer (TMR) • TCSR_Y This register can be accessed when the TMRX/Y bit in TCONRS is 1.
Section 11 8-Bit Timer (TMR) • TCSR_X This register can be accessed when the TMRX/Y bit in TCONRS is 0.
Section 11 8-Bit Timer (TMR) 11.2.6 Timer Connection Register S (TCONRS) TCONRS selects whether to access TMR_X or TMR_Y registers. Bit Bit Name Initial Value R/W Description 7 TMRX/Y 0 R/W TMR_X/TMR_Y Access Select For details, see table 11.2. 0: The TMR_X registers are accessed at addresses H'FFFFF0 to H'FFFFF5 1: The TMR_Y registers are accessed at addresses H'FFFFF0 to H'FFFFF5 6 to 0 All 0 R/W Reserved The initial values should not be changed. Table 11.
Section 11 8-Bit Timer (TMR) 11.3 Operation Timing 11.3.1 TCNT Count Timing Figure 11.3 shows the TCNT count timing with an internal clock source. φ External clock input pin TCNT input clock TCNT N–1 N N+1 Figure 11.3 Count Timing for Internal Clock Input 11.3.2 Timing of CMFA and CMFB Setting at Compare-Match The CMFA and CMFB flags in TCSR are set to 1 by a compare-match signal generated when the TCNT and TCOR values match.
Section 11 8-Bit Timer (TMR) 11.3.3 Timing of Counter Clear at Compare-Match TCNT is cleared when compare-match A or compare-match B occurs, depending on the setting of the CCLR1 and CCLR0 bits in TCR. Figure 11.5 shows the timing of clearing the counter by a compare-match. φ Compare-match signal N TCNT H'00 Figure 11.5 Timing of Counter Clear by Compare-Match 11.3.4 Timing of Overflow Flag (OVF) Setting The OVF bit in TCSR is set to 1 when the TCNT overflows (changes from H'FF to H'00).
Section 11 8-Bit Timer (TMR) 11.4 TMR_0 and TMR_1 Cascaded Connection If bits CKS2 to CKS0 in either TCR_0 or TCR_1 are set to B'100, the 8-bit timers of the two channels are cascaded. With this configuration, 16-bit count mode or compare-match count mode can be selected. 11.4.1 16-Bit Count Mode When bits CKS2 to CKS0 in TCR_0 are set to B'100, the timer functions as a single 16-bit timer with TMR_0 occupying the upper eight bits and TMR_1 occupying the lower eight bits.
Section 11 8-Bit Timer (TMR) 11.5 Interrupt Sources TMR_0, TMR_1, TMR_Y and TMR_X can generate three types of interrupts: CMIA, CMIB, and OVI. Table 11.3 shows the interrupt sources and priorities. Each interrupt source can be enabled or disabled independently by interrupt enable bits in TCR or TCSR. Independent signals are sent to the interrupt controller for each interrupt. The CMIA and CMIB interrupts can be used as on-chip DTC activation interrupt sources. Table 11.
Section 11 8-Bit Timer (TMR) 11.6 Usage Notes 11.6.1 Conflict between TCNT Write and Counter Clear If a counter clear signal is generated during the T2 state of a TCNT write cycle as shown in figure 11.7, the counter clear takes priority and the write is not performed. TCNT write cycle by CPU T1 T2 φ Address TCNT address Internal write signal Counter clear signal TCNT N H'00 Figure 11.7 Conflict between TCNT Write and Counter Clear Rev. 2.00 Aug.
Section 11 8-Bit Timer (TMR) 11.6.2 Conflict between TCNT Write and Increment If a TCNT input clock is generated during the T2 state of a TCNT write cycle as shown in figure 11.8, the write takes priority and the counter is not incremented. TCNT write cycle by CPU T1 T2 φ Address TCNT address Internal write signal TCNT input clock TCNT N M Counter write data Figure 11.8 Conflict between TCNT Write and Increment Rev. 2.00 Aug.
Section 11 8-Bit Timer (TMR) 11.6.3 Conflict between TCOR Write and Compare-Match If a compare-match occurs during the T2 state of a TCOR write cycle as shown in figure 11.9, the TCOR write takes priority and the compare-match signal is disabled. TCOR write cycle by CPU T1 T2 φ Address TCOR address Internal write signal TCNT N N+1 TCOR N M TCOR write data Compare-match signal Disabled Figure 11.9 Conflict between TCOR Write and Compare-Match Rev. 2.00 Aug.
Section 11 8-Bit Timer (TMR) 11.6.4 Switching of Internal Clocks and TCNT Operation TCNT may increment erroneously when the internal clock is switched over. Table 11.8 shows the relationship between the timing at which the internal clock is switched (by writing to the CKS1 and CKS0 bits) and the TCNT operation. When the TCNT clock is generated from an internal clock, the falling edge of the internal clock pulse is detected. If clock switching causes a change from high to low level, as shown in no.
Section 11 8-Bit Timer (TMR) No. 3 Timing of Switchover by Means of CKS1 and CKS0 Bits Clock switching from high 3 to low level∗ TCNT Clock Operation Clock before switchover Clock after switchover *4 TCNT clock TCNT N N+1 N+2 CKS bit rewrite 4 Clock switching from high to high level Clock before switchover Clock after switchover TCNT clock TCNT N N+1 N+2 CKS bit rewrite Notes: 1. 2. 3. 4. 11.6.5 Includes switching from low to stop, and from stop to low.
Section 12 Watchdog Timer (WDT) Section 12 Watchdog Timer (WDT) This LSI has two watchdog timer channels (WDT_0 and WDT_1). The watchdog timer can output an overflow signal (RESO) externally if a system crash prevents the CPU from writing to the timer counter, thus allowing it to overflow. Simultaneously, it can generate an internal reset signal or an internal NMI interrupt signal. When this watchdog function is not needed, the WDT can be used as an interval timer.
Section 12 Watchdog Timer (WDT) Internal NMI (Interrupt request signal*2) Interrupt control Overflow Clock Clock selection Reset control RESO signal*1 Internal reset signal*1 TCNT_0 φ/2 φ/64 φ/128 φ/512 φ/2048 φ/8192 φ/32768 φ/131072 Internal clock Internal bus WOVI0 (Interrupt request signal) TCSR_0 Bus interface Module bus WDT_0 Internal NMI (Interrupt request signal*2) RESO signal*1 Interrupt control Overflow Clock φ/2 φ/64 φ/128 φ/512 φ/2048 φ/8192 φ/32768 φ/131072 Clock selection
Section 12 Watchdog Timer (WDT) 12.2 Input/Output Pins The WDT has the pins listed in table 12.1. Table 12.1 Pin Configuration Name Symbol I/O Function Reset output pin RESO Output Outputs the counter overflow signal in watchdog timer mode Input Inputs the clock pulses to the WDT_1 prescaler counter External sub-clock input EXCL pin 12.3 Register Descriptions The WDT has the following registers.
Section 12 Watchdog Timer (WDT) 12.3.2 Timer Control/Status Register (TCSR) TCSR selects the clock source to be input to TCNT, and the timer mode. • TCSR_0 Bit Bit Name Initial Value R/W 7 OVF 0 R/(W)* Overflow Flag Description Indicates that TCNT has overflowed (changes from H'FF to H'00). [Setting conditions] • When TCNT overflows (changes from H'FF to H'00) • When internal reset request generation is selected in watchdog timer mode, OVF is cleared automatically by the internal reset.
Section 12 Watchdog Timer (WDT) Bit Bit Name 2 to 0 CKS2 to CKS0 Initial Value R/W Description All 0 R/W Clock Select 2 to 0 Select the clock source to be input to TCNT. The overflow period for φ = 34 MHz is enclosed in parentheses. 000: φ/2 (period: 15.1 µs) 001: φ/64 (period: 481.9 µs) 010: φ/128 (period: 963.8 µs) 011: φ/512 (period: 3.856 ms) 100: φ/2048 (period: 15.42 ms) 101: φ/8192 (period: 61.68 ms) 110: φ/32768 (period: 246.7 ms) 111: φ/131072 (period: 986.
Section 12 Watchdog Timer (WDT) • TCSR_1 Bit 7 Bit Name OVF Initial Value 0 R/W Description 1 R/(W)* Overflow Flag Indicates that TCNT has overflowed (changes from H'FF to H'00). [Setting conditions] • When TCNT overflows (changes from H'FF to H'00) • When internal reset request generation is selected in watchdog timer mode, OVF is cleared automatically by the internal reset.
Section 12 Watchdog Timer (WDT) Bit Bit Name 2 to 0 CKS2 to CKS0 Initial Value R/W Description All 0 R/W Clock Select 2 to 0 Select the clock source to be input to TCNT. The overflow cycle for φ = 34 MHz and φSUB = 32.768 kHz is enclosed in parentheses. When PSS = 0: 000: φ/2 (cycle: 15.1 µs) 001: φ/64 (cycle: 481.9 µs) 010: φ/128 (cycle: 963.8 µs) 011: φ/512 (cycle: 3.856 ms) 100: φ/2048 (cycle: 15.42 ms) 101: φ/8192 (cycle: 61.68 ms) 110: φ/32768 (cycle: 246.7 ms) 111: φ/131072 (cycle: 986.
Section 12 Watchdog Timer (WDT) 12.4 Operation 12.4.1 Watchdog Timer Mode To use the WDT as a watchdog timer, set the WT/IT bit and the TME bit in TCSR to 1. While the WDT is used as a watchdog timer, if TCNT overflows without being rewritten because of a system malfunction or another error, an internal reset or NMI interrupt request is generated. TCNT does not overflow while the system is operating normally.
Section 12 Watchdog Timer (WDT) TCNT value Overflow H'FF Time H'00 WT/IT = 1 TME = 1 Write H'00 to TCNT OVF = 1* WT/IT = 1 Write H'00 to TME = 1 TCNT Internal reset signal 518 system clocks WT/IT: TME: OVF: Timer mode select bit Timer enable bit Overflow flag Note: * After the OVF bit becomes 1, it is cleared to 0 by an internal reset. The XRST bit is also cleared to 0. Figure 12.2 Watchdog Timer Mode (RST/NMI = 1) Operation Rev. 2.00 Aug.
Section 12 Watchdog Timer (WDT) 12.4.2 Interval Timer Mode When the WDT is used as an interval timer, an interval timer interrupt (WOVI) is generated each time the TCNT overflows, as shown in figure 12.3. Therefore, an interrupt can be generated at intervals. When the TCNT overflows in interval timer mode, an interval timer interrupt (WOVI) is requested at the same time the OVF bit of TCSR is set to 1. The timing is shown in figure 12.4.
Section 12 Watchdog Timer (WDT) RESO Signal Output Timing 12.4.3 When TCNT overflows in watchdog timer mode, the OVF bit in TCSR is set to 1. When the RST/NMI bit is 1 here, the internal reset signal is generated for the entire LSI. At the same time, the low level signal is output from the RESO pin. The timing is shown in figure 12.5. φ TCNT H'FF H'00 Overflow signal (internal signal) OVF RESO signal Internal reset signal 132 states 518 states Figure 12.
Section 12 Watchdog Timer (WDT) 12.5 Interrupt Sources During interval timer mode operation, an overflow generates an interval timer interrupt (WOVI). The interval timer interrupt is requested whenever the OVF flag is set to 1 in TCSR. OVF must be cleared to 0 in the interrupt handling routine. When the NMI interrupt request is selected in watchdog timer mode, an NMI interrupt request is generated by an overflow Table 12.
Section 12 Watchdog Timer (WDT) 12.6 Usage Notes 12.6.1 Notes on Register Access The watchdog timer’s registers, TCNT and TCSR differ from other registers in being more difficult to write to. The procedures for writing to and reading from these registers are given below. Writing to TCNT and TCSR (Example of WDT_0): These registers must be written to by a word transfer instruction. They cannot be written to by a byte transfer instruction. TCNT and TCSR both have the same write address.
Section 12 Watchdog Timer (WDT) 12.6.2 Conflict between Timer Counter (TCNT) Write and Increment If a timer counter clock pulse is generated during the T2 state of a TCNT write cycle, the write takes priority and the timer counter is not incremented. Figure 12.7 shows this operation. TCNT write cycle T1 T2 φ Address Internal write signal TCNT input clock TCNT N M Counter write data Figure 12.7 Conflict between TCNT Write and Increment 12.6.
Section 12 Watchdog Timer (WDT) 12.6.5 Switching between Watchdog Timer Mode and Interval Timer Mode If the mode is switched from/to watchdog timer to/from interval timer, while the WDT is operating, errors could occur in the operation. Software must stop the watchdog timer (by clearing the TME bit to 0) before switching the mode. 12.6.
Section 12 Watchdog Timer (WDT) Rev. 2.00 Aug.
Section 13 Serial Communication Interface (SCI) Section 13 Serial Communication Interface (SCI) This LSI has two independent serial communication interface (SCI) channels. The SCI can handle both asynchronous and clock synchronous serial communication. Asynchronous serial data communication can be carried out with standard asynchronous communication chips such as a Universal Asynchronous Receiver/Transmitter (UART) or Asynchronous Communication Interface Adapter (ACIA).
Section 13 Serial Communication Interface (SCI) Asynchronous Mode: • Data length: 7 or 8 bits • Stop bit length: 1 or 2 bits • Parity: Even, odd, or none • Receive error detection: Parity, overrun, and framing errors • Break detection: Break can be detected by reading the RxD pin level directly in case of a framing error Clock Synchronous Mode: • Data length: 8 bits • Receive error detection: Overrun errors Smart Card Interface: • An error signal can be automatically transmitted on detection of a parity er
Section 13 Serial Communication Interface (SCI) Module data bus RDR TDR BRR SCMR SSR φ SCR RxD1/RxD3 RSR TSR Baud rate generator SMR φ/4 φ/16 Transmission/ reception control TxD1/TxD3 Parity generation Internal data bus Bus interface Figure 13.1 is a block diagram of SCI_1 and SCI_3.
Section 13 Serial Communication Interface (SCI) 13.2 Input/Output Pins Table 13.1 shows the input/output pins for each SCI channel. Table 13.
Section 13 Serial Communication Interface (SCI) 13.3.1 Receive Shift Register (RSR) RSR is a shift register used to receive serial data that converts it into parallel data. When one frame of data has been received, it is transferred to RDR automatically. RSR cannot be directly accessed by the CPU. 13.3.2 Receive Data Register (RDR) RDR is an 8-bit register that stores receive data.
Section 13 Serial Communication Interface (SCI) 13.3.5 Serial Mode Register (SMR) SMR is used to set the SCI's serial transfer format and select the baud rate generator clock source. Some bits in SMR have different functions in normal mode and smart card interface mode.
Section 13 Serial Communication Interface (SCI) Bit Bit Name Initial Value R/W Description 1 CKS1 0 R/W Clock Select 1 and 0 0 CKS0 0 R/W These bits select the clock source for the baud rate generator. 00: φ clock (n = 0) 01: φ/4 clock (n = 1) 10: φ/16 clock (n = 2) 11: φ/64 clock (n = 3) For the relation between the bit rate register setting and the baud rate, see section 13.3.9, Bit Rate Register (BRR). n is the decimal display of the value of n in BRR (see section 13.3.
Section 13 Serial Communication Interface (SCI) Bit Bit Name Initial Value R/W Description 3 BCP1 0 R/W Basic Clock Pulse 1 and 0 2 BCP0 0 R/W These bits select the number of basic clock cycles in a 1bit data transfer time in smart card interface mode. 00: 32 clock cycles (S = 32) 01: 64 clock cycles (S = 64) 10: 372 clock cycles (S = 372) 11: 256 clock cycles (S = 256) For details, see section 13.7.4, Receive Data Sampling Timing and Reception Margin. S is described in section 13.3.
Section 13 Serial Communication Interface (SCI) 13.3.6 Serial Control Register (SCR) SCR is a register that performs enabling or disabling of SCI transfer operations and interrupt requests, and selection of the transfer clock source. For details on interrupt requests, see section 13.8, Interrupt Sources. Some bits in SCR have different functions in normal mode and smart card interface mode.
Section 13 Serial Communication Interface (SCI) Bit Bit Name Initial Value R/W Description 1 CKE1 0 R/W Clock Enable 1 and 0 0 CKE0 0 R/W These bits select the clock source and SCK pin function. Asynchronous mode: 00: Internal clock (SCK pin functions as I/O port.) 01: Internal clock (Outputs a clock of the same frequency as the bit rate from the SCK pin.) 1x: External clock (Inputs a clock with a frequency 16 times the bit rate from the SCK pin.
Section 13 Serial Communication Interface (SCI) • Bit Functions in Smart Card Interface Mode (when SMIF in SCMR = 1) Bit Bit Name Initial Value R/W 7 TIE 0 R/W Description Transmit Interrupt Enable When this bit is set to 1, a TXI interrupt request is enabled. 6 RIE 0 R/W Receive Interrupt Enable When this bit is set to 1, RXI and ERI interrupt requests are enabled. 5 TE 0 R/W Transmit Enable When this bit is set to 1, transmission is enabled.
Section 13 Serial Communication Interface (SCI) 13.3.7 Serial Status Register (SSR) SSR is a register containing status flags of the SCI and multiprocessor bits for transfer. TDRE, RDRF, ORER, PER, and FER can only be cleared. Some bits in SSR have different functions in normal mode and smart card interface mode.
Section 13 Serial Communication Interface (SCI) Bit Bit Name Initial Value R/W 5 ORER 0 R/(W)* Overrun Error Description [Setting condition] When the next serial reception is completed while RDRF = 1 [Clearing condition] When 0 is written to ORER after reading ORER = 1 4 FER 0 R/(W)* Framing Error [Setting condition] When the stop bit is 0 [Clearing condition] When 0 is written to FER after reading FER = 1 In 2-stop-bit mode, only the first stop bit is checked.
Section 13 Serial Communication Interface (SCI) • Bit Functions in Smart Card Interface Mode (when SMIF in SCMR = 1) Bit 7 Bit Name TDRE Initial Value 1 R/W Description 1 R/(W)* Transmit Data Register Empty Indicates whether TDR contains transmit data. [Setting conditions] • When the TE bit in SCR is 0 • When data is transferred from TDR to TSR, and TDR can be written to.
Section 13 Serial Communication Interface (SCI) Bit 3 Bit Name PER Initial Value 0 R/W Description 1 R/(W)* Parity Error [Setting condition] When a parity error is detected during reception [Clearing condition] When 0 is written to PER after reading PER = 1 2 TEND 1 R Transmit End TEND is set to 1 when the receiving end acknowledges no error signal and the next transmit data is ready to be transferred to TDR.
Section 13 Serial Communication Interface (SCI) 13.3.8 Smart Card Mode Register (SCMR) SCMR selects smart card interface mode and its format. Bit Bit Name Initial Value R/W 7 to 4 All 1 R Description Reserved These bits are always read as 1 and cannot be modified. 3 SDIR 0 R/W Smart Card Data Transfer Direction Selects the serial/parallel conversion format. 0: TDR contents are transmitted with LSB-first. Stores receive data as LSB first in RDR.
Section 13 Serial Communication Interface (SCI) 13.3.9 Bit Rate Register (BRR) BRR is an 8-bit register that adjusts the bit rate. As the SCI performs baud rate generator control independently for each channel, different bit rates can be set for each channel. Table 13.2 shows the relationships between the N setting in BRR and bit rate B for normal asynchronous mode and clock synchronous mode, and smart card interface mode.
Section 13 Serial Communication Interface (SCI) Table 13.3 Examples of BRR Settings for Various Bit Rates (Asynchronous Mode) Operating Frequency φ (MHz) 20 25 34 Bit Rate (bit/s) n N Error (%) n N Error (%) n N Error (%) 110 3 88 –0.25 3 110 –0.02 3 150 –0.05 150 3 64 0.16 3 80 –0.47 3 110 –0.29 300 2 129 0.16 2 162 0.15 2 220 0.16 600 2 64 0.16 2 80 –0.47 2 110 –0.29 1200 1 129 0.16 1 162 0.15 1 220 0.16 2400 1 64 0.16 1 80 –0.
Section 13 Serial Communication Interface (SCI) Table 13.6 BRR Settings for Various Bit Rates (Clock Synchronous Mode) Operating Frequency φ (MHz) 20 24 34 n N n N n N 500 1k 2.5 k 2 124 2 149 2 212 5k 1 249 2 74 2 105 10 k 1 124 1 149 1 212 25 k 0 199 0 239 1 84 50 k 0 99 0 119 0 169 100 k 0 49 0 59 0 84 250 k 0 19 0 23 0 33 500 k 0 9 0 11 0 16 1M 0 4 0 5 2.
Section 13 Serial Communication Interface (SCI) Table 13.7 Maximum Bit Rate with External Clock Input (Clock Synchronous Mode) φ (MHz) External Input Clock (MHz) Maximum Bit Rate (bit/s) 20 3.3333 3333333.3 25 4.1667 4166666.7 34 5.6667 5666666.7 Table 13.8 BRR Settings for Various Bit Rates (Smart Card Interface Mode, n = 0, s = 372) Operating Frequency φ (MHz) 20.00 21.4272 25 34 Bit Rate (bit/s) n N Error (%) n N Error(%) n N Error (%) n N Error (%) 9600 2 –6.65 0 2 0.
Section 13 Serial Communication Interface (SCI) 13.4 Operation in Asynchronous Mode Figure 13.2 shows the general format for asynchronous serial communication. One frame consists of a start bit (low level), followed by transmit/receive data, a parity bit, and finally stop bits (high level). In asynchronous serial communication, the transmission line is usually held in the mark state (high level).
Section 13 Serial Communication Interface (SCI) 13.4.1 Data Transfer Format Table 13.10 shows the data transfer formats that can be used in asynchronous mode. Any of 12 transfer formats can be selected according to the SMR setting. For details on the multiprocessor bit, see section 13.5, Multiprocessor Communication Function. Table 13.
Section 13 Serial Communication Interface (SCI) 13.4.2 Receive Data Sampling Timing and Reception Margin in Asynchronous Mode In asynchronous mode, the SCI operates on a basic clock with a frequency of 16 times the bit rate. In reception, the SCI samples the falling edge of the start bit using the basic clock, and performs internal synchronization.
Section 13 Serial Communication Interface (SCI) 13.4.3 Clock Either an internal clock generated by the on-chip baud rate generator or an external clock input at the SCK pin can be selected as the SCI's transfer clock, according to the setting of the C/A bit in SMR and the CKE1 and CKE0 bits in SCR. When an external clock is input at the SCK pin, the clock frequency should be 16 times the bit rate used. When the SCI is operated on an internal clock, the clock can be output from the SCK pin.
Section 13 Serial Communication Interface (SCI) 13.4.4 SCI Initialization (Asynchronous Mode) Before transmitting and receiving data, you should first clear the TE and RE bits in SCR to 0, then initialize the SCI as shown in figure 13.5. When the operating mode, transfer format, etc., is changed, the TE and RE bits must be cleared to 0 before making the change using the following procedure. When the TE bit is cleared to 0, the TDRE flag in SSR is set to 1.
Section 13 Serial Communication Interface (SCI) 13.4.5 Serial Data Transmission (Asynchronous Mode) Figure 13.6 shows an example of the operation for transmission in asynchronous mode. In transmission, the SCI operates as described below. 1. The SCI monitors the TDRE flag in SSR, and if it is cleared to 0, recognizes that data has been written to TDR, and transfers the data from TDR to TSR. 2. After transferring data from TDR to TSR, the SCI sets the TDRE flag to 1 and starts transmission.
Section 13 Serial Communication Interface (SCI) Initialization [1] Start transmission [2] Read TDRE flag in SSR [2] SCI status check and transmit data write: Read SSR and check that the TDRE flag is set to 1, then write transmit data to TDR and clear the TDRE flag to 0.
Section 13 Serial Communication Interface (SCI) 13.4.6 Serial Data Reception (Asynchronous Mode) Figure 13.8 shows an example of the operation for reception in asynchronous mode. In serial reception, the SCI operates as described below. 1. The SCI monitors the communication line, and if a start bit is detected, performs internal synchronization, receives receive data in RSR, and checks the parity bit and stop bit. 2.
Section 13 Serial Communication Interface (SCI) Table 13.11 shows the states of the SSR status flags and receive data handling when a receive error is detected. If a receive error is detected, the RDRF flag retains its state before receiving data. Reception cannot be resumed while a receive error flag is set to 1. Accordingly, clear the ORER, FER, PER, and RDRF bits to 0 before resuming reception. Figure 13.9 shows a sample flowchart for serial data reception. Table 13.
Section 13 Serial Communication Interface (SCI) Initialization [1] Start reception [1] SCI initialization: The RxD pin is automatically designated as the receive data input pin. [2] [3] Receive error processing and break detection: [2] If a receive error occurs, read the ORER, PER, and FER flags in SSR to identify the error. After performing the Yes appropriate error processing, ensure PER ∨ FER ∨ ORER = 1 that the ORER, PER, and FER flags are [3] all cleared to 0.
Section 13 Serial Communication Interface (SCI) [3] Error processing No ORER = 1 Yes Overrun error processing No FER = 1 Yes Yes Break? No Framing error processing Clear RE bit in SCR to 0 No PER = 1 Yes Parity error processing Clear ORER, PER, and FER flags in SSR to 0 Figure 13.9 Sample Serial Reception Flowchart (2) Rev. 2.00 Aug.
Section 13 Serial Communication Interface (SCI) 13.5 Multiprocessor Communication Function Use of the multiprocessor communication function enables data transfer to be performed among a number of processors sharing communication lines by means of asynchronous serial communication using the multiprocessor format, in which a multiprocessor bit is added to the transfer data. When multiprocessor communication is carried out, each receiving station is addressed by a unique ID code.
Section 13 Serial Communication Interface (SCI) Transmitting station Serial communication line Receiving station A Receiving station B Receiving station C Receiving station D (ID = 01) (ID = 02) (ID = 03) (ID = 04) Serial data H'01 H'AA (MPB = 1) (MPB = 0) ID transmission cycle = Data transmission cycle = receiving station Data transmission to specification receiving station specified by ID [Legend] MPB: Multiprocessor bit Figure 13.
Section 13 Serial Communication Interface (SCI) 13.5.1 Multiprocessor Serial Data Transmission Figure 13.11 shows a sample flowchart for multiprocessor serial data transmission. For an ID transmission cycle, set the MPBT bit in SSR to 1 before transmission. For a data transmission cycle, clear the MPBT bit in SSR to 0 before transmission. All other SCI operations are the same as those in asynchronous mode.
Section 13 Serial Communication Interface (SCI) 13.5.2 Multiprocessor Serial Data Reception Figure 13.13 shows a sample flowchart for multiprocessor serial data reception. If the MPIE bit in SCR is set to 1, data is skipped until data with a 1 multiprocessor bit is sent. On receiving data with a 1 multiprocessor bit, the receive data is transferred to RDR. An RXI interrupt request is generated at this time. All other SCI operations are the same as in asynchronous mode. Figure 13.
Section 13 Serial Communication Interface (SCI) Initialization [1] SCI initialization: The RxD pin is automatically designated as the receive data input pin. [1] Start reception Set MPIE bit in SCR to 1 [2] ID reception cycle: Set the MPIE bit in SCR to 1. [2] [3] SCI status check, ID reception and comparison: Read SSR and check that the RDRF flag is set to 1, then read the receive data in RDR and compare it with this station’s ID.
Section 13 Serial Communication Interface (SCI) [5] Error processing No ORER = 1 Yes Overrun error processing No FER = 1 Yes Yes Break? No Framing error processing Clear RE bit in SCR to 0 Clear ORER, PER, and FER flags in SSR to 0 Figure 13.13 Sample Multiprocessor Serial Reception Flowchart (2) Rev. 2.00 Aug.
Section 13 Serial Communication Interface (SCI) 13.6 Operation in Clock Synchronous Mode Figure 13.14 shows the general format for clock synchronous communication. In clock synchronous mode, data is transmitted or received in synchronization with clock pulses. One character in transfer data consists of 8-bit data. In data transmission, the SCI outputs data from one falling edge of the synchronization clock to the next.
Section 13 Serial Communication Interface (SCI) 13.6.2 SCI Initialization (Clock Synchronous Mode) Before transmitting and receiving data, you should first clear the TE and RE bits in SCR to 0, then initialize the SCI as described in a sample flowchart in figure 13.15. When the operating mode, transfer format, etc., is changed, the TE and RE bits must be cleared to 0 before making the change using the following procedure. When the TE bit is cleared to 0, the TDRE flag in SSR is set to 1.
Section 13 Serial Communication Interface (SCI) 13.6.3 Serial Data Transmission (Clock Synchronous Mode) Figure 13.16 shows an example of SCI operation for transmission in clock synchronous mode. In serial transmission, the SCI operates as described below. 1. The SCI monitors the TDRE flag in SSR, and if it is 0, recognizes that data has been written to TDR, and transfers the data from TDR to TSR. 2. After transferring data from TDR to TSR, the SCI sets the TDRE flag to 1 and starts transmission.
Section 13 Serial Communication Interface (SCI) Figure 13.17 shows a sample flowchart for serial data transmission. Even if the TDRE flag is cleared to 0, transmission will not start while a receive error flag (ORER, FER, or PER) is set to 1. Make sure to clear the receive error flags to 0 before starting transmission. Note that clearing the RE bit to 0 does not clear the receive error flags.
Section 13 Serial Communication Interface (SCI) Initialization [1] Start transmission [2] Read TDRE flag in SSR No TDRE = 1 Yes Write transmit data to TDR and clear TDRE flag in SSR to 0 No All data transmitted? [3] Yes [1] SCI initialization: The TxD pin is automatically designated as the transmit data output pin. [2] SCI status check and transmit data write: Read SSR and check that the TDRE flag is set to 1, then write transmit data to TDR and clear the TDRE flag to 0.
Section 13 Serial Communication Interface (SCI) 13.6.4 Serial Data Reception (Clock Synchronous Mode) Figure 13.18 shows an example of SCI operation for reception in clock synchronous mode. In serial reception, the SCI operates as described below. 1. The SCI performs internal initialization in synchronization with a synchronization clock input or output, starts receiving data, and stores the receive data in RSR. 2.
Section 13 Serial Communication Interface (SCI) [1] Initialization Start reception [2] Read ORER flag in SSR Yes ORER = 1 [3] No Error processing (Continued below) Read RDRF flag in SSR [4] No RDRF = 1 Yes Read receive data in RDR and clear RDRF flag in SSR to 0 No All data received? Yes Clear RE bit in SCR to 0 [5] [1] SCI initialization: The RxD pin is automatically designated as the receive data input pin.
Section 13 Serial Communication Interface (SCI) 13.6.5 Simultaneous Serial Data Transmission and Reception (Clock Synchronous Mode) Figure 13.20 shows a sample flowchart for simultaneous serial transmit and receive operations. After initializing the SCI, the following procedure should be used for simultaneous serial data transmit and receive operations.
Section 13 Serial Communication Interface (SCI) Initialization [1] [1] SCI initialization: The TxD pin is designated as the transmit data output pin, and the RxD pin is designated as the receive data input pin, enabling simultaneous transmit and receive operations. [2] SCI status check and transmit data write: Read SSR and check that the TDRE flag is set to 1, then write transmit data to TDR and clear the TDRE flag to 0.
Section 13 Serial Communication Interface (SCI) 13.7 Smart Card Interface Description The SCI supports the IC card (smart card) interface based on the ISO/IEC 7816-3 (Identification Card) standard as an enhanced serial communication interface function. Smart card interface mode can be selected using the appropriate register. 13.7.1 Sample Connection Figure 13.21 shows a sample connection between the smart card and this LSI. This LSI communicates with the IC card using a single transmission line.
Section 13 Serial Communication Interface (SCI) In normal transmission/reception Ds D0 D1 D2 D3 D4 D5 D6 D7 Dp D7 Dp Output from the transmitting station When a parity error is generated Ds D0 D1 D2 D3 D4 D5 D6 DE Output from the transmitting station Output from the receiving station [Legend] Ds: D0 to D7: Dp: DE: Start bit Data bits Parity bit Error signal Figure 13.
Section 13 Serial Communication Interface (SCI) For the inverse convention type, logic levels 1 and 0 correspond to states A and Z, respectively and data is transferred with MSB-first as the start character, as shown in figure 13.24. Therefore, data in the start character in the figure is H'3F. When using the inverse convention type, write 1 to both the SDIR and SINV bits in SCMR.
Section 13 Serial Communication Interface (SCI) 13.7.4 Receive Data Sampling Timing and Reception Margin Only the internal clock generated by the internal baud rate generator can be used as a communication clock in smart card interface mode. In this mode, the SCI can operate using a basic clock with a frequency of 32, 64, 372, or 256 times the bit rate according to the BCP1 and BCP0 settings (the frequency is always 16 times the bit rate in normal asynchronous mode).
Section 13 Serial Communication Interface (SCI) 372 clock cycles 186 clock cycles 0 185 185 371 0 371 0 Internal basic clock Receive data (RxD) Start bit D0 D1 Synchronization sampling timing Data sampling timing Figure 13.25 Receive Data Sampling Timing in Smart Card Interface Mode (When Clock Frequency is 372 Times the Bit Rate) 13.7.5 Initialization Before starting transmitting and receiving data, initialize the SCI using the following procedure.
Section 13 Serial Communication Interface (SCI) To switch from reception to transmission, first verify that reception has completed, and initialize the SCI. At the end of initialization, RE and TE should be set to 0 and 1, respectively. Reception completion can be verified by reading the RDRF flag or PER and ORER flags. To switch from transmission to reception, first verify that transmission has completed, and initialize the SCI.
Section 13 Serial Communication Interface (SCI) (n + 1) th transfer frame Retransfer frame nth transfer frame Ds D0 D1 D2 D3 D4 D5 D6 D7 Dp DE Ds D0 D1 D2 D3 D4 D5 D6 D7 Dp (DE) Ds D0 D1 D2 D3 D4 TDRE Transfer from TDR to TSR Transfer from TDR to TSR Transfer from TDR to TSR TEND [2] [3] FER/ERS [1] [3] Figure 13.26 Data Re-transfer Operation in SCI Transmission Mode Note that the TEND flag is set in different timings depending on the GM bit setting in SMR, which is shown in figure 13.27.
Section 13 Serial Communication Interface (SCI) Start Initialization Start transmission ERS = 0? No Yes Error processing No TEND = 1? Yes Write data to TDR and clear TDRE flag in SSR to 0 No All data transmitted? Yes No ERS = 0? Yes Error processing No TEND = 1? Yes Clear TE bit in SCR to 0 End Figure 13.28 Sample Transmission Flowchart Rev. 2.00 Aug.
Section 13 Serial Communication Interface (SCI) 13.7.7 Serial Data Reception (Except in Block Transfer Mode) Data reception in smart card interface mode is identical to that in normal serial communication interface mode. Figure 13.29 shows the data re-transfer operation during reception. 1. If a parity error is detected in receive data, the PER bit in SSR is set to 1. Here, an ERI interrupt request is generated if the RIE bit in SCR is set to 1.
Section 13 Serial Communication Interface (SCI) Start Initialization Start reception ORER = 0 and PER = 0? No Yes Error processing No RDRF = 1? Yes Read data from RDR and clear RDRF flag in SSR to 0 No All data received? Yes Clear RE bit in SCR to 0 Figure 13.30 Sample Reception Flowchart Rev. 2.00 Aug.
Section 13 Serial Communication Interface (SCI) 13.7.8 Clock Output Control Clock output can be fixed using the CKE1 and CKE0 bits in SCR when the GM bit in SMR is set to 1. Specifically, the minimum width of a clock pulse can be specified. Figure 13.31 shows an example of clock output fixing timing when the CKE0 bit is controlled with GM = 1 and CKE1 = 0. CKE0 SCK Specified pulse width Specified pulse width Figure 13.
Section 13 Serial Communication Interface (SCI) At Transition from Smart Card Interface Mode to Software Standby Mode: 1. Set the port data register (DR) and data direction register (DDR) corresponding to the SCK pins to the values for the output fixed state in software standby mode. 2. Write 0 to the TE and RE bits in SCR to stop transmission/reception. Simultaneously, set the CKE1 bit to the value for the output fixed state in software standby mode. 3. Write 0 to the CKE0 bit in SCR to stop the clock. 4.
Section 13 Serial Communication Interface (SCI) 13.8 Interrupt Sources 13.8.1 Interrupts in Normal Serial Communication Interface Mode Table 13.12 shows the interrupt sources in normal serial communication interface mode. A different interrupt vector is assigned to each interrupt source, and individual interrupt sources can be enabled or disabled using the enable bits in SCR. When the TDRE flag in SSR is set to 1, a TXI interrupt request is generated.
Section 13 Serial Communication Interface (SCI) 13.8.2 Interrupts in Smart Card Interface Mode Table 13.13 shows the interrupt sources in smart card interface mode. A TEI interrupt request cannot be used in this mode. Table 13.
Section 13 Serial Communication Interface (SCI) 13.9 Usage Notes 13.9.1 Module Stop Mode Setting SCI operation can be disabled or enabled using the module stop control register. The initial setting is for SCI operation to be halted. Register access is enabled by clearing module stop mode. For details, see section 28, Power-Down Modes. 13.9.2 Break Detection and Processing When framing error detection is performed, a break can be detected by reading the RxD pin value directly.
Section 13 Serial Communication Interface (SCI) 13.9.6 Restrictions on Using DTC When the external clock source is used as a synchronization clock, update TDR by the DTC and wait for at least five φ clock cycles before allowing the transmit clock to be input. If the transmit clock is input within four clock cycles after TDR modification, the SCI may malfunction (figure 13.33). When using the DTC to read RDR, be sure to set the receive end interrupt source (RXI) as a DTC activation source.
Section 13 Serial Communication Interface (SCI) 13.9.7 SCI Operations during Mode Transitions Transmission: Before making the transition to module stop or software standby mode, stop all transmit operations (TE = TIE = TEIE = 0). TSR, TDR, and SSR are reset. The states of the output pins during each mode depend on the port settings, and the pins output a high-level signal after mode cancellation. If the transition is made during data transmission, the data being transmitted will be undefined.
Section 13 Serial Communication Interface (SCI) Transmission No All data transmitted? [1] [1] Data being transmitted is lost halfway. Data can be normally transmitted from the CPU by setting TE to 1, reading SSR, writing to TDR, and clearing TDRE to 0 after mode cancellation; however, if the DTC has been initiated, the data remaining in DTC RAM will be transmitted when TE and TIE are set to 1. Yes Read TEND flag in SSR No TEND = 1 Yes TE = 0 [2] [2] Also clear TIE and TEIE to 0 when they are 1.
Section 13 Serial Communication Interface (SCI) Transmission start Transmission end Transition to Software standby software standby mode cancelled mode TE bit SCK output pin TxD output pin Port input/output Port input/output Marking output Port Last TxD bit retained Port input/output SCI TxD output Port High output* SCI TxD output Note: Initialized in software standby mode Figure 13.
Section 13 Serial Communication Interface (SCI) Reception Read RDRF flag in SSR RDRF = 1 No [1] [1] Data being received will be invalid. Yes Read receive data in RDR [2] Module stop mode is included. RE = 0 [2] Make transition to software standby mode etc. Cancel software standby mode etc. Change operating mode? No Yes Initialization RE = 1 Start reception Figure 13.37 Sample Flowchart for Mode Transition during Reception Rev. 2.00 Aug.
Section 13 Serial Communication Interface (SCI) 13.9.8 Notes on Switching from SCK Pins to Port Pins When SCK pins are switched to port pins after transmission has completed, pins are enabled for port output after outputting a low pulse of half a cycle as shown in figure 13.38. Low pulse of half a cycle SCK/Port 1. Transmission end Data Bit 6 4. Low pulse output Bit 7 2. TE = 0 TE 3. C/A = 0 C/A CKE1 CKE0 Figure 13.
Section 13 Serial Communication Interface (SCI) High output SCK/Port 1. Transmission end Data Bit 6 Bit 7 TE 2. TE = 0 4. C/A = 0 C/A 3. CKE1 = 1 CKE1 5. CKE1 = 0 CKE0 Figure 13.39 Prevention of Low Pulse Output at Switching from SCK Pins to Port Pins Rev. 2.00 Aug.
Section 14 CRC Operation Circuit (CRC) Section 14 CRC Operation Circuit (CRC) This LSI has a cyclic redundancy check (CRC) operation circuit to enhance the reliability of data transfer in high-speed communications, etc. The CRC operation circuit detects errors in data blocks. 14.1 Features The features of the CRC operation circuit are listed below.
Section 14 CRC Operation Circuit (CRC) 14.2 Register Descriptions The CRC operation circuit has the following registers. • CRC control register (CRCCR) • CRC data input register (CRCDIR) • CRC data output register (CRCDOR) 14.2.1 CRC Control Register (CRCCR) CRCCR initializes the CRC operation circuit, switches the operation mode, and selects the generating polynomial. Bit Bit Name Initial Value R/W Description 7 DORCLR 0 W CRCDOR Clear Setting this bit to 1 clears CRCDOR to H′0000.
Section 14 CRC Operation Circuit (CRC) 14.2.2 CRC Data Input Register (CRCDIR) CRCDIR is an 8-bit readable/writable register, to which the bytes to be CRC-operated are written. The result is obtained in CRCDOR. 14.2.3 CRC Data Output Register (CRCDOR) CRCDOR is a 16-bit readable/writable register that contains the result of CRC operation when the bytes to be CRC-operated are written to CRCDIR after CRCDOR is cleared.
Section 14 CRC Operation Circuit (CRC) 1. Write H'87 to CRCCR 2. Write H'F0 to CRCDIR 7 CRCCR 7 0 0 1 0 0 0 1 CRCDIR 1 1 CRCDOR clearing 0 7 0 1 1 1 1 0 0 0 0 CRC code generation 0 7 CRCDORH 0 0 0 0 0 0 0 0 CRCDORH 1 1 1 0 1 1 1 1 CRCDORL 0 0 0 0 0 0 0 0 CRCDORL 0 0 0 1 1 1 1 1 3. Read from CRCDOR CRC code = H'EF1F 4.
Section 14 CRC Operation Circuit (CRC) 1. Serial reception (LSB first) Data CRC code 7 1 1 1 1 0 1 1 F 0 7 1 1 0 7 0 0 8 2. Write H'83 to CRCCR 1 1 1 7 1 1 F 1 1 0 0 F 0 0 0 0 0 0 0 0 1 1 CRCDIR 1 0 1 1 1 CRCDOR clearing 0 0 CRC code generation 0 7 0 7 CRCDORH 0 0 0 0 0 0 0 0 CRCDORH 1 1 1 1 0 1 1 1 CRCDORL 0 0 0 0 0 0 0 0 CRCDORL 1 0 0 0 1 1 1 1 1 0 1 1 1 4. Write H'8F to CRCDIR 5.
Section 14 CRC Operation Circuit (CRC) 1. Serial reception (MSB first) Data CRC code 7 Input 1 1 1 1 0 0 0 F 0 7 0 1 0 2. Write H'87 to CRCCR 1 1 0 1 1 E 0 7 1 0 0 0 F 0 1 1 1 0 0 0 1 1 1 CRCDIR 1 0 1 1 1 CRCDOR clearing 0 0 0 0 CRC code generation 0 7 0 7 CRCDORH 0 0 0 0 0 0 0 0 CRCDORH 1 1 1 0 1 1 1 1 CRCDORL 0 0 0 0 0 0 0 0 CRCDORL 0 0 0 1 1 1 1 1 1 1 1 1 1 4. Write H'EF to CRCDIR 5.
Section 14 CRC Operation Circuit (CRC) 14.4 Note on CRC Operation Circuit Note that the sequence to transmit the CRC code differs between LSB-first transmission and MSB-first transmission. 1. CRC code generation After specifying the operation method, write data to CRCDIR in the sequence of (1) → (2) → (3) → (4). 7 0 (1) → (2) → (3) → (4) CRCDIR CRC code generation 0 7 CRCDORH (5) CRCDORL (6) 2.
Section 14 CRC Operation Circuit (CRC) Rev. 2.00 Aug.
Section 15 Serial Communication Interface with FIFO (SCIF) Section 15 Serial Communication Interface with FIFO (SCIF) This LSI has single-channel serial communication interface with FIFO buffers (SCIF) that supports asynchronous serial communication. The SCIF enables asynchronous serial communication with standard asynchronous communication LSIs such as a Universal Asynchronous Receiver/Transmitter (UART).
Section 15 Serial Communication Interface with FIFO (SCIF) LPC interface FIER FIIR FFCR FLCR FMCR FLSR FMSR FSCR Bus interface Internal data bus Figure 15.1 shows a block diagram of the SCIF.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.2 Input/Output Pins Table 15.1 lists the SCIF input/output pins. Table 15.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.3 Register Descriptions The SCIF has the following registers. The register configuration of the SCIF is shown below. Access to the registers is switched by the SCIFE bit in HICR5 and bit 3 in SUBMSTPBL. For details, see table 15.2. For the SCIF address registers H and L (SCIFADRH, SCIFADRL) and SERIRQ control register 4 (SIRQCR4), see section 19, LPC Interface (LPC).
Section 15 Serial Communication Interface with FIFO (SCIF) 15.3.1 Receive Shift Register (FRSR) FRSR is a register that receives data and converts serial data input from the RxDF pin to parallel data. It stores the data in the order received from the LSB (bit 0). When one frame of serial data has been received, the data is transferred to FRBR. FRSR cannot be read from the CPU/LPC interface. 15.3.2 Receive Buffer Register (FRBR) FRBR is an 8-bit read-only register that stores received serial data.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.3.4 Transmitter Holding Register (FTHR) FTHR is an 8-bit write-only register that stores serial transmit data. It is accessible when the DLAB bit in FLCR is 0. Write transmit data while the THRE bit in FLCR is set to 1. Data can be written to FTHR when the THRE bit is set with the FIFO disabled. If data is written to FTHR when the THRE bit is not set, the data is overwritten.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.3.6 Interrupt Enable Register (FIER) FIER is a register that enables or disables interrupts. It is accessible when the DLAB bit in FLCR is 0. Bit Bit Name Initial Value R/W Description 7 to 4 All 0 R Reserved These bits are always read as 0. The initial value should not be changed.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.3.7 Interrupt Identification Register (FIIR) FIIR consists of bits that identify interrupt sources. For details, see table 15.3. Bit Bit Name Initial Value R/W Description 7 FIFOE1 0 R FIFO Enable 0, 1 6 FIFOE0 0 R These bits indicate the transmit/receive FIFO setting. 00: Transmit/receive FIFOs disabled 11: Transmit/receive FIFOs enabled 5, 4 All 0 R Reserved These bits are always read as 0.
Section 15 Serial Communication Interface with FIFO (SCIF) Table 15.3 Interrupt Control Function FIIR Setting/Clearing of Interrupt INTID 2 1 0 INTPEND Priority Type of Interrupt Interrupt Source Clearing of Interrupt 0 0 0 1 No interrupt None 0 1 1 0 1 (high) Receive line status Overrun error, FLSR read parity error, framing error, break interrupt 0 1 0 0 2 Receive data ready Receive data remaining, FIFO trigger level FRBR read or receive FIFO is below trigger level.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.3.8 FIFO Control Register (FFCR) FFCR is a write-only register that controls transmit/receive FIFOs. Bit Bit Name Initial Value R/W Description 7 RCVRTRIG1 0 W Receive FIFO Interrupt Trigger Level 1, 0 6 RCVRTRIG0 0 W These bits set the trigger level of the receive FIFO interrupt. 00: 1 byte 01: 4 bytes 10: 8 bytes 11: 14 bytes 5, 4 Reserved These bits cannot be modified.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.3.9 Line Control Register (FLCR) FLCR sets formats of the transmit/receive data. Bit Bit Name Initial Value R/W Description 7 DLAB 0 R/W Divisor Latch Address FDLL and FDLH are placed at the same addresses as the FRBR/FTHR and FIER addresses. This bit selects which register is to be accessed.
Section 15 Serial Communication Interface with FIFO (SCIF) Bit Bit Name Initial Value R/W Description 2 STOP 0 R/W Stop Bit Specifies the stop bit length for data transmission. For data reception, only the first stop bit is checked regardless of the setting. 0: 1 stop bit 1: 1.5 stop bits (data length: 5 bits) or 2 stop bits (data length: 6 to 8 bits) 1 CLS1 0 R/W Character Length Select 0, 1 0 CLS0 0 R/W These bits specify transmit/receive character data length.
Section 15 Serial Communication Interface with FIFO (SCIF) Bit Bit Name Initial Value R/W Description 3 OUT2 0 R/W OUT2 • Normal operation Enables or disables the SCIF interrupt. 0: Interrupt disabled 1: Interrupt enabled • Loopback test Internally connected to the DCD input pin. 2 OUT1 0 R/W OUT1 • Normal operation No effect on operation • Loopback test Internally connected to the RI input pin. 1 RTS 0 R/W Request to Send Controls the RTS output.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.3.11 Line Status Register (FLSR) FLSR is a read-only register that indicates the status information of data transmission. Bit Bit Name Initial Value R/W Description 7 RXFIFOERR 0 Receive FIFO Error R Indicates that at least one data error (parity error, framing error, or break interrupt) has occurred when the FIFO is enabled.
Section 15 Serial Communication Interface with FIFO (SCIF) Bit Bit Name Initial Value R/W Description 5 THRE 1 FTHR Empty R Indicates that FTHR is ready to accept new data for transmission. • When the FIFO is enabled 0: Transmit data of one or more bytes remains in the transmit FIFO. [Clearing condition] Transmit data is written to FTHR. 1: No transmit data remains in the transmit FIFO.
Section 15 Serial Communication Interface with FIFO (SCIF) Bit Bit Name Initial Value R/W Description 3 FE 0 Framing Error R Indicates that the stop bit of the receive data is invalid. When the FIFO is enabled, this error occurs in any receive data in the FIFO, and this bit is set when the receive data is in the first FIFO buffer. The UART attempts resynchronization after a framing error occurs.
Section 15 Serial Communication Interface with FIFO (SCIF) Bit Bit Name Initial Value R/W Description 1 OE 0 Overrun Error R Indicates occurrence of an overrun error. • When the FIFO is disabled When reception of the next data has been completed without the receive data in FRBR having been read, an overrun error occurs and the previous data is lost. • When the FIFO is enabled When the FIFO is full and reception of the next data has been completed, an overrun error occurs.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.3.12 Modem Status Register (FMSR) FMSR is a read-only register that indicates the status of or a change in the modem control pins. Bit Bit Name Initial Value R/W Description 7 DCD 0 R Data Carrier Detect 6 RI 0 R Indicates the inverted state of the DCD input pin. Ring Indicator Indicates the inverted state of the RI input pin. 5 DSR 0 R Data Set Ready Indicates the inverted state of the DSR input pin.
Section 15 Serial Communication Interface with FIFO (SCIF) Bit Bit Name Initial Value R/W Description 1 DDSR 0 Delta Data Set Ready Indicator R Indicates a change in the DSR input signal after the DDSR bit is read.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.3.14 SCIF Control Register (SCIFCR) SCIFCR controls SCIF operations, and is accessible only from the CPU. Bit Bit Name Initial Value R/W Description 7 SCIFOE1 0 R/W 6 SCIFOE0 0 R/W These bits enable or disable PORT output of the SCIF. The PORT function differs according to the combination with the SCIF bit in HICR5 of the LPC. For details, see table 15.4. 5 0 R/W Reserved Do not change the initial value.
Section 15 Serial Communication Interface with FIFO (SCIF) Table 15.4 SCIF Output Setting Bit SCIFE in HICR5 0 SCIFOE1 0 1 1 0 1 SCIFOE0 0 1 0 1 0 1 0 1 P65 pin PORT PORT RTS PORT RTS PORT RTS PORT P27 pin PORT PORT DTR PORT DTR PORT DTR PORT P50 pin PORT PORT TxDF TxDF TxDF TxDF TxDF TxDF Note: P51, P24 to P26, and P64 are input to the SCIF even when the outputs on the P27, P50, and P65 pins are set to PORT. Rev. 2.00 Aug.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.4 Operation 15.4.1 Baud Rate The SCIF includes a baud rate generator and can set the desired baud rate using registers FDLH, FDLL, and the CKSEL bit in SCIFCR. Table 15.5 shows an example of baud rate settings. Table 15.5 Example of Baud Rate Settings CKSEL1, CKSEL0 Baud rate 00 01 LCLK System Clock (33 MHz) divided by 18 (34 MHz) divided by 11 FDLH, FDLL (Hex) Error (%) FDLH, FDLL (Hex) Error (%) 50 0900 -0.54% H'0F18 -0.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.4.2 Operation in Asynchronous Communication Figure 15.2 illustrates the typical format for asynchronous serial communication. One frame consists of a start bit (low level), followed by transmit/receive data (LSB-first: from the least significant bit), a parity bit, and a stop bit (high level). In asynchronous serial communication, the transmission line is usually held high in the mark state (high level).
Section 15 Serial Communication Interface with FIFO (SCIF) 15.4.3 (1) Initialization of the SCIF Initialization of the SCIF Use an example of the flowchart in figure 15.3 to initialize the SCIF before transmitting or receiving data. [1] Select an input clock with the CKSEL1 and CKSEL0 bits in SCIFCR. Set the SCIF input/ output pins with the SCIFOE1 and SCIFOE0 bits in SCIFCR. Start initialization Clear module stop Set SCIFCR [1] [2] Set the DLAB bit in FLCR to 1 to enable access to FDLL and FDLH.
Section 15 Serial Communication Interface with FIFO (SCIF) (2) Serial Data Transmission Figure 15.4 shows an example of the data transmission flowchart. Initialization Start transmission [1] Read THRE flag in FLSR THRE = 1? [1] Confirm that the THRE flag in FLSR is 1, and write transmit data to FTHR. When FIFOs are used, write 1-byte to 16-byte transmit data. When the OUT2 bit in FMCR and the ETBEI bit in FIER are set to 1, an FTHR empty interrupt occurs.
Section 15 Serial Communication Interface with FIFO (SCIF) (3) Serial Data Reception Figure 15.5 shows an example of the data reception flowchart. [1] Initialization Confirm that the DR flag in FLSR is 1 to ensure that receive data is in the buffer. When the OUT2 bit in FMCR and the ERBFI bit in FIER are set to 1, a receive data ready interrupt occurs. Start reception [2] Read DR flag in FLSR Read the RXFIFOERR, BI, FE, PE, and OE flags in FLSR to ensure that no error has occurred.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.4.4 Data Transmission/Reception with Flow Control The following shows examples of data transmission/reception for flow control using CTS and RTS. (1) Initialization Figure 15.6 shows an example of the initialization flowchart. Start initialization [1] Select an input clock with the CKSEL1 and CKSEL0 bits in SCIFCR. Set the SCIF input/output pins with the SCIFOE1 and SCIFOE0 bits in SCIFCR.
Section 15 Serial Communication Interface with FIFO (SCIF) (2) Data Transmission/Reception Standby Figure 15.7 shows an example of the data transmission/reception standby flowchart. [1] When a receive data ready interrupt occurs, go to the reception flow. Initialization Receive data ready interrupt? Yes [2] When transmit data exists, go to the transmission flow. [1] (Reception flow) No Yes Transmit data exists? [2] No (Transmission flow) Figure 15.
Section 15 Serial Communication Interface with FIFO (SCIF) (3) Data Transmission Figure 15.8 shows an example of the data transmission flowchart. [1] Confirm that the CTS flag in FMSR is 1. Transmission/reception standby [2] Confirm that the THRE flag in FLSR is 1 to ensure that the transmit FIFO is empty. [1] Read CTS flag in FMSR CTS = 1 [3] Write up to 16 bytes of transmit data in the transmit FIFO.
Section 15 Serial Communication Interface with FIFO (SCIF) (4) Suspension of Data Transmission Figure 15.9 shows an example of the data transmission suspension flowchart. Modem status change interrupt [1] Read DCTS flag in FMSR [1] Read the DCTS flag in FMSR in the modem status change interrupt processing routine. If the DCTS flag is set to 1, the transmission suspension processing starts. [2] Suspend data write to the transmit FIFO. DCTS = 1 Yes No [3] Set the XMITFRST bit in FFCR to 1.
Section 15 Serial Communication Interface with FIFO (SCIF) (5) Data Reception Figure 15.10 shows an example of the data reception flowchart. [1] When data is received, a receive data ready interrupt occurs. Go to the data reception flow by using this interrupt trigger. Receive data ready interrupt Read FLSR BI = 1, FE = 1, PE = 1, or OE = 1 [1] Yes No Error processing Read receive FIFO [2] Read FLSR [3] DR = 0 [4] [2] Confirm that the BI, FE, PE, and OE flags in FLSR are all cleared.
Section 15 Serial Communication Interface with FIFO (SCIF) (6) Suspension of Data Reception Figure 15.11 shows an example of the data reception suspension flowchart. Receive FIFO trigger level interrupt [1] Clear RTS bit in FMCR to 0 [2] [1] When data is received at a trigger level higher than the receive FIFO trigger level specified in the initialization flow, a receive FIFO trigger level interrupt occurs. [2] Clear the RTS bit in FMCR to 0.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.4.5 Data Transmission/Reception Through the LPC Interface As shown in table 15.2, setting the SCIFE bit in HICR5 to 1 allows registers (except SCIFCR) to be accessed from the LPC interface. The initial setting of SCIFCR by the CPU and setting of the SCIFE bit in HICR5 to 1 enable the flow settings for initialization and data transmission/reception shown in figures 15.3 to 15.5 to be made from the LPC interface. Table 15.
Section 15 Serial Communication Interface with FIFO (SCIF) Table 15.7 shows the register states related to data transmission/reception through the LPC interface. Table 15.
Section 15 Serial Communication Interface with FIFO (SCIF) 15.5 Interrupt Sources Table 15.8 lists the interrupt sources. A common interrupt vector is assigned to each interrupt source. When the LPC uses the SCIF, the LPC does not request any interrupts to be sent to the H8S CPU. The SERIRQ signal of the LPC interface transmits an interrupt request to the host. Table 15.
Section 15 Serial Communication Interface with FIFO (SCIF) Rev. 2.00 Aug.
Section 16 Serial Pin Multiplexed Modes Section 16 Serial Pin Multiplexed Modes Three serial communication I/F modules (SCIF, SCI_1 and SCI_3) can be configured for five types of COM port assignments and internal connections (serial pin multiplexed modes) in this LSI. Two registers are provided for controlling the serial pin multiplexed modes: serial multiplexed mode register 0 (SMR0) and serial multiplexed mode register 1 (SMR1). 16.
Section 16 Multiplex Mode 16.2 Input/Output Pins Table 16.1 lists input/output pins involved in serial pin multiplexed modes. Table 16.1 Pin Configuration Module Symbol I/O Function Port Pin SCIF TxDF Output Transmit data P50 RxDF Input Receive data P51 RI Input Ring Indicator detect P25 DCD Input Data carrier detect P24 DSR Input Data set ready P26 DTR Output Data terminal ready P27 CTS Input Transmission permission P64 RTS Output Transmission request P65 Rev. 2.
Section 16 Serial Pin Multiplexed Modes 16.3 Register Descriptions Two registers are provided for serial pin multiplexed modes. Serial multiplexed mode register 0 (SMR0) enables or disables the serial pin multiplexing function, selects a serial pin multiplexed mode out of 5 modes, and provides bits for port monitoring. Serial multiplexed mode register 1 (SMR1) provides bits for port monitoring and controls outputs on the relevant port pins.
Section 16 Multiplex Mode 16.3.2 Serial Multiplexed Mode Register 1 (SMR1) SMR1 is a register that monitors the port and controls the port output. In mode 2, this register monitors the status of the RTS pin of SCIF. Bit Bit Name Initial Value R/W Description 7 CTS1 R Monitors the state of the CTS pin of COM1 in mode 1. 6 DTR1 1 R/W Controls the output on the DTR pin of COM1 in modes 3 and 4. Monitors the state of the RTS pin of SCIF in mode 2.
Section 16 Serial Pin Multiplexed Modes 16.4 Operation of Serial Pin Multiplexed Modes 16.4.1 Serial Pin Multiplexed Mode 0 (Default; SMR0 Register [bits SM2, SM1, SM0] = [0 0 0]) This mode is the default configuration and each COM port is used for its respective serial communication module: COM1 works with SCIF, COM2 with SCI_1, and COM3 with SCI_3. DCD, RI, DSR, DTR, CTS, RTS, RxDF, and TxDF of SCIF are connected to the corresponding pins of COM1.
Section 16 Multiplex Mode 16.4.2 Serial Pin Multiplexed Mode 1 (SMR0 Register [bits SM2, SM1, SM0] = [0 0 1]) This mode is "COM1 snoop mode" with use of SCI_1 and internal registers. DCD, RI, DSR, DTR, CTS, RTS, RxDF and TxDF of SCIF are connected to COM1. RxD1 of SCI_1 is connected to RxDF of SCIF internally and TxD1 of SCI_1 is unused. So, COM2 is not available (N/A) and Rx of COM2 is fixed at 1. RxD3 and TxD3 of SCI_3 are cross-connected to COM3.
Section 16 Serial Pin Multiplexed Modes 16.4.3 Serial Pin Multiplexed Mode 2 (SMR0 Register [bits SM2, SM1, SM0] = [0 1 0]) In this mode, SCIF and SCI_1 are internally connected. COM1 is not available (N/A) and DTR/RTS/Rx of COM1 are fixed at 1. DCD, RI, DSR, DTR, CTS, RTS, RxDF, and TxDF of SCIF are disconnected from COM1. DCD/RI/DSR of SCIF is fixed at 1, and RxDF/TxDF of SCIF are cross-connected to TxD1/RxD1 of SCI_1 internally. COM2 is not available (N/A) and Rx of COM2 is fixed at 1.
Section 16 Multiplex Mode 16.4.4 Serial Pin Multiplexed Mode 3 (SMR0 Register [bits SM2, SM1, SM0] = [0 1 1]) This mode enables the use of COM2 by SCIF and COM1 by SCI_1. Since SCI_1 doesn't use any hardware pins for flow control, emulation is possible using the internal registers. Tx/Rx of COM1 are connected to RxD1/TxD1 of SCI_1, and other COM1 port signals are controlled or monitored through bits in the internal registers.
Section 16 Serial Pin Multiplexed Modes 16.4.5 Serial Pin Multiplexed Mode 4 (SMR0 Register [bits SM2, SM1, SM0] = [1 0 0]) Mode 4 provides the same function as mode 3, but the data lines of SCI_3 and SCIF are crossconnected. RxD1/TxD1 of SCI_1 are connected to Tx/Rx of COM1, and internal register bits emulate other signals of COM1. DCD/RI/DSR/CTS of SCIF are fixed at 1. COM2 is not available (N/A) and Rx for COM2 is fixed at 1. COM3 is not available (N/A) and Rx for COM3 is fixed at 1.
Section 16 Multiplex Mode 16.5 Serial Port Pin Configuration (a) SME = 1: SCI (SCIF) with serial pin multiplexed mode enabled (b) SME = 0: SCI (SCIF) with serial pin multiplexed mode disabled Rev. 2.00 Aug.
Section 17 Synchronous Serial Communication Unit (SSU) Section 17 Synchronous Serial Communication Unit (SSU) This LSI has synchronous serial communication unit (SSU) channels. The SSU has master mode in which this LSI outputs clocks as a master device for synchronous serial communication and slave mode in which clocks are input from an external device for synchronous serial communication. Synchronous serial communication can be performed with devices having different clock polarity and clock phase.
Section 17 Synchronous Serial Communication Unit (SSU) Module data bus SSCRH Bus interface Figure 17.1 shows a block diagram of the SSU.
Section 17 Synchronous Serial Communication Unit (SSU) 17.2 Input/Output Pins Table 17.1 shows the SSU pin configuration. Table 17.1 Pin Configuration Pin Name I/O Function SSCK I/O SSU clock input/output SSI I/O SSU data input/output SSO I/O SSU data input/output SCS I/O SSU chip select input/output 17.3 Register Descriptions The SSU has the following registers.
Section 17 Synchronous Serial Communication Unit (SSU) 17.3.1 SS Control Register H (SSCRH) SSCRH specifies master/slave device selection, bidirectional mode enable, SSO pin output value selection, SSCK pin selection, and SCS pin selection. Bit Bit Name Initial Value R/W Description 7 MSS 0 R/W Master/Slave Device Select Selects that this module is used in master mode or slave mode. When master mode is selected, transfer clocks are output from the SSCK pin.
Section 17 Synchronous Serial Communication Unit (SSU) Bit Bit Name Initial Value R/W Description 4 SOL 0 R/W Serial Data Output Value Select The serial data output retains its level of the last bit after completion of transmission. The output level before or after transmission can be specified by setting this bit. When specifying the output level, use the MOV instruction after clearing the SOLP bit to 0.
Section 17 Synchronous Serial Communication Unit (SSU) 17.3.2 SS Control Register L (SSCRL) SSCRL selects operating mode, software reset, and transmit/receive data length. Bit Bit Name Initial Value R/W Description 7 0 R/W Reserved This bit is always read as 0. The initial value should not be changed. 6 SSUMS 0 R/W Selects transfer mode from SSU mode and clock synchronous mode.
Section 17 Synchronous Serial Communication Unit (SSU) 17.3.3 SS Mode Register (SSMR) SSMR selects the MSB first/LSB first, clock polarity, clock phase, and clock rate of synchronous serial communication. Bit Bit Name Initial Value R/W Description 7 MLS 0 R/W MSB First/LSB First Select Selects that the serial data is transmitted in MSB first or LSB first.
Section 17 Synchronous Serial Communication Unit (SSU) 17.3.4 SS Enable Register (SSER) SSER performs transfer/receive control of synchronous serial communication and setting of interrupt enable. Bit Bit Name Initial Value R/W Description 7 TE 0 R/W Transmit Enable 6 RE 0 R/W When this bit is set to 1, transmission is enabled. Receive Enable When this bit is set to 1, reception is enabled. 5, 4 All 0 R/W Reserved These bits are always read as 0.
Section 17 Synchronous Serial Communication Unit (SSU) 17.3.5 SS Status Register (SSSR) SSSR is a status flag register for interrupts. Bit Bit Name Initial Value R/W Description 7 0 6 ORER 0 R/W 5, 4 All 0 R/W 3 TEND 1 R Reserved This bit is always read as 0. The initial value should not be changed. Overrun Error If the next data is received while RDRF = 1, an overrun error occurs, indicating abnormal termination.
Section 17 Synchronous Serial Communication Unit (SSU) Bit Bit Name Initial Value R/W Description 2 TDRE 1 R/W 1 RDRF 0 R/W 0 CE 0 R/W Transmit Data Empty Indicates whether or not SSTDR contains transmit data. [Setting conditions] • When the TE bit in SSER is 0 • When data is transferred from SSTDR to SSTRSR and SSTDR is ready to be written to.
Section 17 Synchronous Serial Communication Unit (SSU) 17.3.6 SS Control Register 2 (SSCR2) SSCR2 is a register that enables/disables the open-drain outputs of the SSO, SSI, SSCK, and SCS pins, selects the assert timing of the SCS pin, data output timing of the SSO pin, and set timing of the TEND bit. Bit Bit Name Initial Value R/W Description 7 SDOS 0 R/W Serial Data Pin Open Drain Select Selects whether the serial data output pin is used as a CMOS or an NMOS open drain output.
Section 17 Synchronous Serial Communication Unit (SSU) Bit Bit Name Initial Value R/W Description 3 SCSATS 0 R/W Selects the assertion timing of the SCS pin (valid in SSU and master mode). 0: Min. values of tLEAD and tLAG are 1/2 × tSUcyc 1: Min.
Section 17 Synchronous Serial Communication Unit (SSU) 17.3.8 SS Receive Data Registers 0 to 3 (SSRDR0 to SSRDR3) SSRDR is an 8-bit register that stores receive data. When 8-bit data length is selected by bits DATS1 and DATS0 in SSCRL, SSRDR0 is valid. When 16-bit data length is selected, SSRDR0 and SSRDR1 are valid. When 32-bit data length is selected, SSRDR0 to SSRDR3 are valid. When the SSU has received 1-byte data, it transfers the received serial data from SSTRSR to SSRDR where it is stored.
Section 17 Synchronous Serial Communication Unit (SSU) 17.4 Operation 17.4.1 Transfer Clock A transfer clock can be selected from eight internal clocks and an external clock. When using this module, set the SCKS bit in SSCRH to 1 to select the SSCK pin as a serial clock. When the MSS bit in SSCRH is 1, an internal clock is selected and the SSCK pin is used as an output pin. When transfer is started, the clock with the transfer rate set by bits CKS2 to CKS0 in SSMR is output from the SSCK pin.
Section 17 Synchronous Serial Communication Unit (SSU) 17.4.3 Relationship between Data Input/Output Pins and Shift Register The connection between data input/output pins and the SS shift register (SSTRSR) depends on the combination of the MSS and BIDE bits in SSCRH and the SSUMS bit in SSCRL. Figure 17.3 shows the relationship. The SSU transmits serial data from the SSO pin and receives serial data from the SSI pin when operating with BIDE = 0 and MSS = 1 (standard, master mode) (see figure 17.3 (1)).
Section 17 Synchronous Serial Communication Unit (SSU) 17.4.4 Communication Modes and Pin Functions The SSU switches the input/output pin (SSI, SSO, SSCK, and SCS) functions according to the communication modes and register settings. When a pin is used as an input pin, set the corresponding bit in the input buffer control register (ICR) to 1. The relationship of communication modes and input/output pin functions are shown in tables 17.2 to 17.4. Table 17.
Section 17 Synchronous Serial Communication Unit (SSU) Table 17.3 Communication Modes and Pin States of SSCK Pin Communication Mode SSU communication mode Register Setting Pin State SSUMS MSS SCKS SSCK 0 0 0 1 Input 0 1 Output 0 1 Input 1 Clock synchronous 1 communication mode 0 1 0 1 Output [Legend] : Not used as SSU pin (can be used as I/O port) Table 17.
Section 17 Synchronous Serial Communication Unit (SSU) 17.4.5 SSU Mode In SSU mode, data communications are performed via four lines: clock line (SSCK), data input line (SSI or SSO), data output line (SSI or SSO), and chip select line (SCS). In addition, the SSU supports bidirectional mode in which a single pin functions as data input and data output lines. (1) Initial Settings in SSU Mode Figure 17.4 shows an example of the initial settings in SSU mode.
Section 17 Synchronous Serial Communication Unit (SSU) (2) Data Transmission Figure 17.5 shows an example of transmission operation, and figure 17.6 shows a flowchart example of data transmission. When transmitting data, the SSU operates as shown below. In master mode, the SSU outputs a transfer clock and data. In slave mode, when a low level signal is input to the SCS pin and a transfer clock is input to the SSCK pin, the SSU outputs data in synchronization with the transfer clock.
Section 17 Synchronous Serial Communication Unit (SSU) (1) When 8-bit data length is selected (SSTDR0 is valid) with CPOS = 0 and CPHS = 0 1 frame SCS 1 frame SSCK SSO Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Bit 7 SSTDR0 (LSB first transmission) Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 SSTDR0 (MSB first transmission) TDRE TEND TXI interrupt TXI interrupt generated Data written to SSTDR0 TEI interrupt generated LSI operation generated User operation Data written to SSTDR0
Section 17 Synchronous Serial Communication Unit (SSU) Start [1] [1] Initial setting: Specify the transmit data format. Initial setting [2] Check that the SSU state and write transmit data: Write transmit data to SSTDR after reading and confirming that the TDRE bit is 1. The TDRE bit is automatically cleared to 0 and transmission is started by writing data to SSTDR.
Section 17 Synchronous Serial Communication Unit (SSU) (3) Data Reception Figure 17.7 shows an example of reception operation, and figure 17.8 shows a flowchart example of data reception. When receiving data, the SSU operates as shown below. After setting the RE bit to 1 and dummy-reading SSRDR, the SSU starts data reception. In master mode, the SSU outputs a transfer clock and receives data.
Section 17 Synchronous Serial Communication Unit (SSU) (1) When 8-bit data length is selected (SSRDR0 is valid) with CPOS = 0 and CPHS = 0 1 frame SCS 1 frame SSCK Bit Bit Bit Bit Bit Bit Bit Bit 0 1 2 3 4 5 6 7 SSI Bit Bit Bit Bit Bit Bit Bit Bit 7 6 5 4 3 2 1 0 SSTDR0 (LSB first transmission) SSTDR0 (MSB first transmission) RDRF RXI interrupt generated LSI operation User operation Dummy-read SSRDR0 RXI interrupt generated Read SSRDR0 (2) When 16-bit data length is selected (SSRDR0 and SSRDR1
Section 17 Synchronous Serial Communication Unit (SSU) Start [1] RE = 1 (reception started) [2] [1] Initial setting: Specify the receive data format. [2] Start reception: When SSRDR is dummy-read with RE = 1, reception is started. Initial setting Dummy-read SSRDR [3], [6] Receive error processing: When a receive error occurs, execute the designated error processing after reading the ORER bit in SSSR. After that, clear the ORER bit to 0.
Section 17 Synchronous Serial Communication Unit (SSU) Before switching transmission mode (TE = 1) or reception mode (RE = 1) to transmission/reception mode (TE = RE = 1), clear the TE and RE bits to 0. When starting the transfer, confirm that the TEND, RDRF, and ORER bits are cleared to 0 before setting the TE or RE bit to 1. Start [1] [1] Initial setting: Specify the transmit/receive data format.
Section 17 Synchronous Serial Communication Unit (SSU) SCS Pin Control and Conflict Error 17.4.6 When bits CSS1 and CSS0 in SSCRH are specified to B'10 and the SSUMS bit in SSCRL is cleared to 0, the SCS pin functions as an input (Hi-Z) to detect a conflict error. The arbitration detection period is from setting the MSS bit in SSCRH to 1 to starting serial transfer and after transfer ends. When a low level signal is input to the SCS pin within the period, a conflict error occurs.
Section 17 Synchronous Serial Communication Unit (SSU) 17.4.7 Clock Synchronous Communication Mode In clock synchronous communication mode, data communications are performed via three lines: clock line (SSCK), data input line (SSI), and data output line (SSO). (1) Initial Settings in Clock Synchronous Communication Mode Figure 17.12 shows an example of the initial settings in clock synchronous communication mode.
Section 17 Synchronous Serial Communication Unit (SSU) (2) Data Transmission Figure 17.13 shows an example of transmission operation, and figure 17.14 shows a flowchart example of data transmission. When transmitting data in clock synchronous communication mode, the SSU operates as shown below. In master mode, the SSU outputs a transfer clock and data. In slave mode, when a transfer clock is input to the SSCK pin, the SSU outputs data in synchronization with the transfer clock.
Section 17 Synchronous Serial Communication Unit (SSU) Start [1] [4][1] Initial setting: Specify the transmit data format. Initial setting [2] Check that the SSU state and write transmit data: Write transmit data to SSTDR after reading and confirming that the TDRE bit is 1. The TDRE bit is automatically cleared to 0 and transmission is started by writing data to SSTDR.
Section 17 Synchronous Serial Communication Unit (SSU) (3) Data Reception Figure 17.15 shows an example of reception operation, and figure 17.16 shows a flowchart example of data reception. When receiving data, the SSU operates as shown below. After setting the RE bit in SSER to 1, the SSU starts data reception. In master mode, the SSU outputs a transfer clock and receives data.
Section 17 Synchronous Serial Communication Unit (SSU) Start [1] Initial setting [2] RE = 1 (reception started) Initial setting: Specify the receive data format. [2] Start reception: When setting the RE bit to 1, reception is started. [3], [5] Receive error processing: When a receive error occurs, execute the designated error processing after reading the ORER bit in SSSR. After that, clear the ORER bit to 0. While the ORER bit is set to 1, transmission or reception is not resumed.
Section 17 Synchronous Serial Communication Unit (SSU) Before switching transmission mode (TE = 1) or reception mode (RE = 1) to transmission/reception mode (TE = RE = 1), clear the TE and RE bits to 0. When starting the transfer, confirm that the TEND, RDRF, and ORER bits are cleared to 0 before setting the TE or RE bits to 1. Start [1] [1] Initial setting: Specify the transmit/receive data format.
Section 17 Synchronous Serial Communication Unit (SSU) 17.5 Interrupt Requests The SSU interrupt requests are an overrun error, a conflict error, a receive data register full, transmit data register empty, and a transmit end interrupts. Of these interrupt sources, a receive data register full, a transmit data register empty, and a transmit end interrupts can activate the DTC for data transfer.
Section 17 Synchronous Serial Communication Unit (SSU) Rev. 2.00 Aug.
Section 18 I2C Bus Interface (IIC) 2 Section 18 I C Bus Interface (IIC) 2 2 This LSI has six-channels of I C bus interface (IIC). The I C bus interface conforms to and 2 provides a subset of the Philips I C bus (inter-IC bus) interface functions. However, the register 2 configuration that controls the I C bus differs partly from the Philips configuration. 18.
Section 18 I2C Bus Interface (IIC) Pins SCL0 to SCL5 and SDA0 to SDA5 (normally NMOS push-pull outputs) function as NMOS open-drain outputs when the bus drive function is selected. 2 Figure 18.1 shows a block diagram of the I C bus interface. Figure 18.2 shows an example of I/O 2 pin connections to external circuits. Since I C bus interface I/O pins are different in structure from normal port pins, they have different specifications for permissible applied voltages.
Section 18 I2C Bus Interface (IIC) VCC VDD VCC SCL SCL SDA SDA SCL in SDA out (Master) SCL in This LSI SCL out SCL out SDA in SDA in SDA out SDA out (Slave 1) SCL in SCL SDA SDA in SCL SDA SCL out (Slave 2) 2 Figure 18.2 I C Bus Interface Connections (Example: This LSI as Master) Rev. 2.00 Aug.
Section 18 I2C Bus Interface (IIC) 18.2 Input/Output Pins 2 Table 18.1 summarizes the input/output pins used by the I C bus interface. Table 18.
Section 18 I2C Bus Interface (IIC) 18.3 Register Descriptions 2 The I C bus interface has the following registers. Registers ICDR and SARX and registers ICMR and SAR are allocated to the same addresses. Accessible registers differ depending on the ICE bit in ICCR. When the ICE bit is cleared to 0, SAR and SARX can be accessed, and when the ICE bit is set to 1, ICMR and ICDR can be accessed.
Section 18 I2C Bus Interface (IIC) If IIC is in receive mode and no previous data remains in ICDRR (the ICDRF flag is 0), data is transferred automatically from ICDRS to ICDRR, following reception of one frame of data using ICDRS. If additional data is received while the ICDRF flag is 1, data is transferred automatically from ICDRS to ICDRR by reading from ICDR. In transmit mode, no data is transferred from ICDRS to ICDRR. Always set IIC to receive mode before reading from ICDR.
Section 18 I2C Bus Interface (IIC) 18.3.3 Second Slave Address Register (SARX) SARX sets the second slave address and selects the communication format. In slave mode, transmit/receive operations by the DTC are possible when the received address matches the 2 second slave address.
Section 18 I2C Bus Interface (IIC) Table 18.
Section 18 I2C Bus Interface (IIC) 18.3.4 2 I C Bus Mode Register (ICMR) ICMR sets the communication format and transfer rate. It can only be accessed when the ICE bit in ICCR is set to 1. Bit Bit Name Initial Value R/W Description 7 MLS 0 R/W MSB-First/LSB-First Select 0: MSB-first 1: LSB-first 2 Set this bit to 0 when the I C bus format is used. 6 WAIT 0 R/W Wait Insertion Bit 2 This bit is valid only in master mode with the I C bus format.
Section 18 I2C Bus Interface (IIC) Bit Bit Name Initial Value R/W Description 2 BC2 All 0 R/W Bit Counter 1 BC1 0 BC0 These bits specify the number of bits to be transferred next. Bit BC2 to BC0 settings should be made during an interval between transfer frames. If bits BC2 to BC0 are set to a value other than B'000, the setting should be made while the SCL line is low. The bit counter is initialized to B'000 when a start condition is detected.
Section 18 I2C Bus Interface (IIC) 18.3.5 2 I C Bus Transfer Rate Select Register (IICX3) IICX3 selects the IIC transfer rate clock and sets the transfer rate of IIC channel 3. Bit Bit Name Initial Value R/W Description 7 to 4 Reserved These bits cannot be modified. The read values are undefined. 3 TCSS 0 R/W Transfer Rate Clock Source Select 2 This bit selects a clock rate to be applied to the I C bus transfer rate.
Section 18 I2C Bus Interface (IIC) 2 Table 18.3 I C bus Transfer Rate (1) • TCSS = 0 STCR/ ICMR IICX3 Bit 5 Bit 4 Bit 3 IICXn CKS2 CKS1 CKS0 Clock φ = 20 MHz φ = 25 MHz φ = 34 MHz 0 0 0 0 φ/28 714.3 kHz* 892.9 kHz* 1214.3 kHz* 1 φ/40 500.0 kHz* 625.0 kHz* 850.0 kHz* 0 φ/48 416.7 kHz* 520.8 kHz* 708.3 kHz* 1 φ/64 312.5 kHz 390.6 kHz 531.3 kHz* 0 φ/80 250.0 kHz 312.5 kHz 425.0 kHz* 1 φ/100 200.0 kHz 250.0 kHz 340.0 kHz 0 φ/112 178.6 kHz 223.2 kHz 303.
Section 18 I2C Bus Interface (IIC) 2 Table 18.3 I C bus Transfer Rate (2) • TCSS = 1 STCR/ ICMR IICX3 Bit 5 Bit 4 Bit 3 IICXn CKS2 CKS1 CKS0 Clock φ = 20 MHz φ = 25 MHz φ = 34 MHz 0 0 0 0 φ/56 357.1 kHz 446.4 kHz* 607.1 kHz* 1 φ/80 250.0 kHz 312.5 kHz 425.0 kHz* 0 φ/96 208.3 kHz 260.4 kHz 345.2 kHz 1 φ/128 156.3 kHz 195.3 kHz 265.6 kHz 0 φ/160 125.0 kHz 156.3 kHz 212.5 kHz 1 φ/200 100.0 kHz 125.0 kHz 170.0 kHz 0 φ/224 89.3 kHz 111.6 kHz 151.
Section 18 I2C Bus Interface (IIC) 18.3.6 2 I C Bus Control Register (ICCR) 2 ICCR controls the I C bus interface and performs interrupt flag confirmation. Bit Bit Name Initial Value R/W Description 7 ICE 0 R/W I C Bus Interface Enable 2 2 2 0: I C bus interface modules are stopped and I C bus interface module internal state is initialized. SAR and SARX can be accessed.
Section 18 I2C Bus Interface (IIC) Bit Bit Name Initial Value R/W Description 5 MST 0 R/W [MST clearing conditions] 4 TRS 0 R/W (1) When 0 is written by software 2 (2) When lost in bus contention in I C bus format master mode [MST setting conditions] (1) When 1 is written by software (for MST clearing condition 1) (2) When 1 is written in MST after reading MST = 0 (for MST clearing condition 2) [TRS clearing conditions] (1) When 0 is written by software (except for TRS setting condition 3) (
Section 18 I2C Bus Interface (IIC) Bit Bit Name Initial Value R/W Description 2 BBSY 0 R/W* Bus Busy 0 SCP 1 W Start Condition/Stop Condition Prohibit In master mode • Writing 0 in BBSY and 0 in SCP: A stop condition is issued • Writing 1 in BBSY and 0 in SCP: A start condition and a restart condition are issued In slave mode • Writing to the BBSY flag is disabled.
Section 18 I2C Bus Interface (IIC) Bit Bit Name Initial Value R/W 1 IRIC 0 Description 2 R/(W)* I C Bus Interface Interrupt Request Flag 2 Indicates that the I C bus interface has issued an interrupt request to the CPU. IRIC is set at different times depending on the FS bit in SAR and the WAIT bit in ICMR. See section 18.4.7, IRIC Setting Timing and SCL Control. The conditions under which IRIC is set also differ depending on the setting of the ACKE bit in ICCR.
Section 18 I2C Bus Interface (IIC) Bit 1 Bit Name IRIC Initial Value 0 R/W Description 1 R/(W)* At the end of data transfer in clock synchronous serial format (rise of the 8th transmit/receive clock) When a start condition is detected with serial format selected When a condition occurs in which the ICDRE or ICDRF flag is set to 1.
Section 18 I2C Bus Interface (IIC) When the DTC is used, IRIC is cleared automatically and transfer can be performed continuously without CPU intervention. 2 When, with the I C bus format selected, IRIC is set to 1 and an interrupt is generated, other flags must be checked in order to identify the source that set IRIC to 1. Although each source has a corresponding flag, caution is needed at the end of a transfer. When the ICDRE or ICDRF flag is set, the IRTR flag may or may not be set.
Section 18 I2C Bus Interface (IIC) Table 18.
Section 18 I2C Bus Interface (IIC) Table 18.
Section 18 I2C Bus Interface (IIC) MST TRS BBSY ESTP STOP IRTR AASX AL AAS ADZ ACKB ICDRF ICDRE State 0 0 1 0 0 1 Reception end with ICDRF=1 0 0 1 0 0 0↓ 0↓ 0↓ 0↓ ICDR read with the above state 0 0 1 0 0 1↑/0 *2 0 0 0 1↑ Automatic data transfer from ICDRS to ICDRR with the above state 0 0↓ 1↑/0 *3 0/1↑ 3 * 0↓ Stop condition detected [Legend] 0: 0-state retained 1: 1-state retained : Previous st
Section 18 I2C Bus Interface (IIC) 18.3.7 2 I C Bus Status Register (ICSR) ICSR consists of status flags. Refer to tables 18.4 and 18.5 as well. Bit Bit Name Initial Value R/W 7 ESTP 0 R/(W)* Error Stop Condition Detection Flag Description 2 This bit is valid in I C bus format slave mode. [Setting condition] When a stop condition is detected during frame transfer.
Section 18 I2C Bus Interface (IIC) Bit Bit Name Initial Value R/W 4 AASX 0 R/(W)* Second Slave Address Recognition Flag Description 2 In I C bus format slave receive mode, this flag is set to 1 if the first frame following a start condition matches bits SVAX6 to SVAX0 in SARX.
Section 18 I2C Bus Interface (IIC) Bit Bit Name Initial Value R/W 2 AAS 0 R/(W)* Slave Address Recognition Flag Description 2 In I C bus format slave receive mode, this flag is set to 1 if the first frame following a start condition matches bits SVA6 to SVA0 in SAR, or if the general call address (H'00) is detected.
Section 18 I2C Bus Interface (IIC) Bit Bit Name Initial Value R/W Description 0 ACKB 0 R/W Acknowledge Bit Stores acknowledge data.
Section 18 I2C Bus Interface (IIC) 18.3.8 2 I C Bus Extended Control Register (ICXR) 2 ICXR enables or disables the I C bus interface interrupt generation and continuous receive operation, and indicates the status of receive/transmit operations. Bit Bit Name Initial Value R/W Description 7 STOPIM 0 R/W Stop Condition Interrupt Source Mask Enables or disables the interrupt generation when the stop condition is detected in slave mode.
Section 18 I2C Bus Interface (IIC) Bit Bit Name Initial Value R/W Description 5 ICDRF 0 R Receive Data Read Request Flag Indicates the ICDR (ICDRR) status in receive mode. 0: Indicates that the data has been already read from ICDR (ICDRR) or ICDR is initialized. 1: Indicates that data has been received successfully and transferred from ICDRS to ICDRR, and the data is ready to be read out. [Setting conditions] • When data is received successfully and transferred from ICDRS to ICDRR.
Section 18 I2C Bus Interface (IIC) Bit Bit Name Initial Value R/W Description 4 ICDRE 0 R Transmit Data Write Request Flag Indicates the ICDR (ICDRT) status in transmit mode. 0: Indicates that the data has been already written to ICDR (ICDRT) or ICDR is initialized. 1: Indicates that data has been transferred from ICDRT to ICDRS and is being transmitted, or the start condition has been detected or transmission has been completed, thus allowing the next data to be written to.
Section 18 I2C Bus Interface (IIC) Bit Bit Name Initial Value R/W Description 3 ALIE 0 R/W Arbitration Lost Interrupt Enable Enables or disables IRIC flag setting and interrupt request when arbitration is lost. 0: Disables interrupt request when arbitration is lost. 1: Enables interrupt request when arbitration is lost. 2 ALSL 0 R/W Arbitration Lost Condition Select Selects the condition under which arbitration is lost.
Section 18 I2C Bus Interface (IIC) 18.3.9 2 I C SMBus Control Register (ICSMBCR) ICSMBCR is used to support the System Management Bus (SMBus) specifications. To support the SMBus specification, SDA output data hold time should be specified in the range of 300 ns to 1000 ns. Table 18.7 shows the relationship between the ICSMBCR setting and output data hold time. When the SMBus is not supported, the initial value should not be changed. ICSMBCR is enabled to access when bit MSTP4 is cleared to 0.
Section 18 I2C Bus Interface (IIC) Table 18.6 Output Data Hold Time Output Data Hold Time (ns) SMBnE FSEL1 FSEL0 0 1 0 0 1 1 0 1 Notes: * Min./Max. φ = 20 MHz φ = 25 MHz φ = 34 MHz Min. 100* 80* 59* Max. 150* 120* 88* Min. 150* 120* 88* Max. 250* 200* 147* Min. 200* 160* 118* Max. 350 280* 206* Min. 300 240* 176* Max. 550 440 324 Min. 500 400 294* Max.
Section 18 I2C Bus Interface (IIC) 18.4 Operation 18.4.1 I C Bus Data Format 2 2 2 The I C bus interface has an I C bus format and a serial format. 2 The I C bus formats are addressing formats with an acknowledge bit. These are shown in figures 18.3 (a) and (b). The first frame following a start condition always consists of 9 bits. The serial format is a non-addressing format with no acknowledge bit. This is shown in figure 18.4. 2 Figure 18.5 shows the I C bus timing.
Section 18 I2C Bus Interface (IIC) SDA SCL S 1–7 8 9 SLA R/W A 1–7 8 DATA 9 A 1–7 DATA 8 9 A/A P 2 Figure 18.5 I C Bus Timing 2 Table 18.8 I C Bus Data Format Symbols Symbol Description S Start condition. The master device drives SDA from high to low while SCL is high SLA Slave address. The master device selects the slave device.
Section 18 I2C Bus Interface (IIC) 18.4.2 Initialization Initialize the IIC by the procedure shown in figure 18.6 before starting transmission/reception of data.
Section 18 I2C Bus Interface (IIC) Figure 18.7 shows the sample flowchart for the operations in master transmit mode. Start Initialize IIC [1] Initialization Read BBSY in ICCR [2] Test the status of the SCL and SDA lines. No BBSY = 0? Yes Set MST = 1 and TRS = 1 in ICCR [3] Select master transmit mode.
Section 18 I2C Bus Interface (IIC) The transmission procedure and operations by which data is sequentially transmitted in synchronization with ICDR (ICDRT) write operations, are described below. 1. Initialize the IIC as described in section 18.4.2, Initialization. 2. Read the BBSY flag in ICCR to confirm that the bus is free. 3. Set bits MST and TRS to 1 in ICCR to select master transmit mode. 4. Write 1 to BBSY and 0 to SCP in ICCR.
Section 18 I2C Bus Interface (IIC) 12. Clear the IRIC flag to 0. Write 0 to ACKE in ICCR, to clear received ACKB contents to 0. Write 0 to BBSY and SCP in ICCR. This changes SDA from low to high when SCL is high, and generates the stop condition.
Section 18 I2C Bus Interface (IIC) Stop condition issuance SCL (master output) 8 9 SDA Bit 0 (master output) Data 1 SDA (slave output) [7] 1 2 3 4 Bit 7 Bit 6 Bit 5 Bit 4 5 6 7 8 Bit 3 Bit 2 Bit 1 Bit 0 9 [10] Data 2 A A ICDRE IRIC IRTR ICDR Data 2 Data 1 User processing [9] ICDR write [9] IRIC clear [11] ACKB read [12] IRIC clear [12] BBSY set to 1 and SCP cleared to 0 (Stop condition issuance) Figure 18.
Section 18 I2C Bus Interface (IIC) Receive Operation Using the HNDS Function (HNDS = 1): Figure 18.10 shows the sample flowchart for the operations in master receive mode (HNDS = 1). Master receive mode Set TRS = 0 in ICCR Set ACKB = 0 in ICSR [1] Select receive mode. Set HNDS = 1 in ICXR Clear IRIC in ICCR Last receive? Yes [2] Start receiving. The first read is a dummy read.
Section 18 I2C Bus Interface (IIC) The reception procedure and operations by which the data reception process is provided in 1-byte units with SCL fixed low at each data reception are described below. 1. Clear the TRS bit in ICCR to 0 to switch from transmit mode to receive mode. Clear the ACKB bit in ICSR to 0 (acknowledge data setting). Set the HNDS bit in ICXR to 1. Clear the IRIC flag to 0 to determine the end of reception.
Section 18 I2C Bus Interface (IIC) Master receive mode Master transmit mode SCL is fixed low until ICDR is read SCL is fixed low until ICDR is read SCL (master output) 9 1 2 3 4 5 6 7 8 SDA (slave output) A Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 1 2 Bit 7 Bit 6 9 [3] Data 1 SDA (master output) Data 2 A IRIC IRTR ICDRF ICDRR Data 1 Undefined value User processing [1] TRS cleared to 0 [6] ICDR read (Data 1) [4] IRIC clear [2] ICDR read (Dummy read) [1] IRIC
Section 18 I2C Bus Interface (IIC) Receive Operation Using the Wait Function: Figures 18.13 and 18.14 show the sample flowcharts for the operations in master receive mode (WAIT = 1). Master receive mode Set TRS = 0 in ICCR [1] Select receive mode. Set ACKB = 0 in ICSR Set HNDS = 0 in ICXR Clear IRIC in ICCR Set WAIT = 1 in ICMR [2] Start receiving. The first read is a dummy read.
Section 18 I2C Bus Interface (IIC) Master receive mode Set TRS = 0 in ICCR Set ACKB = 0 in ICSR Set HNDS = 0 in ICXR [1] Select receive mode. Clear IRIC in ICCR Set WAIT = 0 in ICMR Read ICDR [2] Start receiving. The first read is a dummy read. Read IRIC in ICCR No IRIC = 1? [3] Wait for a receive wait (Set IRIC at the fall of the 8 th clock) Yes No Set ACKB = 1 in ICSR [7] Set acknowledge data for the last reception.
Section 18 I2C Bus Interface (IIC) 1. Clear the TRS bit in ICCR to 0 to switch from transmit mode to receive mode. Clear the ACKB bit in ICSR to 0 to set the acknowledge data. Clear the HNDS bit in ICXR to 0 to cancel the handshake function. Clear the IRIC flag to 0, and then set the WAIT bit in ICMR to 1. 2. When ICDR is read (dummy data is read), reception is started, and the receive clock is output, and data received, in synchronization with the internal clock. 3.
Section 18 I2C Bus Interface (IIC) 12. The IRIC flag is set to 1 in either of the following cases. (1) At the fall of the 8th receive clock pulse for one frame SCL is automatically fixed low in synchronization with the internal clock until the IRIC flag is cleared. (2) At the rise of the 9th receive clock pulse for one frame The IRTR and ICDRF flags are set to 1, indicating that one frame of data has been received. 13. Read the IRTR flag in ICSR.
Section 18 I2C Bus Interface (IIC) Master transmit mode SCL (master output) SDA (slave output) Master receive mode 9 1 2 A Bit 7 Bit 6 3 Bit 5 4 5 6 7 8 9 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 1 2 Bit 7 Data 1 [3] SDA (master output) Bit 6 3 4 5 Bit 5 Bit 4 Bit 3 Data 2 [3] A IRIC [4]IRTR=0 IRTR [4] IRTR=1 ICDR Data 1 User processing [1] TRS cleared to 0 IRIC clear to 0 [6] IRIC clear [5] ICDR read [6] IRIC clear (to end wait insertion) (Data 1) [2] ICDR read (dummy re
Section 18 I2C Bus Interface (IIC) 18.4.5 Slave Receive Operation 2 In I C bus format slave receive mode, the master device outputs the transmit clock and transmit data, and the slave device returns an acknowledge signal. The slave device operates as the device specified by the master device when the slave address in the first frame following the start condition that is issued by the master device matches its own address. Rev. 2.00 Aug.
Section 18 I2C Bus Interface (IIC) Receive Operation Using the HNDS Function (HNDS = 1): Figure 18.17 shows the sample flowchart for the operations in slave receive mode (HNDS = 1). Slave receive mode Initialize IIC Set MST = 0 and TRS = 0 in ICCR Set ACKB = 0 in ICSR and HNDS = 1 in ICXR Clear IRIC in ICCR ICDRF = 1? No [1] Initialization. Select slave receive mode. [2] Read the receive data remaining unread.
Section 18 I2C Bus Interface (IIC) The reception procedure and operations using the HNDS bit function by which data reception process is provided in 1-byte unit with SCL being fixed low at every data reception, are described below. 1. Initialize the IIC as described in section 18.4.2, Initialization. Clear the MST and TRS bits to 0 to set slave receive mode, and set the HNDS bit to 1 and the ACKB bit to 0. Clear the IRIC flag in ICCR to 0 to see the end of reception. 2. Confirm that the ICDRF flag is 0.
Section 18 I2C Bus Interface (IIC) Start condition generation SCL (Pin waveform) SCL (master output) SCL (slave output) SDA (master output) SDA (slave output) [7] SCL is fixed low until ICDR is read 1 2 3 4 5 6 7 8 9 1 2 1 2 3 4 5 6 7 8 9 1 2 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Slave address Bit 7 R/W Bit 6 Data 1 [6] A Interrupt request occurrence IRIC ICDRF Address+R/W ICDRS ICDRR Address+R/W Undefined value User processing [2] ICDR read [8] IRIC
Section 18 I2C Bus Interface (IIC) Continuous Receive Operation: Figure 18.20 shows the sample flowchart for the operations in slave receive mode (HNDS = 0). Slave receive mode Set MST = 0 and TRS = 0 in ICCR [1] Select slave receive mode. Set ACKB = 0 in ICSR Set HNDS = 0 in ICXR Clear IRIC in ICCR ICDRF = 1? No [2] Read the receive data remaining unread.
Section 18 I2C Bus Interface (IIC) The reception procedure and operations in slave receive are described below. 1. Initialize the IIC as described in section 18.4.2, Initialization. Clear the MST and TRS bits to 0 to set slave receive mode, and set the HNDS and ACKB bits to 0. Clear the IRIC flag in ICCR to 0 to see the end of reception. 2. Confirm that the ICDRF flag is 0. If the ICDRF flag is set to 1, read the ICDR and then clear the IRIC flag to 0. 3.
Section 18 I2C Bus Interface (IIC) Receive operations can be performed continuously by repeating steps 9 to 13. 14. Confirm that the ICDRF flag is set to 1, and read ICDR. 15. Clear the IRIC flag.
Section 18 I2C Bus Interface (IIC) Stop condition detection SCL (master output) 8 9 SDA (master output) Bit 0 Data (n-2) SDA (slave output) 1 2 3 4 5 6 7 8 9 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 [11] Data (n-1) A 1 2 3 4 5 6 7 8 9 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 [11] Data (n) A [11] [12] A IRIC ICDRF ICDRS Data (n-2) ICDRR Data (n-1) Data (n-2) [9] Wait for one frame User processing [13] IRIC clear Data (n) Data (n-1) [13] IRIC clear [10] ICDR
Section 18 I2C Bus Interface (IIC) 18.4.6 Slave Transmit Operation If the slave address matches to the address in the first frame (address reception frame) following the start condition detection when the 8th bit data (R/W) is 1 (read), the TRS bit in ICCR is automatically set to 1 and the mode changes to slave transmit mode. Figure 18.23 shows the sample flowchart for the operations in slave transmit mode.
Section 18 I2C Bus Interface (IIC) In slave transmit mode, the slave device outputs the transmit data, while the master device outputs the receive clock and returns an acknowledge signal. The transmission procedure and operations in slave transmit mode are described below. 1. Initialize slave receive mode and wait for slave address reception. 2.
Section 18 I2C Bus Interface (IIC) 10. When the stop condition is detected, that is, when SDA is changed from low to high when SCL is high, the BBSY flag in ICCR is cleared to 0 and the STOP flag in ICSR is set to 1. When the STOPIM bit in ICXR is 0, the IRIC flag is set to 1. If the IRIC flag has been set, it is cleared to 0.
Section 18 I2C Bus Interface (IIC) 18.4.7 IRIC Setting Timing and SCL Control The interrupt request flag (IRIC) is set at different times depending on the WAIT bit in ICMR, the FS bit in SAR, and the FSX bit in SARX. If the ICDRE or ICDRF flag is set to 1, SCL is automatically held low after one frame has been transferred; this timing is synchronized with the internal clock. Figures 18.25 to 18.27 show the IRIC set timing and SCL control.
Section 18 I2C Bus Interface (IIC) When WAIT = 1, and FS = 0 or FSX = 0 (I2C bus format, wait inserted) SCL SDA 8 9 1 2 3 8 A 1 2 3 IRIC User processing Clear IRIC Clear IRIC (a) Data transfer ends with ICDRE=0 at transmission, or ICDRF=0 at reception. SCL SDA 8 9 1 8 A 1 IRIC User processing Clear IRIC Write to ICDR (transmit) or read from ICDR (receive) (b) Data transfer ends with ICDRE=1 at transmission, or ICDRF=1 at reception. Figure 18.
Section 18 I2C Bus Interface (IIC) When FS = 1 and FSX = 1 (clocked synchronous serial format) SCL SDA 7 8 7 8 1 1 2 2 3 3 4 4 IRIC User processing Clear IRIC (a) Data transfer ends with ICDRE=0 at transmission, or ICDRF=0 at reception. SCL SDA 7 8 1 7 8 1 IRIC User processing Clear IRIC Write to ICDR (transmit) or read from ICDR (receive) Clear IRIC (b) Data transfer ends with ICDRE=1 at transmission, or ICDRF=1 at reception. Figure 18.
Section 18 I2C Bus Interface (IIC) 18.4.8 Operation Using the DTC This LSI provides the DTC to allow continuous data transfer. The DTC is initiated when the IRTR flag is set to 1, which is one of the two interrupt flags (IRTR and IRIC). When the ACKE bit is 0, the ICDRE, IRIC, and IRTR flags are set at the end of data transmission regardless of the acknowledge bit value.
Section 18 I2C Bus Interface (IIC) Table 18.
Section 18 I2C Bus Interface (IIC) 18.4.9 Noise Canceler The logic levels at the SCL and SDA pins are routed through noise cancelers before being latched internally. Figure 18.28 shows a block diagram of the noise canceler. The noise canceler consists of two cascaded latches and a match detector. The SCL (or SDA) pin input signal is sampled on the system clock, but is not passed forward to the next circuit unless the outputs of both latches agree. If they do not agree, the previous value is held.
Section 18 I2C Bus Interface (IIC) The following items are not initialized: • Actual register values (ICDR, SAR, SARX, ICMR, ICCR, ICSR, ICXR (other than ICDRE and ICDRF)) • Internal latches used to retain register read information for setting/clearing flags in the ICMR, ICCR, and ICSR registers • The value of the ICMR register bit counter (BC2 to BC0) • Generated interrupt sources (interrupt sources transferred to the interrupt controller) Notes on Initialization: • Interrupt flags and interrupt sources a
Section 18 I2C Bus Interface (IIC) 18.5 Interrupt Source The IIC interrupt source is IICI. The IIC interrupt sources and their priority order are shown in table 18.10. Each interrupt source is enabled or disabled by the ICCR interrupt enable bit and transferred to the interrupt controller independently. Table 18.
Section 18 I2C Bus Interface (IIC) 18.6 Usage Notes 1. In master mode, if an instruction to generate a start condition is immediately followed by an instruction to generate a stop condition, neither condition will be output correctly. To output consecutive start and stop conditions*, after issuing the instruction that generates the start 2 condition, read the relevant DR registers of I C bus output pins, check that SCL and SDA are both low.
Section 18 I2C Bus Interface (IIC) 4. SCL and SDA input are sampled in synchronization with the internal clock. The AC timing therefore depends on the system clock cycle tcyc, as shown in section 31, Electrical 2 Characteristics. Note that the I C bus interface AC timing specification will not be met with a system clock frequency of less than 5 MHz. 2 5. The I C bus interface specification for the SCL rise time tsr is 1000 ns or less (300 ns for high2 speed mode).
Section 18 I2C Bus Interface (IIC) 2 6. The I C bus interface specifications for the SCL and SDA rise and fall times are under 1000 ns 2 and 300 ns. The I C bus interface SCL and SDA output timing is prescribed by tcyc, as shown in 2 table 18.11. However, because of the rise and fall times, the I C bus interface specifications may not be satisfied at the maximum transfer rate. Table 18.
Section 18 I2C Bus Interface (IIC) 2 Table 18.13 I C Bus Timing (with Maximum Influence of tSr/tSf) Time Indication (at Maximum Transfer Rate) [ns] 2 tSr/tSf Influence (Max.) I C Bus Specification (Min.) φ = 20 MHz φ = 25 MHz φ = 34 MHz Item tcyc Indication Standard mode φ/200 φ/224 φ/224 High-speed mode φ/48 φ/56 φ/80 tSCLHO 0.5 tSCLO (–tSr) Standard mode –1000 4000 4000 3480 3706 High-speed mode –300 600 900 820 876 tSCLLO 0.
Section 18 I2C Bus Interface (IIC) 7. Notes on ICDR register read at end of master reception To halt reception at the end of a receive operation in master receive mode, set the TRS bit to 1 and write 0 to BBSY and SCP in ICCR. This changes SDA from low to high when SCL is high, and generates the stop condition.
Section 18 I2C Bus Interface (IIC) 8. Notes on start condition issuance for retransmission Figure 18.30 shows the timing of start condition issuance for retransmission, and the timing for subsequently writing data to ICDR, together with the corresponding flowchart. Write the transmit data to ICDR after the start condition for retransmission is issued and then the start condition is actually generated.
Section 18 I2C Bus Interface (IIC) 2 9. Note on when I C bus interface stop condition instruction is issued In a situation where the rise time of the 9th clock of SCL exceeds the stipulated value because of a large bus load capacity or where a slave device in which a wait can be inserted by driving the SCL pin low is used, the stop condition instruction should be issued after reading SCL after the rise of the 9th clock pulse and determining that it is low.
Section 18 I2C Bus Interface (IIC) Secures a high period SCL VIH SCL = low detected SDA IRIC [1] SCL = low determination [2] IRIC clear Figure 18.32 IRIC Flag Clearing Timing When WAIT = 1 Note: This restriction on usage can be canceled by setting the FNC1 and FNC0 bits to B'11 in ICXR. 11. Note on ICDR register read and ICCR register access in slave transmit mode 2 In I C bus interface slave transmit mode, do not read ICDR or do not read/write from/to ICCR during the time shaded in figure 18.33.
Section 18 I2C Bus Interface (IIC) Waveform at problem occurrence SDA R/W A SCL 8 9 TRS bit Bit 7 Address reception Data transmission ICDR read and ICCR read/write are disabled ICDR write (6 system clock period) The rise of the 9th clock is detected Figure 18.33 ICDR Register Read and ICCR Register Access Timing in Slave Transmit Mode Note: This restriction on usage can be canceled by setting the FNC1 and FNC0 bits to B'11 in ICXR. 12.
Section 18 I2C Bus Interface (IIC) Restart condition (a) (b) A SDA SCL TRS 8 9 1 Data transmission 2 3 4 5 6 7 8 9 Address reception TRS bit setting is suspended in this period ICDR dummy read TRS bit setting The rise of the 9th clock is detected The rise of the 9th clock is detected Figure 18.34 TRS Bit Set Timing in Slave Mode Note: This restriction on usage can be canceled by setting the FNC1 and FNC0 bits to B'11 in ICXR. 13.
Section 18 I2C Bus Interface (IIC) 14. Note on ACKE and TRS bits in slave mode 2 In the I C bus interface, if 1 is received as the acknowledge bit value (ACKB = 1) in transmit mode (TRS = 1) and then the address is received in slave mode without performing appropriate processing, interrupt handling may start at the rising edge of the 9th clock pulse even when the address does not match.
Section 18 I2C Bus Interface (IIC) • Arbitration is lost • The AL flag in ICSR is set to 1 I2C bus interface (Master transmit mode) S SLA R/W A DATA1 Transmit data match Transmit timing match Other device (Master transmit mode) S SLA R/W A Transmit data does not match DATA2 A DATA3 A Data contention I2C bus interface (Slave receive mode) S SLA R/W A • Receive address is ignored SLA R/W A DATA4 A • Automatically transferred to slave receive mode • Receive data is recognized as a
Section 19 LPC Interface (LPC) Section 19 LPC Interface (LPC) This LSI has an on-chip LPC interface. The LPC includes three register sets, each of which comprises data and status registers, control register, the fast Gate A20 logic circuit, and the host interrupt request circuit. The LPC performs serial transfer of cycle type, address, and data, synchronized with the 33 MHz PCI clock. It uses four signal lines for address/data and one for host interrupt requests.
Section 19 LPC Interface (LPC) • Supports SERIRQ Host interrupt requests are transferred serially on a single signal line (SERIRQ). On channel 1, HIRQ1 and HIRQ12 can be generated. On channels 2 and 3, SMI, HIRQ6, and HIRQ9 to HIRQ11 can be generated. In the SCIF, SMI, and HIRQ1 to HIRQ15 can be generated. Operation can be switched between quiet mode and continuous mode. The CLKRUN signal can be manipulated to restart the PCI clock (LCLK).
Section 19 LPC Interface (LPC) Figure 19.1 shows a block diagram of the LPC.
Section 19 LPC Interface (LPC) 19.2 Input/Output Pins Table 19.1 lists the LPC pin configuration. Table 19.
Section 19 LPC Interface (LPC) 19.3 Register Descriptions The LPC has the following registers.
Section 19 LPC Interface (LPC) The following registers are necessary for SMIC mode • SMIC flag register (SMICFLG) • SMIC control/status register (SMICCSR) • SMIC data register (SMICDTR) • SMIC interrupt register 0 (SMICIR0) • SMIC interrupt register 1 (SMICIR1) The following registers are necessary for BT mode • BT status register 0 (BTSR0) • BT status register 1 (BTSR1) • BT control/status register 0 (BTCSR0) • BT control/status register 1 (BTCSR1) • BT control register (BTCR) • BT data buffer (BTDTR) • B
Section 19 LPC Interface (LPC) 19.3.1 Host Interface Control Registers 0 and 1 (HICR0 and HICR1) HICR0 and HICR1 contain control bits that enable or disable LPC interface functions, control bits that determine pin output and the internal state of the LPC interface, and status flags that monitor the internal state of the LPC interface. • HICR0 R/W Bit Bit Name Initial Value 7 LPC3E 0 R/W LPC Enable 3 to 1 6 LPC2E 0 R/W 5 LPC1E 0 R/W Enable or disable the LPC interface function.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 4 FGA20E 0 R/W Slave Host Description R/W Fast Gate A20 Function Enable Enables or disables the fast Gate A20 function. The PD3DDR bit should be cleared to 0 when the LPC is used. With the fast Gate A20 disabled, the normal Gate A20 can be implemented by firmware controlling PD3 output.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 2 PMEE 0 R/W Slave Host Description R/W PME Output Enable Controls PME output in combination with the PMEB bit in HICR1. PME pin output is open-drain, and an external pull-up resistor (Vcc) is needed. The PD2DDR bit should be cleared to 0 when the LPC is used.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 0 LSCIE 0 R/W Slave Host Description R/W LSCI output Enable Controls LSCI output in combination with the LSCIB bit in HICR1. LSCI pin output is open-drain, and an external pull-up resistor (Vcc) is needed. The PD0DDR bit should be cleared to 0 when the LPC is used. [Legend] X: Don't care Rev. 2.00 Aug.
Section 19 LPC Interface (LPC) • HICR1 Bit Bit Name Initial Value 7 LPCBSY 0 R/W Slave Host Description R LPC Busy Indicates that the LPC interface is processing a transfer cycle.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 6 CLKREQ 0 R/W Slave Host Description R LCLK Request Indicates that the LPC interface's SERIRQ output is requesting a restart of LCLK.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 4 LRSTB 0 R/W Slave Host Description R/W LPC Software Reset Bit Resets the LPC interface. For the scope of initialization by an LPC reset, see section 19.4.6, LPC Interface Shutdown Function (LPCPD). 0: Normal state [Clearing conditions] • Writing 0 • LPC hardware reset 1: LPC software reset state [Setting condition] Writing 1 after reading LRSTB = 0 3 SDWNB 0 R/W LPC Software Shutdown Bit Controls LPC interface shutdown.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 1 LSMIB 0 R/W Slave Host Description R/W LSMI Output Bit Controls LSMI output in combination with the LSMIE bit. For details, refer to description on the LSMIE bit in HICR0. 0 LSCIB 0 R/W LSCI output Bit Controls LSCI output in combination with the LSCIE bit. For details, refer to description on the LSCIE bit in HICR0. Rev. 2.00 Aug.
Section 19 LPC Interface (LPC) 19.3.2 Host Interface Control Registers 2 and 3 (HICR2 and HICR3) HICR2 controls interrupts to an LPC interface slave (this LSI). HICR3 monitors the states of the LPC interface pins. Bits 6 to 0 in HICR2 are initialized to H'00 by a reset. The states of other bits are decided by the pin states. The pin states can be monitored by the pin monitoring bits regardless of the LPC interface operating state or the operating state of the functions that use pin multiplexing.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 4 ABRT 0 R/W Slave Host Description R/(W)* LPC Abort Interrupt Flag This bit is a flag that generates an ERRI interrupt when a forced termination (abort) of an LPC transfer cycle occurs.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 2 IBFIE2 0 R/W Slave Host Description R/W IDR2 Receive Complete interrupt Enable Enables or disables IBFI2 interrupt to the slave (this LSI). 0: Input data register (IDR2) receive complete interrupt requests disabled 1: Input data register (IDR2) receive complete interrupt requests enabled 1 IBFIE1 0 R/W IDR1 Receive Complete interrupt Enable Enables or disables IBFI1 interrupt to the slave (this LSI).
Section 19 LPC Interface (LPC) 19.3.3 Host Interface Control Register 4 (HICR4) HICR4 controls the operation of the KCS, SMIC, and BT interface functions on channel 3. Initial Value Bit Bit Name 7 LADR12SEL 0 R/W Slave Host Description R/W Switches the channel accessed via LADR12H and LADR12L. 0: LADR1 is selected 1: LADR2 is selected 6 to 4 All 0 R/W Reserved The initial value should not be changed.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 1 SMICENBL 0 R/W Enables or disables the use of the SMIC interface included in channel 3. When the LPC3E bit in HICR0 is 0, this bit is valid. 0: SMIC interface operation is disabled No address (LADR3) matches for SMICFLG, SSMICCSR, or SMICDTR 1: SMIC interface operation is enabled 0 BTENBL 0 R/W Enables or disables the use of the BT interface included in channel 3.
Section 19 LPC Interface (LPC) 19.3.5 Pin Function Control Register (PINFNCR) PINFNCR selects whether the pins of the associated port are used for the LPC function or general I/O. R/W Initial Value Slave Host Description 7 to 3 All 0 R/W Reserved The initial value bit should not be changed. 2 SERIRQOFF 0 R/W 0: SERIRQ pin 1: General I/O port 1 LPCPDOFF 0 R/W 0 CLKRUNOFF 0 R/W 0: LPCPD pin 1: General I/O port 0: CLKRUN pin 1: General I/O port Bit Bit Name 19.3.
Section 19 LPC Interface (LPC) Table 19.
Section 19 LPC Interface (LPC) 19.3.7 LPC Channel 3 Address Register H, L (LADR3H, LADR3L) LADR3 comprises two 8-bit readable/writable registers that perform LPC channel 3 host address setting and control the operation of the bidirectional data registers. The contents of the address field in LADR3 must not be changed while channel 3 is operating (while LPC3E is set to 1).
Section 19 LPC Interface (LPC) When LPC3E = 1, an I/O address received in an LPC I/O cycle is compared with the contents of LADR3. When determining an IDR3, ODR3, or STR3 address match, bit 0 in LADR3 is regarded as 0, and the value of bit 2 is ignored. When determining a TWR0 to TWR15 address match, bit 4 of LADR3 is inverted, and the values of bits 3 to 0 are ignored.
Section 19 LPC Interface (LPC) • KCS mode I/O Address Bits 15 to5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Transfer Cycle Host Register Selection Bits 15 to5 Bit 4 0 0 1 0 I/O write IDR3 write, C/D3 ← 0 Bits 15 to5 Bit 4 0 0 1 1 I/O write IDR3 write, C/D3 ← 1 Bits 15 to5 Bit 4 0 0 1 0 I/O read ODR3 read Bits 15 to5 Bit 4 0 0 1 1 I/O read STR3 read • BT mode I/O Address Bits 15 to5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Transfer Cycle Host Register Selection Bits 15 to5 Bit 4 0
Section 19 LPC Interface (LPC) 19.3.8 Input Data Registers 1 to 3 (IDR1 to IDR3) The IDR registers are 8-bit read-only registers to the slave processor (this LSI), and 8-bit writeonly registers to the host processor. The registers selected from the host according to the I/O address are described in the following sections: for information on IDR1 and IDR2 selection, see section 19.3.6, LPC Channel 1, 2 Address Register H, L (LADR12H, LADR12L), and for information on IDR3 selection, see section 19.3.
Section 19 LPC Interface (LPC) 19.3.10 Bidirectional Data Registers 0 to 15 (TWR0 to TWR15) TWR0 to TWR15 are sixteen 8-bit readable/writable registers to both the slave processor (this LSI) and the host processor. In TWR0, however, two registers (TWR0MW and TWR0SW) are allocated to the same address for both the host address and the slave address.
Section 19 LPC Interface (LPC) 19.3.11 Status Registers 1 to 3 (STR1 to STR3) The STR registers are 8-bit registers that indicate status information during LPC interface processing. Bits 3, 1, and 0 in STR1 to STR3 are read-only bits to both the host processor and the slave processor (this LSI). However, 0 only can be written from the slave processor (this LSI) to bit 0 in STR1 to STR3, and bits 6 and 4 in STR3, in order to clear the flags to 0.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 1 IBF1 0 R R Input Data Register Full Indicates whether or not there is receive data in IDR1. This bit is an internal interrupt source to the slave processor (this LSI). The IBF1 flag setting and clearing conditions are different when the fast A20 gate is used. For details see table 19.7.
Section 19 LPC Interface (LPC) • STR2 R/W Bit Bit Name Initial Value Slave Host Description 7 DBU27 0 R/W R Defined by User 6 DBU26 0 R/W R The user can use these bits as necessary. 5 DBU25 0 R/W R 4 DBU24 0 R/W R 3 C/D2 0 R R Command/Data When the host writes to IDR2, bit 2 of the I/O address (when CH2OFFSEL1 = 0) or bit 0 of the I/O address (when CH2OFFSEL1 = 1) is written to this bit to indicate whether IDR2 contains data or a command.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 0 OBF2 0 R/(W)* R Output Data Register Full Indicates whether or not there is transmit data in ODR2. 0: There is not transmit data in ODR2 [Clearing conditions] • • When the host reads ODR2 in an I/O read cycle When the slave writes 0 to bit OBF2 1: There is transmit data in ODR2 [Setting condition] • Note: * Only 0 can be written to clear the flag. Rev. 2.00 Aug.
Section 19 LPC Interface (LPC) • STR3 (TWRE = 1 or SELSTR3 = 0) R/W Bit Bit Name Initial Value Slave Host Description 7 IBF3B 0 R R Bidirectional Data Register Input Buffer Full Flag This is an internal interrupt source to the slave (this LSI).
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 3 C/D3 R 0 R Command/Data Flag When the host writes to IDR3, bit 2 of the I/O address is written into this bit to indicate whether IDR3 contains data or a command. 0: Content of input data register (IDR3) is a data 1: Content of input data register (IDR3) is a command 2 DBU32 0 R/W R Defined by User The user can use this bit as necessary.
Section 19 LPC Interface (LPC) • STR3 (TWRE = 0 and SELSTR3 = 1) R/W Bit Bit Name Initial Value Slave Host Description 7 DBU37 0 R/W R Defined by User 6 DBU36 0 R/W R The user can use these bits as necessary. 5 DBU35 0 R/W R 4 DBU34 0 R/W R 3 C/D3 0 R R Command/Data Flag When the host writes to IDR3, bit 2 of the I/O address is written into this bit to indicate whether IDR3 contains data or a command.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 0 OBF3A 0 R/(W)* R Output Data Register Full Indicates whether or not there is transmit data in ODR3. 0: There is not receive data in ODR3 [Clearing conditions] • When the host reads ODR3 in an I/O read cycle • When the slave writes 0 to bit OBF3A 1: There is receive data in ODR3 [Setting condition] • When the slave writes to ODR3 Note: * Only 0 can be written to clear the flag. Rev. 2.00 Aug.
Section 19 LPC Interface (LPC) 19.3.12 SERIRQ Control Register 0 (SIRQCR0) SIRQCR0 contains status bits that indicate the SERIRQ operating mode and bits that specify SERIRQ interrupt sources. R/W Bit Bit Name Initial Value Slave Host Description 7 Q/C 0 R Quiet/Continuous Mode Flag Indicates the mode specified by the host at the end of an SERIRQ transfer cycle (stop frame).
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 4 SMIE3B 0 R/W Host SMI Interrupt Enable 3B Enables or disables an SMI interrupt request when OBF3B is set by a TWR15 write.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 2 SMIE2 0 R/W Host SMI Interrupt Enable 2 Enables or disables an SMI interrupt request when OBF2 is set by an ODR2 write.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 0 IRQ1E1 0 R/W Host IRQ1 Interrupt Enable 1 Enables or disables a host HIRQ1 interrupt request when OBF1 is set by an ODR1 write.
Section 19 LPC Interface (LPC) 19.3.13 SERIRQ Control Register 1 (SIRQCR1) SIRQCR1 contains status bits that indicate the SERIRQ operating mode and bits that specify SERIRQ interrupt sources. R/W Bit Bit Name Initial Value Slave Host Description 7 IRQ11E3 0 R/W Host IRQ11 Interrupt Enable 3 Enables or disables an HIRQ11 interrupt request when OBF3A is set by an ODR3 write.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 5 IRQ9E3 0 R/W Host IRQ9 Interrupt Enable 3 Enables or disables an HIRQ9 interrupt request when OBF3A is set by an ODR3 write.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 3 IRQ11E2 0 R/W Host IRQ11 Interrupt Enable 2 Enables or disables an HIRQ11 interrupt request when OBF2 is set by an oDR2 write.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 1 IRQ9E2 0 R/W Host IRQ9 Interrupt Enable 2 Enables or disables an HIRQ9 interrupt request when OBF2 is set by an oDR2 write.
Section 19 LPC Interface (LPC) 19.3.14 SERIRQ Control Register 2 (SIRQCR2) SIRQCR2 contains bits that enable or disable SERIRQ interrupt requests and select the host interrupt request outputs. R/W Bit Bit Name Initial Value Slave Host Description 7 IEDIR3 0 R/W Interrupt Enable Direct Mode 3 Selects whether an SERIRQ interrupt generation of LPC channel 3 is affected only by a host interrupt enable bit or by an OBF flag in addition to the enable bit.
Section 19 LPC Interface (LPC) 19.3.15 SERIRQ Control Register 3 (SIRQCR3) SIRQCR3 selects the SERIRQ interrupt requests of the SCIF. R/W Initial Value Slave Host Description 7 to 4 All 0 R/W 3 SCSIRQ3 0 R/W SCIF SERIRQ Interrupt Select 2 SCSIRQ2 0 R/W 1 SCSIRQ1 0 R/W These bits select the SCIF interrupt request to the host. 0 SCSIRQ0 0 R/W 0000: No interrupt request to the host Bit Bit Name Reserved The initial value should not be changed.
Section 19 LPC Interface (LPC) 19.3.16 SERIRQ Control Register 4 (SIRQCR4) SIRQCR4 controls LPC interrupt requests to the host.
Section 19 LPC Interface (LPC) 19.3.17 SERIRQ Control Register 5 (SIRQCR5) SIRQCR5 selects the output of the host interrupt request signal of each frame. R/W Bit Bit Name Initial Value 7 SELIRQ15 0 R/W SERIRQ Output Select 6 SELIRQ14 0 R/W 5 SELIRQ13 0 R/W 4 SELIRQ8 0 R/W These bits select the state of the output on the pin for LPC host interrupt requests (HIRQ15, HIRQ14, HIRQ13, HIRQ8, HIRQ7, HIRQ5, HIRQ4, and HIRQ3).
Section 19 LPC Interface (LPC) 19.3.18 Host Interface Select Register (HISEL) HISEL selects the function of bits 7 to 4 in STR3 and selects the output of the host interrupt request signal of each frame. Bit Bit Name Initial Value 7 SELSTR3 0 R/W Slave Host Description R/W Status Register 3 Selection Selects the function of bits 7 to 4 in STR3 in combination with the TWRE bit in LADR3L. For details of STR3, see section 19.3.11, Status Registers 1 to 3 (STR1 to STR3).
Section 19 LPC Interface (LPC) 19.3.19 SCIF Address Register (SCIFADRH, SCIFADRL) SCIFADR sets the host address for the SCIF. Do not change the contents of SCIFADR while the SCIF is operating (i.e. while SCIFE is set to 1). • SCIFADRH R/W Bit Bit Name Initial Value 7 0 R/W SCIF Address 15 to 8 6 0 R/W These bits set the host address for the SCIF.
Section 19 LPC Interface (LPC) 19.3.20 SMIC Flag Register (SMICFLG) SMICFLG is one of the registers used to implement SMIC mode. This register includes bits that indicate whether or not the system is ready to data transfer and those that are used for handshake of the transfer cycles. R/W Bit Bit Name Initial Value Slave Host Description 7 0 RX_DATA_RDY R/W R Read Transfer Ready Indicates whether or not the slave is ready for the host read transfer.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 1 0 R/W R Reserved The initial value should not be changed. 0 BUSY 0 R/(W)* W SMIC Busy This bit indicates that the slave is now transferring data. This bit can be cleared only by the slave and set only by the host. The rising edge of this bit is a source of internal interrupt to the slave. 0: Transfer cycle wait state [Clearing conditions] After the slave reads BUSY = 1, writes 0 to this bit.
Section 19 LPC Interface (LPC) 19.3.23 SMIC Interrupt Register 0 (SMICIR0) SMICIR0 is one of the registers used to implement SMIC mode. This register includes the bits that indicate the source of interrupt to the slave. R/W Bit Bit Name Initial Value Slave Host Description 7 to 5 All 0 R/W Reserved The initial value should not be changed.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 2 STARI 0 R/(W)* Status Code Receive End Interrupt This is a status flag that indicates that the host has finished receiving the status code from SMICCSR. When the IBFIE3 bit and STARIE bit are set to 1, the IBFI3 interrupt is requested to the slave. 0: Status code receive wait state [Clearing condition] After the slave reads STARI = 1, writes 0 to this bit.
Section 19 LPC Interface (LPC) 19.3.24 SMIC Interrupt Register 1 (SMICIR1) SMICIR1 is one of the registers used to implement SMIC mode. This register includes the bits that enables/disables an interrupt to the slave. The IBFI3 interrupt is enabled by setting the IBFIE3 bit in HICR2 to 1. R/W Bit Bit Name Initial Value Slave Host Description 7 to 5 4 All 0 HDTWIE 0 R/W Reserved The initial value should not be changed.
Section 19 LPC Interface (LPC) 19.3.25 BT Status Register 0 (BTSR0) BTSR0 is one of the registers used to implement BT mode. This register includes flags that control interrupts to the slave (this LSI). R/W Bit Bit Name Initial Value Slave Host Description 7 to 5 All 0 R/W Reserved The initial value should not be changed. 4 FRDI 0 R/(W)* FIFO Read Request Interrupt This status flag indicates that host writes the data to BTDTR buffer with FIFO full state at the host write transfer.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 2 HWRI 0 R/(W)* BT Host Write Interrupt This status flag indicates that the host writes 1byte to BTDTR buffer. When the IBFIE3 bit and HWRIE bit are set to 1, IBFI3 interrupt is requested to the slave. 0: Host BTDTR write wait state [Clearing condition] After the slave reads HWRI = 1, writes 0 to this bit. 1: The host writes to BTDTR [Setting condition] The host writes one byte to BTDTR.
Section 19 LPC Interface (LPC) R/W Bit Bit Name Initial Value Slave Host Description 0 HBTRI 0 R/(W)* BTDTR Host Read End Interrupt This status flag indicates that the host reads all valid data from BTDTR buffer. When the BFIE3 bit and HBTRIE bit are set to 1, IBFI3 interrupt is requested to the slave. 0: BTDTR host read end wait state [Clearing condition] After the slave reads HBTRI = 1 and writes 0 to this bit.
Section 19 LPC Interface (LPC) 19.3.26 BT Status Register 1 (BTSR1) BTSR1 is one of the registers used to implement the BT mode. This register includes a flag that controls an interrupt to the slave (this LSI). R/W Bit Bit Name Initial Value Slave Host Description 7 0 R/W Reserved The initial value should not be changed. 6 HRSTI 0 R/(W)* BT Reset Interrupt This status flag indicates that the BMC_HWRST bit in BTIMSR is set to 1 by the host.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 4 BEVTI 0 R/W Slave Host Description R/(W)* BEVT_ATN Clear Interrupt This status flag indicates that the BEVT_ATN bit in BTCR is cleared by the host. When the IBFIE3 bit and BEVTIE bit are set to 1, IBFI3 interrupt is requested to the slave. 0: [Clearing condition] When the slave reads BEVTI = 1 and writes 0 to this bit. 1: [Setting condition] When the slave detects the falling edge of BEVT_ATN.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 1 CRRPI 0 R/W Slave Host Description R/(W)* Read Pointer Clear Interrupt This status flag indicates that the CLR_RD_PTR bit in BTCR is set to 1 by the host. When the IBFIE3 bit and CRRPIE bit are set to 1, the IBFI3 interrupt is requested to the slave. 0: [Clearing condition] After the slave reads CRRPI = 1, writes 0 to this bit. 1: [Setting condition] When the slave detects the rising edge of CLR_RD_PTR.
Section 19 LPC Interface (LPC) 19.3.27 BT Control Status Register 0 (BTCSR0) BTCSR0 is one of the registers used to implement the BT mode. The BTCSR0 register contains the bits used to switch FIFOs in BT transfer, and enable or disable the interrupts to the slave (this LSI). The IBFI3 interrupt is enabled by setting the IBFIE3 bit in HICR2 to 1. Bit Bit Name Initial Value 7 0 R/W Slave Host Description R/W Reserved The initial value should not be changed.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 1 HBTWIE 0 R/W Slave Host Description R/W BTDTR Host Write Start Interrupt Enable Enables or disables the HBTWI interrupt which is an IBFI3 interrupt source to the slave. 0: BTDTR host write start interrupt is disabled. 1: BTDTR host write start interrupt is enabled. 0 HBTRIE 0 R/W BTDTR Host Read End Interrupt Enable Enables or disables the HBTRI interrupt which is an IBFI3 interrupt source to the slave.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value 5 IRQCRIE 0 R/W Slave Host R/W Description B2H_IRQ Clear Interrupt Enable Enables or disables the IRQCRI interrupt which is an IBFI3 interrupt source to the slave. 0: B2H_IRQ clear interrupt is disabled. 1: B2H_IRQ clear interrupt is enabled. 4 BEVTIE 0 R/W BEVT_ATN Clear Interrupt Enable Enables or disables the BEVTI interrupt which is an IBFI3 interrupt source to the slave. 0: BEVT_ATN clear interrupt is disabled.
Section 19 LPC Interface (LPC) 19.3.29 BT Control Register (BTCR) BTCR is one of the registers used to implement BT mode. The BTCR register contains bits used in transfer cycle handshaking, and those indicating the completion of data transfer to the buffer. Bit Bit Name R/W Initial Value Slave Host 7 B_BUSY 1 R/W R Description BT Write Transfer Busy Flag Read-only bit from the host. Indicates that the BTDTR buffer is being used for BT write transfer (write transfer is in progress.
Section 19 LPC Interface (LPC) Bit 4 Bit Name Initial Value BEVT_ATN 0 R/W Slave R/(W)* Host 1 R/(W)* Description 5 Event Interrupt Sets when the slave detects an event to the host. Setting the B2H_IRQ_EN bit in the BTIMSR register enables the BEVT_ATN bit to be used as an interrupt source to the host. 0: No event interrupt request is available [Clearing condition] When the host writes a 1 to the bit.
Section 19 LPC Interface (LPC) Bit 1 Bit Name CLR_RD_ PTR Initial Value 0 R/W Slave Host Description 2 1 R/(W)* (W)* Read Pointer Clear This bit is used by the host to clear the read pointer during read transfer. A host read operation always yields 0 on readout. 0: Read pointer clear wait [Clearing condition] When the slave writes a 0 after a 1 has been read from CLR_RD_PTR. 1: Read pointer clear [Setting condition] When the host writes a 1.
Section 19 LPC Interface (LPC) 19.3.30 BT Data Buffer (BTDTR) BTDTR is used to implement the BT mode. BTDTR consists of two FIFOs: the host write transfer FIFO and the host read transfer FIFO. Their capacities are 64 bytes each. When using BTDTR, enable FIFO by means of the bits FSEL0 and FSEL1.
Section 19 LPC Interface (LPC) Bit Bit Name Initial Value Slave R/W Host Description 4 4 OEM3 0 R/W R/(W)* User defined bit 3 OEM2 0 R/W 2 OEM1 0 R/W R/(W)* These bits are defined by the user and are valid 4 R/(W)* only when set to 1 by a 0 written from the host. 4 0: [Clearing condition] When the slave writes a 0, after a 1 has been read from OEM. 1: [Setting condition] When the slave writes a 1, after a 0 has been read from OEM, or when the host writes a 0.
Section 19 LPC Interface (LPC) 19.3.32 BT FIFO Valid Size Register 0 (BTFVSR0) BTFVSR0 is one of the registers used to implement BT mode. BTFVSR0 indicates a valid data size in the FIFO for host write transfer. R/W Bit Bit Name Initial Value Slave Host Description 7 to 0 N7 to N0 All 0 R These bits indicate the number of valid bytes in the FIFO (the number of bytes which the slave can read) for host write transfer.
Section 19 LPC Interface (LPC) 19.4 Operation 19.4.1 LPC interface Activation The LPC interface is activated by setting any one of bits LPC3E to LPC1E in HICR0 and bit SICIE bit in HICR5 to 1. When the LPC interface is activated, the related I/O port pins (PE7 to PE0, PD5 and PD4) function as dedicated LPC interface input/output pins. In addition, setting the FGA20E, PMEE, LSMIE, and LSCIE bits to 1 adds the related I/O port pins (PD3 to PD0) to the LPC interface's input/output pins.
Section 19 LPC Interface (LPC) An LPC transfer cycle is started when the LFRAME signal goes low in the bus idle state. If the LFRAME signal goes low when the bus is not idle, this means that a forced termination (abort) of the LPC transfer cycle has been requested. In an I/O read cycle or I/O write cycle, transfer is carried out using LAD3 to LAD0 in the following order, in synchronization with LCLK.
Section 19 LPC Interface (LPC) LCLK LFRAME LAD3 to LAD0 Start ADDR TAR Sync Data TAR Start Cycle type, direction, and size Number of clocks 1 1 4 2 1 2 2 1 Figure 19.2 Typical LFRAME Timing LCLK LFRAME LAD3 to LAD0 Start ADDR Cycle type, direction, and size TAR Sync Slave must stop driving Master will drive high Too many Syncs cause timeout Figure 19.3 Abort Mechanism 19.4.3 SMIC Mode Transfer Flow Figure 19.4 shows the write transfer flow and figure 19.
Section 19 LPC Interface (LPC) Slave Host Wait for BUSY = 0 Host confirms the BUSY bit in SMICFLG. The bit indicates slave (this LSI) is ready for receiving a new control code. When BUSY = 1, access from host is disabled. Bit that indicates slave is ready for write transfer. Issues when slave is ready for the next write transfer. Wait for TX_DATA_RDY = 1 Host confirms the TX_DATA_RDY bit in SMICFLG. The confirmation is unnecessary when Write Start control is issued.
Section 19 LPC Interface (LPC) Slave Host Wait for BUSY = 0 Bit that indicates slave is ready for read transfer. Issues when slave is ready for the next read transfer. Slave waits for the BUSY bit in SMICFLG is set. Waits for RX_DATA_RDY = 1 A Write control code Slave confirms that control code is written to SMICCSR by host. The CTLWI bit in SMICIR0 is set. Host confirms the BUSY bit in SMICFLG. The bit indicates slave (this LSI) is ready for receiving a new control code.
Section 19 LPC Interface (LPC) 19.4.4 BT Mode Transfer Flow Figure 19.6 shows the write transfer flow and figure 19.7 shows the read transfer flow in BT mode. Slave Host Slave waits for the H2B_ATN bit (interrupt from host) is set. Wait for B_BUSY = 0 Host confirms the B_BUSY bit in BTCR. Wait for H2B_ATN = 0 Host confirms the H2B_ATN bit in BTCR. Clear write pointer Confirms the CLR_WR_PTR bit. The CRWPI bit in BTSR1 is set to notify write pointer clearing as an interrupt to slave.
Section 19 LPC Interface (LPC) Slave Host Slave confirms the H_BUSY bit in BTCR. Slave writes data of 1 to n bytes to the BTDTR buffer. Slave sets the B2H_ATN bit in BTCR to indicate data write completion to the BTDTR buffer. Wait for H_BUSY = 0 Write BTDTR buffer B2H_ATN = 1 Generate host interrupt H_BUSY = 1 Clear read pointer Confirms the CLR_RD_PTR bit. The CRRPI bit in BTSR1 is set to notify read pointer clearing as an interrupt source to slave. Host sets the H_BUSY bit in BTCR.
Section 19 LPC Interface (LPC) 19.4.5 Gate A20 The Gate A20 signal can mask address A20 to emulate the address mode of the 8086* architecture CPU used in personal computers. Normally, the Gate A20 signal can be controlled by a firmware. The fast Gate A20 function that realizes high-seed performance by hardware is enabled by setting the FGA20E bit to 1 in HICR0. Note: An Intel microprocessor (1) Regular Gate A20 Operation Output of the Gate A20 signal can be controlled by an H'D1 command and data.
Section 19 LPC Interface (LPC) Start Host write No H'D1 command received? Yes Wait for next byte Host write No Data byte? Yes Write bit 1 of data byte to the bit of GA20 in DR Figure 19.8 GA20 Output Rev. 2.00 Aug.
Section 19 LPC Interface (LPC) Table 19.
Section 19 LPC Interface (LPC) 19.4.6 LPC Interface Shutdown Function (LPCPD) The LPC interface can be placed in the shutdown state according to the state of the LPCPD pin. There are two kinds of LPC interface shutdown state: LPC hardware shutdown and LPC software shutdown. The LPC hardware shutdown state is controlled by the LPCPD pin, while the LPC software shutdown state is controlled by the SDWNB bit.
Section 19 LPC Interface (LPC) Table 19.8 shows the scope of the LPC interface pin shutdown. Table 19.
Section 19 LPC Interface (LPC) Table 19.
Section 19 LPC Interface (LPC) Figure 19.9 shows the timing of the LPCPD and LRESET signals. LCLK LPCPD LAD3 to LAD0 LFRAME At least 30 µs At least 100 µs At least 60 µs LRESET Figure 19.9 Power-Down State Termination Timing Rev. 2.00 Aug.
Section 19 LPC Interface (LPC) 19.4.7 LPC Interface Serialized Interrupt Operation (SERIRQ) A host interrupt request can be issued from the LPC interface by means of the SERIRQ pin. In a host interrupt request via the SERIRQ pin, LCLK cycles are counted from the start frame of the serialized interrupt transfer cycle generated by the host or a peripheral function, and a request signal is generated by the frame corresponding to that interrupt. The timing is shown in figure 19.10.
Section 19 LPC Interface (LPC) The serialized interrupt transfer cycle frame configuration is as follows. Two of the states comprising each frame are the recover state in which the SERIRQ signal is returned to the 1-level at the end of the frame, and the turnaround state in which the SERIRQ signal is not driven. The recover state must be driven by the host or slave that was driving the preceding state. Table 19.
Section 19 LPC Interface (LPC) There are two modescontinuous mode and quiet modefor serialized interrupts. The mode initiated in the next transfer cycle is selected by the stop frame of the serialized interrupt transfer cycle that ended before that cycle. In continuous mode, the host initiates host interrupt transfer cycles at regular intervals. In quiet mode, the slave with interrupt sources requiring a request can also initiate an interrupt transfer cycle, in addition to the host.
Section 19 LPC Interface (LPC) 19.5 Interrupt Sources 19.5.1 IBFI1, IBFI2, IBFI3, and ERRI The host has four interrupt requests for the slave (this LSI): IBF1, IBF2, IBF3, and ERRI. IBFI1, IBFI2, and IBFI3 are IDR receive complete interrupts for IDR1, IDR2, and IDR3 and TWR, respectively. IBFI3 is also used for SMIC mode and BT mode interrupt requests. The ERRI interrupt indicates the occurrence of a special state such as an LPC reset, LPC shutdown, or transfer cycle abort.
Section 19 LPC Interface (LPC) 19.5.2 SMI, HIRQ1, HIRQ3, HIRQ4, HIRQ5, HIRQ6, HIRQ7, HIRQ8, HIRQ9, HIRQ10, HIRQ11, HIRQ12, HIRQ13, HIRQ14, and HIRQ15 The LPC interface can request 15 kinds of host interrupt by means of SERIRQ. HIRQ1 and HIRQ12 are used on LPC channel 1, while SMI, HIRQ6, HIRQ9, HIRQ10, and HIRQ11 can be requested from LPC channels 2 and 3. For the SCIF, any one of 15 types of interrupts can be selected.
Section 19 LPC Interface (LPC) Table 19.
Section 19 LPC Interface (LPC) Table 19.13 HIRQ Setting and Clearing Conditions when SCIF Channels are Used Host Interrupt Setting Condition Clearing Condition SMI HIRQi (i = 1, 3 to 15) The SCIF interrupt corresponding to the host interrupt request selected by SIRQCR3 occurs.
Section 19 LPC Interface (LPC) 19.6 Usage Note 19.6.1 Data Conflict The LPC interface provides buffering of asynchronous data from the host and slave (this LSI), but an interface protocol that uses the flags in STR must be followed to avoid data conflict. For example, if the host and slave both try to access IDR or ODR at the same time, the data will be corrupted. To prevent simultaneous accesses, IBF and OBF must be used to allow access only to data for which writing has finished.
Section 19 LPC Interface (LPC) Table 19.
Section 19 LPC Interface (LPC) Rev. 2.00 Aug.
Section 20 Ethernet Controller (EtherC) Section 20 Ethernet Controller (EtherC) This LSI has an on-chip Ethernet controller (EtherC) conforming to the Ethernet or the IEEE802.3 MAC (Media Access Control) layer standard. Connecting a physical-layer LSI (PHY-LSI) complying with this standard enables the Ethernet controller (EtherC) to perform transmission and reception of Ethernet/IEEE802.3 frames. This LSI has one MAC layer interface.
Section 20 Ethernet Controller (EtherC) CPU EtherC Bus interface MAC Receive controller Transmit controller Command status interface MII Converter MII/RMII conversion PORT PHY Figure 20.1 Configuration of EtherC Rev. 2.00 Aug.
Section 20 Ethernet Controller (EtherC) 20.2 Input/Output Pins Table 20.1 lists the pin configuration of the EtherC. Table 20.1 Pin Configuration Type Abbreviation I/O RMII interface signals RM_REF-CLK Input Function Transmit/Receive Clock Timing reference signal for the RM_TX-EN, RM_TXD1 to RM_TXD0, RM_CRS-DV, RM_RXD1 to RM_RXD0, and RM_RX-ER signals RM_TX-EN Output Transmit Enable Indicates that transmit data is ready on pins RM_TXD1 and RM_TXD0.
Section 20 Ethernet Controller (EtherC) 20.3 Register Description The EtherC has the following registers. For details on addresses and access sizes of registers, see section 29, List of Registers.
Section 20 Ethernet Controller (EtherC) 20.3.1 EtherC Mode Register (ECMR) ECMR is a 32-bit readable/writable register and specifies the operating mode of the Ethernet controller. The settings in this register are normally made in the initialization process following a reset. The operating mode setting must not be changed while the transmitting and receiving functions are enabled.
Section 20 Ethernet Controller (EtherC) Bit Initial Bit Name Value R/W Description 16 TXF R/W Transmit Flow Control Operating mode 0 0: Transmit flow control function is disabled (automatic PAUSE frames are not transmitted) 1: Transmit flow control function is enabled (automatic PAUSE frame is transmitted as necessary) 15 to 13 All 0 R Reserved These bits are always read as 0. The initial value should not be changed.
Section 20 Ethernet Controller (EtherC) Bit Initial Bit Name Value R/W Description 5 TE R/W Transmission Enable 0 0: Transmit function is disabled 1: Transmit function is enabled If this bit is changed from enabling to disabling while a frame is being transmitted, the transmit function remains enabled until transmission of the frame is completed. 4 0 R Reserved This bit is always read as 0. The initial value should not be changed.
Section 20 Ethernet Controller (EtherC) 20.3.2 EtherC Status Register (ECSR) ECSR is a 32-bit readable/writable register and indicates the status in the EtherC. This status can be notified to the CPU by interrupts. When 1 is written to the PSRTO, LCHNG, MPD, and ICD, the corresponding flags can be cleared. Writing 0 does not affect the flag. For bits that generate interrupt, the interrupt can be enabled or disabled according to the corresponding bit in ECSIPR.
Section 20 Ethernet Controller (EtherC) Bit Bit Name Initial Value R/W Description 1 MPD 0 R/W Magic Packet Detection Indicates that a Magic Packet has been detected on the line. 0: Magic Packet has not been detected 1: Magic Packet has been detected 0 ICD 0 R/W Illegal Carrier Detection Indicates that the PHY has detected an illegal carrier on the line. If a change in the signal input from the PHY occurs before the software recognition period, the correct information may not be obtained.
Section 20 Ethernet Controller (EtherC) 20.3.3 EtherC Interrupt Permission Register (ECSIPR) ECSIPR is a 32-bit readable/writable register that enables or disables the interrupt sources indicated by ECSR. Each bit can disable or enable interrupts corresponding to the bits in ECSR. Bit Bit Name 31 to 5 Initial Value R/W Description All 0 R Reserved These bits are always read as 0. The initial value should not be changed.
Section 20 Ethernet Controller (EtherC) 20.3.4 PHY Interface Register (PIR) PIR is a 32-bit readable/writable register that provides a means of accessing the PHY registers via the RMII. Bit Bit Name 31 to 4 Initial Value R/W Description All 0 R Reserved These bits are always read as 0. The initial value should not be changed. 3 MDI Undefined R MII Management Data-In Indicates the level of the MDIO pin.
Section 20 Ethernet Controller (EtherC) 20.3.5 MAC Address High Register (MAHR) MAHR is a 32 -bit readable/writable register that specifies the upper 32 bits of the 48-bit MAC address. The settings in this register are normally made in the initialization process after a reset. The MAC address setting must not be changed while the transmitting and receiving functions are enabled.
Section 20 Ethernet Controller (EtherC) 20.3.7 Receive Frame Length Register (RFLR) RFLR is a 32-bit readable/writable register and it specifies the maximum frame length (in bytes) that can be received by this LSI. The settings in this register must not be changed while the receiving function is enabled. Bit Bit Name 31 to 12 Initial Value R/W All 0 R Description Reserved These bits are always read as 0. The initial value should not be changed.
Section 20 Ethernet Controller (EtherC) 20.3.8 PHY Status Register (PSR) PSR is a read-only register that can read interface signals from the PHY. Bit Bit Name 31 to 1 Initial Value R/W All 0 R Description Reserved These bits are always read as 0. The initial value should not be changed. 0 LMON 0 R LNKSTA Pin Status The Link status can be read by connecting the Link signal output from the PHY to the LNKSTA pin. For the polarity, refer to the PHY specifications to be connected. 20.3.
Section 20 Ethernet Controller (EtherC) 20.3.10 Delayed Collision Detect Counter Register (CDCR) CDCR is a 32-bit counter that indicates the number of delayed collisions on all lines from a start of transmission. When the value in this register reaches H'FFFFFFFF, count-up is halted. The counter value is cleared to 0 by a write to this register with any value.
Section 20 Ethernet Controller (EtherC) 20.3.13 CRC Error Frame Counter Register (CEFCR) CEFCR is a 32-bit counter that indicates the number of times a frame with a CRC error was received. When the value in this register reaches H'FFFFFFFF, the count is halted. The counter value is cleared to 0 by a write to this register with any value. Bit Bit Name 31 to 0 CEFC31 to CEFC0 Initial Value R/W Description All 0 R/W CRC Error Frame Count These bits indicate the count of CRC error frames received. 20.
Section 20 Ethernet Controller (EtherC) 20.3.16 Too-Long Frame Receive Counter Register (TLFRCR) TLFRCR is a 32-bit counter that indicates the number of frames received with a length exceeding the value specified by the receive frame length register (RFLR). When the value in this register reaches H'FFFFFFFF, the count is halted. TLFRCR is not incremented when a frame containing residual bits is received.
Section 20 Ethernet Controller (EtherC) 20.3.19 IPG Register (IPGR) IPGR sets the IPG (Inter Packet Gap). This register must not be changed while the transmitting and receiving functions of the EtherC mode register (ECMR) are enabled. (For details, refer to section 20.4.6, Operation by IPG Setting.) Bit Bit Name 31 to 5 Initial Value R/W All 0 R Description Reserved These bits are always read as 0. The write value should always be 0.
Section 20 Ethernet Controller (EtherC) 20.3.21 Manual PAUSE Frame Set Register (MPR) MPR sets the TIME parameter value of the manual PAUSE frame. When transmitting the manual PAUSE frame, the value set to this register is used as the TIME parameter of the PAUSE frame. Bit Bit Name 31 to 16 Initial Value R/W Description All 0 R Reserved These bits are always read as 0. The write value should always be 0.
Section 20 Ethernet Controller (EtherC) 20.4 Operation The overview of the Ethernet controller (EtherC) are shown below. The EtherC transmits and receives PAUSE frames conforming to the Ethernet/IEEE802.3 frames. 20.4.1 Transmission In response to a transmit request from the E-DMAC, the EtherC transmitter arranges the transmit data into a frame and outputs to the RMII. The transmit data that has gone through the RMII is output onto the lines by the PHY-LSI. Figure 20.
Section 20 Ethernet Controller (EtherC) FDPX TE set Start of transmission (preamble transmission) Idle Transmission halted HDPX Carrier detected TE reset Carrier not detected HDPX Initiate retransmission FDPX Carrier detection Collision Reset Carrier detection Carrier not detected Retransmission processing*1 Collision SFD transmission Failure of 15 retransfer attempts or collision after 512-bit time Error Collision*2 Error Error detection Error notification Data transmission Error [Le
Section 20 Ethernet Controller (EtherC) 1. When the transmit enable (TE) bit is set, the transmitter enters the transmit idle state. 2. When a transmit request is issued by the transmit E-DMAC, the EtherC sends the preamble to RMII after a transmission delay equivalent to the time required by carrier detection and a frame interval time. If full-duplex transfer is selected, which does not require carrier detection, the preamble is sent as soon as a transmit request is issued by the E-DMAC. 3.
Section 20 Ethernet Controller (EtherC) 20.4.2 Reception The EtherC receiver separates the frame data that inputs from the RMII into preamble, SFD, data, and CRC data, and outputs from D/A (destination address) to CRC data to the E-DMAC. Figure 20.3 shows the state transitions of the EtherC receiver.
Section 20 Ethernet Controller (EtherC) 4. Following data reception from the RMII, the receiver carries out a CRC check. The result is indicated as a status bit in the descriptor after the frame data has been written to memory. The error status is reported in the case of an abnormality. 5. After one frame has been received, if the receive enable bit is set (RE = 1) in the EtherC mode register, the receiver prepares to receive the next frame. 20.4.
Section 20 Ethernet Controller (EtherC) RM_REF-CLK RM_CRS-DV RM_RXD1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 RM_RXD0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 False Carrier detected Figure 20.6 RMII Frame Receive Timing (Reception with False Carrier) Rev. 2.00 Aug.
Section 20 Ethernet Controller (EtherC) 20.4.4 Accessing MII Registers MII registers in the PHY are accessed via this LSI's PHY interface register (PIR). Connection is made as a serial interface in accordance with the MII frame format specified in IEEE802.3u. (1) MII Management Frame Format The format of an MII management frame is shown in figure 20.7.
Section 20 Ethernet Controller (EtherC) (2) MII Register Access Procedure The program accesses MII registers via the PHY interface register (PIR). Access is implemented by a combination of 1-bit-unit data write, 1-bit-unit data read, bus release, and independent bus release. Figures 20.8 to 20.11 show examples of MII register access timing. The timing will differ depending on the type of PHY-LSI.
Section 20 Ethernet Controller (EtherC) (1) Write to PHY interface register MMD = 0 MDC = 1 (2) Write to PHY interface register read MMD = 0 MMC = 1 MDI is read data MDC MDI (1) (2) (3) (3) Write to PHY interface register MMD = 0 MDC = 0 Figure 20.10 1-Bit Data Read Flowchart (1) Write to PHY interfaceregister MMD = 0 MDC = 0 MDC MDO (1) Figure 20.11 Independent Bus Release Flowchart (IDLE in Write in Figure 20.7) Rev. 2.00 Aug.
Section 20 Ethernet Controller (EtherC) 20.4.5 Magic Packet Detection The EtherC supports the Magic Packet detection function. This function provides a Wake-OnLAN (WOL) facility that activates various peripheral devices connected to a LAN from the host device or other source. This makes it possible to construct a system in which a peripheral device receives a Magic Packet sent from the host device or other source, and activates itself.
Section 20 Ethernet Controller (EtherC) 20.4.6 Operation by IPG Setting The EtherC supports the function to change the Inter Packet Gap (IPG ), the non-transmission period between transmit frames. By changing the set values of the IPG setting register (IPGR), the transmission efficiency can be raised and lowered from the standard value. IPG settings are prescribed in IEEE802.3 standards. When changing settings, adequately check that the respective devices can operate smoothly on the same network.
Section 20 Ethernet Controller (EtherC) number of transmits reaches the value set by TPAUSER. The automatic PAUSE frame transmission is enabled when the TXF bit in the EtherC mode register (ECMR) is 1. (2) Manual PAUSE Frame Transmission PAUSE frames are transmitted by directives from the software. When writing the Timer value to the manual PAUSE frame set register (MPR), manual PAUSE frame transmission is started. With this method, PAUSE frame transmission is carried out only once.
Section 20 Ethernet Controller (EtherC) 20.5 Usage Notes 20.5.1 Conditions for Setting LCHNG Bit Even if the level of the signal input to the LNKSTA pin is not changed, the LCHNG bit in ECSR may be set. It may happen when the pin function is changed from port to LNKSTA by PCCRH2 of the PFC or when a software reset caused by the SWR bit in EDMR is cleared while the LNKSTA pin is being driven high.
Section 20 Ethernet Controller (EtherC) of the local station is not so high. Therefore, the transmission of PAUSE frames during this period is less likely to happen. The possibility that this defect actually affects the operation in this LSI is rather low. 20.5.4 Operation Seed The EtherC operates only in high-speed mode and does not operate in medium-speed mode. Rev. 2.00 Aug.
Section 20 Ethernet Controller (EtherC) Rev. 2.00 Aug.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) This LSI includes a direct memory access controller (E-DMAC) directly connected to the Ethernet controller (EtherC). A large proportion of buffer management is controlled by the E-DMAC itself using descriptors. This lightens the load on the CPU and enables efficient data transfer control to be achieved. 21.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) E-DMAC Transmit FIFO Descriptor information Internal bus interface Transmit DMAC EtherC Receive FIFO Descriptor information Internal bus Receive DMAC RAM Transmit descriptor Receive descriptor Transmit buffer Receive buffer Figure 21.1 Configuration of E-DMAC, and Descriptors and Buffers 21.2 Register Descriptions The E-DMAC has the following registers.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) • Receive buffer write address register (RBWAR) • Receive descriptor fetch address register (RDFAR) • Transmit buffer read address register (TBRAR) • Transmit descriptor fetch address register (TDFAR) • Flow control FIFO threshold register (FCFTR) • Bit rate setting register (ECBRR) • Transmit interrupt register (TRIMD) Rev. 2.00 Aug.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.2.1 E-DMAC Mode Register (EDMR) EDMR is a 32-bit readable/writable register that specifies the operating mode of the E-DMAC. The settings in this register are normally made in the initialization process following a reset. If the EtherC and E-DMAC are initialized by means of this register during data transmission, abnormal data may be sent onto the line.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name Initial value R/W Description 0 SWR 0 R/W Software Reset Writing 1 in this bit initializes registers of the E-DMAC other than TDLAR, RDLAR, RMFCR, and ECBRR, and registers of the EtherC. While a software reset is issued (for 64 states), accesses to the all Ethernet-related registers are prohibited. Software reset period (example): When φ = 34 MHz: 1.88 µs This bit is always read as 0.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.2.3 E-DMAC Receive Request Register (EDRRR) EDRRR is a 32-bit readable/writable register that issues receive directives to the E-DMAC. When the receive request bit is set, the E-DMAC reads the relevant receive descriptor. If the receive descriptor active bit in the descriptor has the "active" setting, the E-DMAC prepares for a receive request from the EtherC.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.2.4 Transmit Descriptor List Address Register (TDLAR) TDLAR is a 32-bit readable/writable register that specifies the start address of the transmit descriptor list. Descriptors have a boundary configuration in accordance with the descriptor length indicated by the DL bit in EDMR. This register must not be written to during transmission.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.2.6 EtherC/E-DMAC Status Register (EESR) EESR is a 32-bit readable/writable register that shows communications status information on the E-DMAC in combination with the EtherC. The information in this register is reported in the form of interrupts. Individual bits are cleared by writing 1 (however, bit 22 (ECI) is a read-only bit and not to be cleared by writing 1) and are not affected by writing 0.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name Initial value R/W Description 25 RABT 0 R/W Receive Abort Detection Indicates that the EtherC aborts receiving a frame because of failures during receiving the frame. 0: Frame reception has not been aborted or no receive directive 1: Frame receive has been aborted 24 RFCOF 0 R/W Receive Frame Counter Overflow Indicates that the receive FIFO frame counter has overflowed.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name Initial value R/W Description 21 TC 0 R/W Frame Transmit Complete Indicates that all the data specified by the transmit descriptor has been transmitted to the EtherC. The transfer status is written back to the relevant descriptor.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name Initial value R/W Description 18 FR 0 R/W Frame Reception Indicates that a frame has been received and the receive descriptor has been updated. This bit is set to 1 each time a frame is received.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name Initial value R/W Description 8 TRO 0 R/W Transmit Retry Over Indicates that a retry-over condition has occurred during frame transmission. Total 16 transmission retries including 15 retries based on the back-off algorithm are failed after the EtherC transmission starts.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.2.7 EtherC/E-DMAC Status Interrupt Permission Register (EESIPR) EESIPR is a 32-bit readable/writable register that enables interrupts corresponding to individual bits in the EtherC/E-DMAC status register (EESR). An interrupt is enabled by writing 1 to the corresponding bit. In the initial state, interrupts are not enabled. Bit Bit Name Initial value R/W Description 31 0 R Reserved This bit is always read as 0.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name Initial value R/W Description 20 TDEIP 0 R/W Transmit Descriptor Empty Interrupt Permission 0: Transmit descriptor empty interrupt is disabled 1: Transmit descriptor empty interrupt is enabled 19 TFUFIP 0 R/W Transmit FIFO Underflow Interrupt Permission 0: Underflow interrupt is disabled 1: Underflow interrupt is enabled 18 FRIP 0 R/W Frame Received Interrupt Permission 0: Frame received interrupt is dis
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name Initial value R/W Description 7 RMAFIP 0 R/W Receive Multicast Address Frame Interrupt Permission 0: Receive multicast address frame interrupt is disabled 1: Receive multicast address frame interrupt is enabled 6, 5 All 0 R Reserved This bit is always read as 0. The initial value should not be changed.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.2.8 Transmit/Receive Status Copy Enable Register (TRSCER) TRSCER specifies whether or not receive status information reported by bits 7 and 4 in the EtherC/E-DMAC status register is to be indicated in bit RFE in the corresponding descriptor. Bits in this register correspond to bits 7 and 4 in the EtherC/E-DMAC status register (EESR).
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name Initial value R/W Description 31 to 16 All 0 R Reserved These bits are always read as 0. The initial value should not be changed. 15 to 0 MFC15 to MFC0 All 0 R Missed-Frame Counter Indicate the number of frames that are discarded and not transferred to the receive buffer during reception. 21.2.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name 10 to 0 TFT10 to TFT0 Initial value R/W Description All 0 R/W Transmit FIFO Threshold When setting a transmit FIFO, the FIFO must be set to a smaller value than the specified value of the FIFO capacity by FDR. The values between H'201 to H'7FF should not be set.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.2.11 FIFO Depth Register (FDR) FDR is a 32-bit readable/writable register that specifies the capacity of the transmit and receive FIFOs. Bit Bit Name Initial value R/W Description 31 to 11 All 0 R Reserved These bits are always read as 0. The initial value should not be changed.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.2.12 Receiving method Control Register (RMCR) RMCR is a 32-bit readable/writable register that specifies the control method for the RR bit in EDRRR when a frame is received. This register must be set during the receiving-halt state. Bit Bit Name Initial value R/W Description 31 to 1 All 0 R Reserved These bits are always read as 0. The initial value should not be changed.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.2.14 Receiving-Descriptor Fetch Address Register (RDFAR) RDFAR stores the descriptor start address that is required when the E-DMAC fetches descriptor information from the receiving descriptor. Which receiving descriptor information is used for processing by the E-DMAC can be recognized by monitoring addresses displayed in this register.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.2.17 Flow Control FIFO Threshold Register (FCFTR) FCFTR is a 32-bit readable/writable register that sets the flow control of the EtherC (setting the threshold on automatic PAUSE transmission). The threshold can be specified by the depth of the receive FIFO data (RFD2 to RFD0) and the number of receive frames (RFF2 to RFF0). The condition to start the flow control is decided by taking OR operation on the two thresholds.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name Initial value R/W Description 15 to 3 All 0 Reserved These bits are always read as 0. The initial value should not be changed.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.2.19 Transmit Interrupt Register (TRIMD) TRIMD is a 32-bit readable/writable register that specifies whether or not to notify write-back completion for each frame using the TWB bit in EESR and an interrupt on transmit operations. Bit Bit Name Initial Value R/W Description 31 to 1 All 0 R Reserved These bits are always read as 0. The write value should always be 0.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.3 Operation The E-DMAC is connected to the EtherC, and performs efficient transfer of transmit/receive data between the EtherC and memory (buffers) without the intervention of the CPU. The E-DMAC itself reads control information, including buffer pointers called descriptors, relating to the buffers.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Transmit descriptor TD0 31 30 29 28 27 26 T T T T T A D F F F C L P P E T E 1 0 TFS26 to TFS0 16 15 31 TD1 Transmit buffer 0 TDL 0 Fixed at H'0000 31 TD2 Valid transmit data 0 TBA Padding (4 bytes) Figure 21.2 Relationship between Transmit Descriptor and Transmit Buffer Rev. 2.00 Aug.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) (a) Transmit Descriptor 0 (TD0) TD0 indicates the transmit frame status. The CPU and E-DMAC use RD0 to report the frame transmission status. Bit Bit Name Initial value R/W Description 31 TACT 0 R/W Transmit Descriptor Active Indicates that this descriptor is active. The CPU sets this bit after transmit data has been transferred to the transmit buffer.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name Initial value R/W Description 29 TFP1 0 R/W Transmit Frame Position 1, 0 28 TFP0 0 R/W These two bits specify the relationship between the transmit buffer and transmit frame. In the preceding and following descriptors, a logically positive relationship must be maintained between the settings of this bit and the TDLE bit.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) (b) Transmit Descriptor 1 (TD1) TD1 specifies the transmit buffer length (maximum 64 kbytes). Bit Bit Name Initial value R/W Description 31 to 16 TDL All 0 R/W Transmit Buffer Data Length These bits specify the valid transfer byte length in the corresponding transmit buffer. If set to 0, the operation is not guaranteed.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) (2) Receive Descriptor Figure 21.3 shows the relationship between a receive descriptor and the receive buffer. In frame reception, the E-DMAC performs data rewriting up to a receive buffer 16-byte boundary, regardless of the receive frame length. Finally, the actual receive frame length is reported in the lower 16 bits of RD1 in the descriptor.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) (a) Receive Descriptor 0 (RD0) RD0 indicates the receive frame status. The CPU and E-DMAC use RD0 to report the frame receive status. Bit Bit Name Initial value R/W Description 31 RACT 0 R/W Receive Descriptor Active Indicates that this descriptor is active. The E-DMAC resets this bit after receive data has been transferred to the receive buffer.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name Initial value R/W Description 29 RFP1 0 R/W Receive Frame Position 28 RFP0 0 R/W These two bits specify the relationship between the receive buffer and receive frame.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Bit Bit Name 26 to 0 RFS26 to RFS0 Initial value R/W Description All 0 R/W Receive Frame Status These bits indicate the error status during frame reception. RFS26 to RFS10: Reserved (The initial value should not be changed.) RFS9: Receive FIFO overflow (corresponds to RFOF bit in EESR) RFS8: Abort Detection (indicates any of bits RFS3 to RFS0 has been set.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) (b) Receive Descriptor 1 (RD1) RD1 specifies the receive buffer length (maximum 64 kbytes). Bit Bit Name Initial value R/W Description 31 to 16 RBL All 0 R/W Receive Buffer Length These bits specify the maximum reception byte length in the corresponding receive buffer. The transfer byte length must align with a 16-byte boundary (bits 19 to 16 cleared to 0).
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.3.2 Transmission When the transmit function is enabled and the transmit request bit (TR) is set in the E-DMAC transmit request register (EDTRR), the E-DMAC reads the descriptor used last time from the transmit descriptor list (in the initial state, the descriptor indicated by the transmission descriptor start address register (TDLAR)).
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Transmission flowchart This LSI + memory E-DMAC Transmit FIFO EtherC Ethernet EtherC/E-DMAC initialization Descriptor and transmit buffer setting Transmit directive Descriptor read Transmit data transfer Descriptor write-back Descriptor read Transmit data transfer Frame transmission Descriptor write-back Transmission completed Figure 21.4 Sample Transmission Flowchart Rev. 2.00 Aug.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.3.3 Reception When the receive function is enabled and the CPU sets the receive request bit (RR) in the EDMAC receive request register (EDRRR), the E-DMAC reads the descriptor following the previously used one from the receive descriptor list (in the initial state, the descriptor indicated by the transmission descriptor start address register (TDLAR)), and then enters the receive-standby state.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Reception flowchart This LSI + memory E-DMAC Receive FIFO EtherC Ethernet EtherC/E-DMAC initialization Descriptor and receive buffer setting Start of reception Descriptor read Frame reception Receive data transfer Descriptor write-back Descriptor read Receive data transfer Descriptor write-back Descriptor read (receive ready for the next frame) Reception completed Figure 21.5 Sample Reception Flowchart Rev. 2.00 Aug.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 21.3.4 Multi-Buffer Frame Transmit/Receive Processing Multi-Buffer Frame Transmit Processing If an error occurs during multi-buffer frame transmission, the processing shown in figure 21.6 is carried out by the E-DMAC.
Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) Multi-Buffer Frame Receive Processing If an error occurs during multi-buffer frame reception, the processing shown in figure 21.7 is carried out by the E-DMAC. Where the receive descriptor is shown as inactive (RACT bit = 0) in the figure, buffer data has already been received normally, and where the receive descriptor is shown as active (RACT bit = 1), this indicates a buffer for which reception has not yet been performed.
Section 22 USB Function Module (USB) Section 22 USB Function Module (USB) The H8S/2472 Group incorporates a USB function module (USB). 22.1 Features • The UDC (USB device controller) conforming to USB2.0 and transceiver process USB protocol automatically.
Section 22 USB Function Module (USB) Figure 22.1 shows the block diagram of the USB. Peripheral bus USB function module Status and control registers Interrupt requests D+ UDC FIFO Clock for USB (48 MHz) [Legend] UDC: USB device controller Figure 22.1 Block Diagram of USB 22.2 Input/Output Pins Table 22.1 shows the USB pin configuration. Table 22.
Section 22 USB Function Module (USB) 22.3 Register Descriptions The USB has following registers.
Section 22 USB Function Module (USB) 22.3.1 Interrupt Flag Register 0 (IFR0) IFR0, together with interrupt flag registers 1and 2 (IFR1and IFR2), indicates interrupt status information required by the application. When an interrupt source is generated, the corresponding bit is set to 1. And then this bit, in combination with interrupt enable register 0 (IER0), generates an interrupt request to the CPU. To clear, write 0 to the bit to be cleared and 1 to the other bits.
Section 22 USB Function Module (USB) Bit Bit Name Initial Value R/W Description 4 EP2EMPTY 1 R/(W) EP2 FIFO Empty [Reading] This bit is set when at least one of the dual endpoint 2 transmit FIFO buffers is ready for transmit data to be written. This bit cannot be cleared. [Writing] When the data in endpoint 2 is transferred by the DTC, writing 0 to this bit clears the request for a DTC transfer end interrupt. If the DTC transfer is not used, always write 1 to this bit.
Section 22 USB Function Module (USB) 22.3.2 Interrupt Flag Register 1 (IFR1) IFR1, together with interrupt flag registers 0 and 2 (IFR0 and IFR2), indicates interrupt status information required by the application. When an interrupt source is generated, the corresponding bit is set to 1. And then this bit, in combination with interrupt enable register 1 (IER1), generates an interrupt request to the CPU. To clear, write 0 to the bit to be cleared and 1 to the other bits.
Section 22 USB Function Module (USB) 22.3.3 Interrupt Flag Register 2 (IFR2) IFR2, together with interrupt flag registers 0 and 1 (IFR0 and IFR1), indicates interrupt status information required by the application. When an interrupt source is generated, the corresponding bit is set to 1. And then this bit, in combination with interrupt enable register 2 (IER2), generates an interrupt request to the CPU. To clear, write 0 to the bit to be cleared and 1 to the other bits.
Section 22 USB Function Module (USB) 22.3.4 Interrupt Select Register 0 (ISR0) ISR0 selects the vector numbers of the interrupt requests indicated in interrupt flag register 0 (IFR0). If the USB issues an interrupt request to the INTC when a bit in ISR0 is cleared to 0, the interrupt corresponding to the bit will be USBINTN2. If the USB issues an interrupt request to the INTC when a bit in ISR0 is set to 1, the corresponding interrupt will be USBINTN3.
Section 22 USB Function Module (USB) 22.3.5 Interrupt Select Register 1 (ISR1) ISR1 selects the vector numbers of the interrupt requests indicated in interrupt flag register 1 (IFR1). If the USB issues an interrupt request to the INTC when a bit in ISR0 is cleared to 0, the interrupt corresponding to the bit will be USBINTN2. If the USB issues an interrupt request to the INTC when a bit in ISR0 is set to 1, the corresponding interrupt will be USBINTN3.
Section 22 USB Function Module (USB) 22.3.7 Interrupt Enable Register 0 (IER0) IER0 enables the interrupt requests of interrupt flag register 0 (IFR0). When an interrupt flag is set to 1 while the corresponding bit of each interrupt is set to 1, an interrupt request is sent to the CPU. The interrupt vector number is determined by the contents of interrupt select register 0 (ISR0).
Section 22 USB Function Module (USB) 22.3.9 Interrupt Enable Register 2 (IER2) IER2 enables the interrupt requests of interrupt flag register 2 (IFR2). When an interrupt flag is set to 1 while the corresponding bit of each interrupt is set to 1, an interrupt request is sent to the CPU. The interrupt vector number is determined by the contents of interrupt select register 2 (ISR2).
Section 22 USB Function Module (USB) 22.3.11 EP0o Data Register (EPDR0o) EPDR0o is an 8-byte receive FIFO buffer for endpoint 0. EPDR0o holds endpoint 0 receive data other than setup commands. When data is received successfully, EP0oTS in interrupt flag register 0 is set, and the number of receive bytes is indicated in the EP0o receive data size register. After the data has been read, setting EP0oRDFN in the trigger register enables the next packet to be received.
Section 22 USB Function Module (USB) 22.3.13 EP1 Data Register (EPDR1) EPDR1 is a 128-byte receive FIFO buffer for endpoint 1. EPDR1 has a dual-buffer configuration, and has a capacity of twice the maximum packet size. When one packet of data is received successfully, EP1FULL in interrupt flag register 0 is set, and the number of receive bytes is indicated in the EP1 receive data size register.
Section 22 USB Function Module (USB) 22.3.16 EP0o Receive Data Size Register (EPSZ0o) EPSZ0o indicates the number of bytes received at endpoint 0 from the host. Bit Bit Name Initial Value R/W Description 7 to 0 All 0 R Number of receive data for endpoint 0 22.3.17 EP1 Receive Data Size Register (EPSZ1) EPSZ1 is a receive data size resister for endpoint 1. EPSZ1 indicates the number of bytes received from the host. The FIFO for endpoint 1 has a dual-buffer configuration.
Section 22 USB Function Module (USB) Bit Bit Name Initial Value R/W Description 4 EP2 PKTE Undefined W EP2 Packet Enable After one packet of data has been written to the endpoint 2 transmit FIFO buffer, the transmit data is fixed by writing 1 to this bit. 3 Undefined Reserved The initial value should not be changed. 2 EP0s RDFN Undefined W EP0s Read Complete Write 1 to this bit after data for the EP0s command FIFO has been read.
Section 22 USB Function Module (USB) 22.3.19 Data Status Register (DASTS) DASTS indicates whether the transmit FIFO buffers contain valid data. A bit in this register is set when data is written to the corresponding FIFO buffer and the packet enable bit is set. A bit in this register is cleared when all data has been transmitted to the host, or when the FIFO clear bit for the corresponding endpoint in the FIFO clear register (FCLR) is set.
Section 22 USB Function Module (USB) 22.3.20 FIFO Clear Register (FCLR) FCLR is a register to initialize the FIFO buffers for each endpoint. Writing 1 to a bit clears all the data in the corresponding FIFO buffer. Note that the corresponding interrupt flag is not cleared. Do not clear a FIFO buffer during transfer. Bit Bit Name Initial Value R/W Description 7 Undefined Reserved The initial value should not be changed.
Section 22 USB Function Module (USB) 22.3.21 DTC Transfer Setting Register (DMA) DMA supports the DTC transfer that can be carried out between the endpoint 1 and 2 data registers and memory by the data transfer controller (DTC). Dual address transfer is performed in byte units. To initiate transfer by the DTC, necessary settings must be made to the DTC in addition to the setting of this register. Bit Bit Name Initial Value R/W Description 7 to 3 All 0 R Reserved These bits are always read as 0.
Section 22 USB Function Module (USB) Bit Bit Name Initial Value R/W Description 1 EP2DMAE 0 R/W Endpoint 2 DTC Transfer Enable When this bit is set, DTC transfer is enabled from memory to the endpoint 2 transmit FIFO buffer. If there is at least one byte of space in the FIFO buffer, the DTC start interrupt signal (USBINTN1) is asserted.
Section 22 USB Function Module (USB) Bit Bit Name Initial Value R/W Description 0 EP1DMAE 0 R/W Endpoint 1 DTC Transfer Enable When this bit is set, the DTC start interrupt signal (USBINTN0) is asserted and DTC transfer is enabled from the endpoint 1 receive FIFO buffer to memory. If there is at least one byte of receive data in the FIFO buffer, the DTC start interrupt signal (USBINTN0) is asserted.
Section 22 USB Function Module (USB) 22.3.22 Endpoint Stall Register (EPSTL) The bits in EPSTL are used to forcibly stall the endpoints on the application side. While a bit is set to 1, the corresponding endpoint returns a stall handshake to the host. The stall bit for endpoint 0 is cleared automatically on reception of 8-byte command data for which decoding is performed by the function and the EP0 STL bit is cleared.
Section 22 USB Function Module (USB) 22.3.23 Configuration Value Register (CVR) This register stores the Configuration, Interface, or Alternate set value when the Set Configuration or Set Interface command from the host is correctly received. Bit Bit Name Initial Value R/W Description 7 CNFV1 All 0 R 6 CNFV0 These bits store Configuration Setting value when they receive Set Configuration command. CNFV is updated when the SETC bit in IFR2 is set to 1.
Section 22 USB Function Module (USB) Bit Bit Name Initial Value R/W Description 3 RSME 0 R/W Resume Enable This bit releases the suspend state (or executes remote wakeup). When RSME is set to 1, resume request starts. If RSME is once set to 1, clear this bit to 0 again afterwards. In this case, the value 1 set to RSME must be kept for at least one clock period of 12-MHz clock. 2 0 R Reserved This bit is always read as 0. The initial value should not be changed.
Section 22 USB Function Module (USB) 22.3.25 Endpoint Information Register (EPIR) This register sets the information for each endpoint. Each endpoint needs five bytes to store the information. Writing data should be done in sequence starting at logical endpoint 0. Do not write data of more than 50 bytes (five bytes multiplied by ten endpoints) to this register. The information should be written to this register only once at a power-on reset and no data should be written after that.
Section 22 USB Function Module (USB) • EPIR01 Bit Bit Name Initial Value R/W Description 7, 6 D7, D6 Undefined W Endpoint Alternate Number [Possible setting range] 0 or 1 5, 4 D5, D4 Undefined W Endpoint Transmission [Possible setting range] 0: Control 1: Setting prohibited 2: Bulk 3: Interrupt 3 D3 Undefined W Endpoint Transmission Direction [Possible setting range] 0: Out 1: In 2 to 0 D2 to D0 Undefined W Reserved [Possible setting range] Fixed to 0.
Section 22 USB Function Module (USB) • EPIR04 Bit Bit Name Initial Value R/W Description 7 to 0 D7 to D0 Undefined W Endpoint FIFO Number [Possible setting range] 0 to 3 The endpoint number is the endpoint number the USB host uses. The endpoint FIFO number corresponds to the endpoint number described in this manual. Thus data transfer between the USB host and the endpoint FIFO can be enabled by putting the endpoint number and the endpoint FIFO number in one-to-one correspondence.
Section 22 USB Function Module (USB) Table 22.3 shows a specific example of setting. Table 22.3 Example of Setting Endpoint Number Conf. Int. Alt.
Section 22 USB Function Module (USB) 22.3.26 Transceiver Test Register 0 (TRNTREG0) TRNTREG0 controls the built-in transceiver output signals. Setting the PTSTE bit to 1 specifies the transceiver output signals (USD+ and USD-) arbitrarily. Table 22.4 shows the relationship between TRNTREG0 setting and pin output. Bit Bit Name Initial Value R/W Description 7 PTSTE 0 R/W Pin Test Enable Enables the test control for the built-in transceiver output pins (USD+ and USD-).
Section 22 USB Function Module (USB) Table 22.4 Relationship between TRNTREG0 Setting and Pin Output Pin Input Register Setting Pin Output VBUS PTSTE txenl txse0 txdata USD+ USD- 0 X X X X Hi-Z Hi-Z 1 0 X X X 1 1 0 0 0 0 1 1 1 0 0 1 1 0 1 1 0 1 x 0 0 1 1 1 X X Hi-Z Hi-Z [Legend] X: Don't care. : Cannot be controlled. Indicates state in normal operation according to the USB operation and port settings. 22.3.
Section 22 USB Function Module (USB) Table 22.
Section 22 USB Function Module (USB) 22.4 Interrupt Sources This module has five interrupt signals. Table 22.6 shows the interrupt sources and their corresponding interrupt request signals. The USBINTN interrupt signals are active low and can only be detected by level sensing. Table 22.
Section 22 USB Function Module (USB) Register Bit Transfer Mode Interrupt Source IFR2 0 Status SETI Set_Interface USBINTN2 or command detection USBINTN3 × SETC Set_Configuration USBINTN2 or command detection USBINTN3 × 1 Description Interrupt Request Signal DTC Activation 2 — SOF SOF interrupt detection USBINTN2 or USBINTN3 × 3 Status CFDN Endpoint information USBINTN2 or load end USBINTN3 × 4 SURSF Suspend/resume detection USBINTN2, USBINTN3, or RESUME × 5 SURSS Suspend/
Section 22 USB Function Module (USB) 22.5 Operation 22.5.1 Operation at Cable Connection USB function Application Cable disconnected VBUS pin = 0 V UDC core reset USB module interrupt setting As soon as preparations are completed, enable D+ pull-up in general output port USB cable connection No Initial settings General output port D+ pull-up enabled? Yes Interrupt request IFR1.
Section 22 USB Function Module (USB) 22.5.2 Operation at Cable Disconnection USB function Application Cable connected VBUS pin = 1 USB cable disconnection VBUS pin = 0 UDC core reset End Figure 22.3 Operation at Cable Disconnection The above flowchart shows the operation in section 22.9, Example of USB External Circuitry. Rev. 2.00 Aug.
Section 22 USB Function Module (USB) 22.5.3 (1) Suspend and Resume Operations Suspend Operation When the USB bus enters the suspend state from the non-suspend state, processing should proceed as shown below.
Section 22 USB Function Module (USB) (2) Resume Operation from Up-Stream When the USB bus enters the non-suspend state from the suspend state by resume signal output from up-stream, processing should proceed as shown below. USB function Application USB cable connected USB bus in suspend state Resume interrupts is requested from the up-stream. Suspend/resume interrupt occurs.
Section 22 USB Function Module (USB) (3) Transition from Suspend State to Software Standby Mode and Canceling Software Standby Mode When the USB bus enters from the suspend state to software standby mode, processing should proceed as shown below. When canceling software standby mode, ensure enough time for the system clock oscillation to be settled.
Section 22 USB Function Module (USB) (1) USB bus state (8) Normal Suspend Resume normal (3) USBINTN interrupt SURSF (2) (4) (11) SURSS (11) (4) SSRSME = 1 (5) (12) RESUME interrupt Software standby (9) (6) (10) Oscillator (7) USB dedicated clock (cku) Peripheral module clock (φ) (7) Software standby Oscillation settling time Figure 22.7 Timing of Transition to and Canceling Software Standby Mode Rev. 2.00 Aug.
Section 22 USB Function Module (USB) (4) Remote-Wakeup Operation When the USB bus enters the non-suspend (resume) state from the suspend state by the remotewakeup signal output from this function, processing should proceed as shown below.
Section 22 USB Function Module (USB) 22.5.4 Control Transfer Control transfer consists of three stages: setup, data (not always included), and status (figure 22.9). The data stage comprises a number of bus transactions. Operation flowcharts for each stage are shown below. Setup stage Control-in Control-out No data Data stage SETUP(0) IN(1) IN(0) DATA0 DATA1 DATA0 SETUP(0) OUT(1) OUT(0) DATA0 DATA1 DATA0 Status stage ... ...
Section 22 USB Function Module (USB) (1) Setup Stage Application USB function SETUP token reception Receive 8-byte command data in EP0s Command to be processed by application? No Automatic processing by this module Yes Set setup command reception complete flag (IFR0.SETUP TS = 1) To data stage Interrupt request Clear SETUP TS flag (IFR0.SETUP TS = 0) Clear EP0i FIFO (FCLR.EP0iCLR = 1) Clear EP0o FIFO (FCLR.
Section 22 USB Function Module (USB) (2) Data Stage (Control-In) USB function Application IN token reception From setup stage 1 written to TRG.EP0s RDFN? No NAK Yes Valid data in EP0i FIFO? Write data to EP0i data register (EPDR0i) No Write 1 to EP0i packet enable bit (TRG.EP0i PKTE = 1) NAK Yes Data transmission to host ACK Set EP0i transmission complete flag (IFR0.EP0i TS = 1) Interrupt request Clear EP0i transmission complete flag (IFR0.
Section 22 USB Function Module (USB) (3) Data Stage (Control-Out) USB function Application OUT token reception 1 written to TRG.EP0s RDFN? No NAK Yes Data reception from host ACK Set EP0o reception complete flag (IFR0.EP0o TS = 1) Interrupt request Read data from EP0o receive data size register (EPSZ0o) OUT token reception 1 written to TRG.EP0o RDFN? Clear EP0o reception complete flag (IFR0.
Section 22 USB Function Module (USB) (4) Status Stage (Control-In) USB function Application OUT token reception 0-byte reception from host ACK Set EP0o reception complete flag (IFR0.EP0o TS = 1) End of control transfer Interrupt request Clear EP0o reception complete flag (IFR0.EP0o TS = 0) Write 1 to EP0o read complete bit (TRG.EP0o RDFN = 1) End of control transfer Figure 22.13 Status Stage (Control-In) Operation The control-in status stage starts with an OUT token from the host.
Section 22 USB Function Module (USB) (5) Status Stage (Control-Out) USB function Application IN token reception Valid data in EP0i FIFO? No Interrupt request NAK Clear EP0i transfer request flag (IFR0.EP0i TR = 0) Yes Write 1 to EP0i packet enable bit (TRG.EP0i PKTE = 1) 0-byte transmission to host ACK Set EP0i transmission complete flag (IFR0.EP0i TS = 1) End of control transfer Interrupt request Clear EP0i transmission complete flag (IFR0.EP0i TS = 0) End of control transfer Figure 22.
Section 22 USB Function Module (USB) 22.5.5 EP1 Bulk-Out Transfer (Dual FIFOs) USB function Application OUT token reception FIFO FULL processing Either of EP1 FIFOs empty? Read EP1 receive data size register (EPSZ1) No NAK Yes Interrupt request Read EP1 data register (EPDR1) Data reception from host Set EP1 read complete bit (TRG.EP1 RDFN = 1) ACK Set EP1 FIFO full status (IFR0.EP1 FULL = 1) Clear EP1 FIFO full status (IFR0.EP1 FULL = 0) Resume Figure 22.
Section 22 USB Function Module (USB) 22.5.6 EP2 Bulk-In Transfer (Dual FIFOs) USB function Application IN token reception Transfer processing Valid data in either of EP2 FIFOs? No Interrupt request NAK Clear EP2 transfer request flag (IFR0.EP2 TR = 0) Yes Enable EP2 FIFO empty interrupt (IER0.EP2 EMPTY = 1) Data transmission to host ACK Resume No Transfer data set processing Either of EP2 FIFOs empty? Yes Interrupt request Set EP2 empty status (IFR0.
Section 22 USB Function Module (USB) When performing bulk-in transfer, as there is no valid data in the FIFOs on reception of the first IN token, an EP2TR bit interrupt in IFR0 is requested. With this interrupt, 1 is written to the EP2EMPTY bit in IER0, and the EP2 FIFO empty interrupt is enabled. At first, both EP2 FIFOs are empty, and so an EP2 FIFO empty interrupt is generated immediately. The data to be transmitted is written to the data register using this interrupt.
Section 22 USB Function Module (USB) 22.5.7 EP3 Interrupt-In Transfer USB function Application Is there data for transmission to host? No Yes IN token reception Write data to EP3 data register (EPDR3) Valid data in EP3FIFO? No NAK Yes Write 1 to EP3 packet enable bit (TRG.EP3 PKTE = 1) Data transmission to host ACK Set EP3 transmission complete flag (IFR1.EP3 TS = 1) Interrupt request Clear EP3 transmission complete flag (IFR1.
Section 22 USB Function Module (USB) 22.6 Processing of USB Standard Commands and Class/Vendor Commands 22.6.1 Processing of Commands Transmitted by Control Transfer A command transmitted from the host by control transfer may require decoding and execution of command processing on the application side. Whether command decoding is required on the application side is indicated in table 22.7 below. Table 22.
Section 22 USB Function Module (USB) 22.7 Stall Operations 22.7.1 Overview This section describes stall operations in this module. There are two cases in which the USB function module stall function is used: • When the application forcibly stalls an endpoint for some reason • When a stall is performed automatically within the USB function module due to a USB specification violation The USB function module has internal status bits that hold the status (stall or non-stall) of each endpoint.
Section 22 USB Function Module (USB) (1) Transition from normal operation to stall (1-1) USB EPSTL 0→1 Internal status bit 0 1. 1 written to EPSTL by application (1-2) Reference Transaction request EPSTL 1 Internal status bit 0 (1-3) Stall STALL handshake EPSTL 1 Internal status bit 0→1 1. IN/OUT token received from host 2. EPSTL referenced 1. 1 set in EPSTL 2. Internal status bit set to 1 3.
Section 22 USB Function Module (USB) 22.7.3 Automatic Stall by USB Function Module When a stall setting is made with the Set Feature command, or in the event of a USB specification violation, the USB function module automatically sets the internal status bit for the relevant endpoint without regard to the EPSTL register, and returns a stall handshake (1-1 in figure 22.19).
Section 22 USB Function Module (USB) 22.8 DTC Transfer 22.8.1 Overview DTC transfer can be performed for endpoints 1 and 2 in this module. Note that longword data cannot be transferred. When endpoint 1 holds at least one byte of valid receive data, a DTC request for endpoint 1 is generated. When endpoint 2 holds no valid data, a DTC request for endpoint 2 is generated.
Section 22 USB Function Module (USB) 22.8.2 DTC Transfer for Endpoint 1 When the data received at EP1 is transferred by the DTC, the USB function module automatically performs the same processing as writing 1 to the RDFN bit in TRG if the currently selected FIFO becomes empty. Accordingly, in DTC transfer, do not write 1 to the RDFN bit in TRG. If the user writes 1 to the RDFN bit in DTC transfer, correct operation cannot be guaranteed.
Section 22 USB Function Module (USB) 22.8.3 DTC Transfer for Endpoint 2 When the transmit data at EP2 is transferred by the DTC, the USB function module automatically performs the same processing as writing 1 to the PKTE bit in TRG if the currently selected FIFO (64 bytes) becomes full. Accordingly, to transfer data of a multiple of 64 bytes, the user need not write 1 to the PKTE bit. To transfer data of less than 64 bytes, the user must write 1 to the PKTE bit on a DTC transfer end interrupt.
Section 22 USB Function Module (USB) 22.8.4 DTC Transfer End Interrupt When the DTC transfer end interrupt is generated, handle the processing below. (1) Endpoint 1 • Clear the EP1DMAE bit in DMA to 0. • Write H'BF to the IFR0 register. Write 0 to the EP1FULL bit. The bit manipulation instruction should not be used for this setting. When the DTC transfer is continuously performed: • Set CRA and CRB of the DTC the number of transfers. • Set the DTCERF register. • Set 1 to the EP1DMAE bit in DMA.
Section 22 USB Function Module (USB) 22.9 Example of USB External Circuitry 1. USB Transceiver This module supports the built-in transceiver only, not the external transceiver. 2. D+ Pull-Up Control The PUPDPLS pin is used for D+ pull-up control. PUPDPLS is driven high by the PULLUP_E bit of the DMA register when the USB cable VBUS is connected. Thus, USB host/hub connection notification (D+ pill-up) is enabled. 3. Detection of USB Cable Connection/Disconnection As USB states, etc.
Section 22 USB Function Module (USB) USB PULLUP_E On-chip transceiver Vcc (3.3 V) PM4 VBUS*2 DrVCC (3.3 V) USD+ USD- DrVSS Vss 3.3 V Vcc *1 Vcc *1 1.5 kΩ External pull-up control circuit supporting full-speed VBUS (5 V) D+ D- GND USB connector Notes: 1. To protect this LSI from being damaged, use the IC (such as HD74LV-A Series) which can be applied voltage even when the system power is turned off. 2. Prevent noise from the VBUS pin while the USB is performing communication. Figure 22.
Section 22 USB Function Module (USB) 22.10 Usage Notes 22.10.1 Receiving Setup Data Note the following for EPDR0s that receives 8-byte setup data: 1. As a latest setup command must be received in high priority, the write from the USB bus takes priority over the read from the CPU. If the next setup command reception is started while the CPU is reading data after the data is received, the read from the CPU is forcibly terminated. Therefore, the data read after reception is started becomes invalid. 2.
Section 22 USB Function Module (USB) 22.10.4 Assigning Interrupt Sources to EP0 The EP0-related interrupt sources indicated by the interrupt source bits (bits 0 to 3) in IFR0 must be assigned to the same interrupt signal with ISR0. The other interrupt sources have no limitations. 22.10.5 Clearing the FIFO When DTC Transfer is Enabled The endpoint 1 data register (EPDR1) cannot be cleared when DTC transfer for endpoint 1 is enabled (EP1DMAE in DMA = 1). Cancel DTC transfer before clearing the register. 22.
Section 22 USB Function Module (USB) 22.10.7 Restrictions on Peripheral Module Clock (φ) Operating Frequency The USB clock select pin (UXSEL) can be used to select the clock source. To set the USB dedicated clock (cku) at 48 MHz, specify the peripheral module clock (φ) as shown in table 22.8. Operation cannot be guaranteed if any frequency other than in the following table is specified. When UXSEL is set to 0, connect UEXTAL to the system power supply (0 V).
Section 23 A/D Converter Section 23 A/D Converter This LSI includes a successive-approximation-type 10-bit A/D converter that allows up to eight analog input channels to be selected. A block diagram of the A/D converter is shown in figure 23.1. 23.1 Features • 10-bit resolution • Eight input channels • Conversion time: 4.
Section 23 A/D Converter Internal data bus AVref* 10-bit D/A AVSS Successive approximations register AVCC AN0 AN4 AN5 Multiplexer AN3 A D D R A A D D R B A D D R C A D D R D A D D R E A D D R F A D D R G A D D R H A D C S R A D C R + AN1 AN2 Bus interface Module data bus AN6 Comparator Control circuit Sample-and-hold circuit AN7 ADI interrupt signal Conversion start trigger from TMR_0 ADTRG [Legend] ADCR: A/D control register ADCSR: A/D control/status register ADDRA: A/D data r
Section 23 A/D Converter 23.2 Input/Output Pins Table 23.1 summarizes the pins used by the A/D converter. Table 23.
Section 23 A/D Converter 23.3 Register Descriptions The A/D converter has the following registers. • A/D data register A (ADDRA) • A/D data register B (ADDRB) • A/D data register C (ADDRC) • A/D data register D (ADDRD) • A/D data register E (ADDRE) • A/D data register F (ADDRF) • A/D data register G (ADDRG) • A/D data register H (ADDRH) • A/D control/status register (ADCSR) • A/D control register (ADCR) 23.3.
Section 23 A/D Converter Table 23.2 Analog Input Channels and Corresponding ADDR Registers Analog Input Channel A/D Data Register to Store A/D Conversion Results AN0 ADDRA AN1 ADDRB AN2 ADDRC AN3 ADDRD AN4 ADDRE AN5 ADDRF AN6 ADDRG AN7 ADDRH 23.3.2 A/D Control/Status Register (ADCSR) The ADCSR controls the operation of the A/D conversion. Bit Bit Name Initial Value R/W 7 ADF 0 R/(W)* A/D End Flag Description A status flag that indicates the end of A/D conversion.
Section 23 A/D Converter Bit Bit Name Initial Value R/W Description 5 ADST 0 A/D Start R/W Clearing this bit to 0 stops A/D conversion and enters the idle state. Setting this bit to 1 starts A/D conversion. In single mode, this bit is cleared to 0 automatically when conversion on the specified channel ends. In scan mode, conversion continues sequentially on the specified channels until this bit is cleared to 0 by software, a reset, or a transition to the hardware standby mode.
Section 23 A/D Converter 23.3.3 A/D Control Register (ADCR) The ADCR sets the operation mode of A/D converter and the conversion time. Bit Bit Name Initial Value R/W Description 7 TRGS1 0 R/W Timer Trigger Select 1 and 0, Extended Trigger Select 6 TRGS0 0 R/W Enable starting of A/D conversion by a trigger signal. 0 EXTRGS 0 R/W 00 0: Disables starting by trigger signals. 10 0: Enables starting by a trigger from TMR_0. 10 1: Enables starting by the ADTRG pin input.
Section 23 A/D Converter 23.4 Operation The A/D converter operates by successive approximation with 10-bit resolution. It has two operating modes: single mode and scan mode. When changing the operating mode or analog input channel, to prevent incorrect operation, first clear the ADST bit to 0 in ADCSR to halt A/D conversion. The ADST bit can be set to 1 at the same time as the operating mode or analog input channel is changed. 23.4.
Section 23 A/D Converter Set* ADIE ADST A/D conversion starts Set* Set* Clear* Clear* ADF State of channel 0 (AN0) Idle State of channel 1 (AN1) Idle State of channel 2 (AN2) Idle State of channel 3 (AN3) Idle A/D conversion 1 Idle A/D conversion 2 Idle ADDRA Read the result of conversion Result of A/D conversion 1 ADDRB Read the result of conversion Result of A/D conversion 2 ADDRC ADDRD Note : * indicates execution of a software instruction. Figure 23.
Section 23 A/D Converter 4. The ADST bit is not automatically cleared to 0 and steps 2 to 3 are repeated as long as the ADST bit remains set to 1. When the ADST bit is cleared to 0, A/D conversion stops and the A/D converter enters the idle state. After that, when the ADST bit is set to 1, the operation starts from the first channel again.
Section 23 A/D Converter 23.4.3 Input Sampling and A/D Conversion Time The A/D converter has a built-in sample-and-hold circuit. The A/D converter samples the analog input when the A/D conversion start delay time (tD) has passed after the ADST bit in ADCSR is set to 1, then starts A/D conversion. Figure 23.4 shows the A/D conversion timing. Tables 23.3 and 23.4 show the A/D conversion time. As indicated in figure 23.4, the A/D conversion time (tCONV) includes tD and the input sampling time (tSPL).
Section 23 A/D Converter (1) φ Address (2) Write signal Input sampling timing ADF tD tSPL tCONV [Legend] (1): ADCSR write cycle (2): ADCSR address tD: A/D conversion start delay tSPL: Input sampling time tCONV: A/D conversion time Figure 23.4 A/D Conversion Timing Rev. 2.00 Aug.
Section 23 A/D Converter Table 23.3 A/D Conversion Characteristics (Single Mode) CKS1 = 0 CKS1 = 1 CKS0 = 1 CKS0 = 0 CKS0 = 1 Item Symbol Min. Typ. Max. Min. Typ. Max. Min. Typ. Max. A/D conversion start delay time tD (6) (9) (10) (17) (18) (33) Input sampling time tSPL 30 60 120 A/D conversion time 77 80 153 160 305 320 Note: tCONV Values in the table are the number of states. Table 23.
Section 23 A/D Converter 23.4.4 Timing of External Trigger Input A/D conversion can also be started by an externally input trigger signal. Setting the TRGS1 and TRGS0 bits in ADCR to B'11 selects the signal on the ADTRG pin as an external trigger. The ADST bit in ADCSR is set to 1 on the falling edge of ADTRG, initiating A/D conversion. Other operations are the same as those in the case where the ADST bit is set to 1 by software, regardless of whether the converter is in single mode or scan mode.
Section 23 A/D Converter 23.5 Interrupt Source The A/D converter generates an A/D conversion end interrupt (ADI) at the end of A/D conversion. Setting the ADIE bit to 1 enables ADI interrupt requests while the ADF bit in ADCSR is set to 1 after A/D conversion ends. The ADI interrupt can be used to activate the DTC. Reading the converted data by the DTC activated by the ADI interrupt allows consecutive conversion to be performed without software overhead. Table 23.
Section 23 A/D Converter Digital output Ideal A/D conversion characteristic H'3FF H'3FE H'3FD H'004 H'003 H'002 Quantization error H'001 H'000 1 2 1024 1024 1022 1023 FS 1024 1024 Analog input voltage Figure 23.6 A/D Conversion Accuracy Definitions Full-scale error Digital output Ideal A/D conversion characteristic Nonlinearity error Actual A/D conversion characteristic FS Offset error Analog input voltage Figure 23.7 A/D Conversion Accuracy Definitions Rev. 2.00 Aug.
Section 23 A/D Converter 23.7 Usage Notes 23.7.1 Setting of Module Stop Mode Operation of the A/D converter can be enabled or disabled by setting the module stop control register. By default, the A/D converter is stopped. Registers of the A/D converter only become accessible when it is released from module stop mode. See section 28, Power-Down Modes, for details. 23.7.
Section 23 A/D Converter 23.7.3 Influences on Absolute Accuracy Adding capacitance results in coupling with GND, and therefore noise in GND may adversely affect the absolute accuracy. Be sure to make the connection to an electrically stable GND such as AVss. Care is also required to insure that filter circuits do not communicate with digital signals on the mounting board, so acting as antennas. 23.7.
Section 23 A/D Converter 23.7.6 Notes on Noise Countermeasures In order to prevent damage due to an abnormal voltage such as an excessive surge at the analog input pins (AN0 to AN7), a protection circuit should be connected between AVcc and AVss as shown in figure 23.9. Also, the bypass capacitors connected to AVcc and the filter capacitors connected to AN0 to AN7 must be connected to AVss.
Section 23 A/D Converter 10 kΩ To A/D converter AN0 to AN7 20 pF Note: Values are reference values. Figure 23.10 Analog Input Pin Equivalent Circuit 23.7.7 Note on the Usage in Software Standby Mode If this LSI enters software standby mode with the A/D conversion enabled, the content of the A/D converter is retained and about the same amount of analog supply current may flow as that flows when A/D conversion in progress.
Section 24 RAM Section 24 RAM This LSI has 40 Kbytes of on-chip high-speed static RAM. The RAM is connected to the CPU by a 16-bit data bus, enabling one-state access by the CPU to both byte data and word data. The on-chip RAM can be enabled or disabled by means of the RAME bit in the system control register (SYSCR). For details on SYSCR, see section 3.2.2, System Control Register (SYSCR). Rev. 2.00 Aug.
Section 24 RAM Rev. 2.00 Aug.
Section 25 Flash Memory Section 25 Flash Memory The flash memory has the following features. Figure 25.1 shows a block diagram of the flash memory. 25.1 Features • Size 512 Kbytes (ROM address: H'000000 to H'07FFFF) • Programming/erasing interface by the download of on-chip program This LSI has a dedicated programming/erasing program. After downloading this program to the on-chip RAM, programming/erasing can be performed by setting the argument parameter.
Section 25 Flash Memory Internal address bus Internal data bus (16 bits) FCCS Module bus FPCS Memory MAT unit FECS FKEY Control unit FMATS User MAT: 512 Kbytes User boot MAT: 16 Kbytes FTDAR Flash memory FWE pin Mode pin [Legend] FCCS: FPCS: FECS: FKEY: FMATS: FTDAR: Operating mode Flash code control status register Flash program code select register Flash erase code select register Flash key code register Flash MAT select register Flash transfer destination address register Note: To read from
Section 25 Flash Memory 25.1.1 Operating Mode When each mode pin and the FWE pin are set in the reset state and reset start is performed, this LSI enters each operating mode as shown in figure 25.2. • Flash memory can be read in user mode, but cannot be programmed or erased. • Flash memory can be read, programmed, or erased on the board only in boot mode, user program mode, and user boot mode. • Flash memory can be read, programmed, or erased by means of the PROM programmer in programmer mode.
Section 25 Flash Memory 25.1.2 Mode Comparison The comparison table of programming and erasing related items about boot mode, user program mode, user boot mode, and programmer mode is shown in table 25.1. Table 25.
Section 25 Flash Memory 25.1.3 Flash Memory MAT Configuration This LSI's flash memory is configured by the 16-Kbyte user boot MAT and 512-Kbyte user MAT. The start address is allocated to the same address in the user MAT and user boot MAT. Therefore, when the program execution or data access is performed between two MATs, the MAT must be switched by using FMATS. The user MAT or user boot MAT can be read in all modes. However, the user boot MAT can be programmed only in boot mode and programmer mode.
Section 25 Flash Memory EB0 H'000000 H'000001 H'000002 →Programming unit: 128 bytes→ H'00007F Erase unit: 4 kbytes EB1 Erase unit: 4 kbytes EB2 Erase unit: 4 kbytes EB3 H'000F80 H'000F81 H'000F82 – – – – – – – – – – – – – – H'000FFF H'001000 H'001001 H'001002 →Programming unit: 128 bytes→ H'00107F H'001F80 H'001F81 H'001F82 – – – – – – – – – – – – – – H'001FFF H'002000 H'002001 H'002002 →Programming unit: 128 bytes→ H'00207F H'002F80 H'002F81 H'002F82 – – – – – – – – – – –
Section 25 Flash Memory 25.1.5 Programming/Erasing Interface Programming/erasing is executed by downloading the on-chip program to the on-chip RAM and specifying the program address/data and erase block by using the interface register/parameter. The procedure program is made by the user in user program mode and user boot mode. An overview of the procedure is given as follows. For details, see section 25.4.3, User Program Mode. Start user procedure program for programming/erasing.
Section 25 Flash Memory 2. Download of on-chip program The on-chip program is automatically downloaded by setting the flash key code register (FKEY) and the SCO bit in the flash code control status register (FCCS), which are programming/erasing interface registers. The flash memory is replaced to the embedded program storage area when downloading.
Section 25 Flash Memory 25.2 Input/Output Pins Table 25.2 shows the flash memory pin configuration. Table 25.
Section 25 Flash Memory 25.3 Register Descriptions The registers/parameters which control flash memory are shown in the following. To read from or write to these registers/parameters, the FLSHE bit in the serial timer control register (STCR) must be set to 1. For details on STCR, see section 3.2.3, Serial Timer Control Register (STCR).
Section 25 Flash Memory Table 25.3 Register/Parameter and Target Mode Initialization Programming Erasure Read FCCS Programming/ Erasing Interface FPCS Register FECS FKEY Download FMATS FTDAR Programming/ DPFR Erasing Interface FPFR Parameter FPEFEQ * 1 * 1 * 2 FMPAR FMPDR FEBS Notes: 1. The setting is required when programming or erasing user MAT in user boot mode.
Section 25 Flash Memory 25.3.1 Programming/Erasing Interface Register The programming/erasing interface registers are as described below. They are all 8-bit registers that can be accessed in byte. These registers are initialized at a reset or in hardware standby mode. • Flash Code Control Status Register (FCCS) FCCS is configured by bits which request the monitor of the FWE pin state and error occurrence during programming or erasing flash memory and the download of on-chip program.
Section 25 Flash Memory Bit Initial Bit Name Value R/W Description 4 FLER R Flash Memory Error 0 Indicates an error occurs during programming and erasing flash memory. When FLER is set to 1, flash memory enters the error protection state. When FLER is set to 1, high voltage is applied to the internal flash memory. To reduce the damage to flash memory, the reset must be released after the reset period of 100 µs which is longer than normal. 0: Flash memory operates normally.
Section 25 Flash Memory Bit Initial Bit Name Value R/W Description 3 WEINTE R/W Program/Erase Enable 0 Modifies the space for the interrupt vector table, when interrupt vector data is not read successfully during programming/erasing flash memory or switching between a user MAT and a user boot MAT. When this bit is set to 1, interrupt vector data is read from address spaces H'FFE080 to H'FFE0FF (on-chip RAM space), instead of from address spaces H'000000 to H'00007F (up to vector number 31).
Section 25 Flash Memory Bit Initial Bit Name Value R/W Description 0 SCO (R)/W* Source Program Copy Operation 0 Requests the on-chip programming/erasing program to be downloaded to the on-chip RAM. When this bit is set to 1, the on-chip program which is selected by FPCS/FECS is automatically downloaded in the on-chip RAM specified by FTDAR. In order to set this bit to 1, H′A5 must be written to FKEY and this operation must be executed in the on-chip RAM.
Section 25 Flash Memory • Flash Program Code Select Register (FPCS) FPCS selects the on-chip programming program to be downloaded. Bit Initial Bit Name Value R/W 7 to 1 R/W All 0 Description Reserved The initial value should not be changed. 0 PPVS 0 R/W Program Pulse Verify Selects the programming program. 0: On-chip programming program is not selected. [Clearing condition] When transfer is completed 1: On-chip programming program is selected.
Section 25 Flash Memory • Flash Key Code Register (FKEY) FKEY is a register for software protection that enables download of on-chip program and programming/erasing of flash memory. Before setting the SCO bit to 1 in order to download onchip program or executing the downloaded programming/erasing program, these processing cannot be executed if the key code is not written.
Section 25 Flash Memory • Flash MAT Select Register (FMATS) FMATS specifies whether user MAT or user boot MAT is selected. Bit Initial Bit Name Value R/W Description 7 MS7 0/1* R/W MAT Select 6 MS6 0 R/W 5 MS5 0/1* R/W 4 MS4 0 R/W These bits are in user-MAT selection state when the value other than H'AA is written and in user-boot-MAT selection state when H'AA is written.
Section 25 Flash Memory • Flash Transfer Destination Address Register (FTDAR) FTDAR is a register that specifies the address to download an on-chip program. This register must be specified before setting the SCO bit in FCCS to 1. Bit Initial Bit Name Value R/W Description 7 TDER R/W Transfer Destination Address Setting Error 0 This bit is set to 1 when the address specified by bits TDA6 to TDA0, which is the start address to download an on-chip program, is over the range.
Section 25 Flash Memory 25.3.2 Programming/Erasing Interface Parameter The programming/erasing interface parameter specifies the operating frequency, storage place for program data, programming destination address, and erase block and exchanges the processing result for the downloaded on-chip program. This parameter uses the general registers of the CPU (ER0 and ER1) or the on-chip RAM area. The initial value is undefined at a reset or in hardware standby mode.
Section 25 Flash Memory Table 25.
Section 25 Flash Memory (1) Download Control The on-chip program is automatically downloaded by setting the SCO bit to 1. The on-chip RAM area to be downloaded is the 3-Kbyte area starting from the address specified by FTDAR. Download control is set by the program/erase interface registers, and the DPFR parameter indicates the return value. (a) Download pass/fail result parameter (DPFR: single byte of start address specified by FTDAR) This parameter indicates the return value of the download result.
Section 25 Flash Memory Bit Initial Bit Name Value 0 SF R/W Description R/W Success/Fail Returns the result whether download is ended normally or not. The determination result whether program that is downloaded to the on-chip RAM is read back and then transferred to the on-chip RAM is returned. 0: Downloading on-chip program is ended normally (no error) 1: Downloading on-chip program is ended abnormally (error occurs) Rev. 2.00 Aug.
Section 25 Flash Memory (2) Programming/Erasing Initialization The on-chip programming/erasing program to be downloaded includes the initialization program. The specified period pulse must be applied when programming or erasing. The specified pulse width is made by the method in which wait loop is configured by the CPU instruction. The operating frequency of the CPU must be set. The initial program is set as a parameter of the programming/erasing program which has downloaded these settings.
Section 25 Flash Memory (b) Flash pass/fail parameter (FPFR: general register R0L of CPU) This parameter indicates the return value of the initialization result. Bit Initial Bit Name Value R/W Description 7 to 2 Unused Return 0 1 FQ R/W Frequency Error Detect Returns the check result whether the specified operating frequency of the CPU is in the range of the supported operating frequency.
Section 25 Flash Memory (a) Flash multipurpose address area parameter (FMPAR: general register ER1 of CPU) This parameter stores the start address of the programming destination on the user MAT. When the address in the area other than flash memory space is set, an error occurs. The start address of the programming destination must be at the 128-byte boundary. If this boundary condition is not satisfied, an error occurs. The error occurrence is indicated by the WA bit (bit 1) in FPFR.
Section 25 Flash Memory Bit Initial Bit Name Value 6 MD R/W Description R/W Programming Mode Related Setting Error Detect Returns the check result that a high level signal is input to the FWE pin and the error protection state is not entered. When the low level signal is input to the FWE pin or the error protection state is entered, 1 is written to this bit. The state can be confirmed with the FWE and FLER bits in FCCS. For conditions to enter the error protection state, see section 25.5.
Section 25 Flash Memory Bit Initial Bit Name Value 2 WD R/W Description R/W Write Data Address Detect When the address in the flash memory area is specified as the start address of the storage destination of the program data, an error occurs. 0: Setting of write data address is normal 1: Setting of write data address is abnormal 1 WA R/W Write Address Error Detect When the following items are specified as the start address of the programming destination, an error occurs.
Section 25 Flash Memory (4) Erasure Execution When flash memory is erased, the erase-block number on the user MAT must be passed to the erasing program which is downloaded. This is set to the FEBS parameter (general register ER0). One block is specified from the block number 0 to 15. For details on the erasing processing procedure, see section 25.4.3, User Program Mode. (a) Flash erase block select parameter (FEBS: general register ER0 of CPU) This parameter specifies the erase-block number.
Section 25 Flash Memory (b) Flash pass/fail parameter (FPFR: general register R0L of CPU) This parameter returns value of the erasing processing result. Bit Initial Bit Name Value R/W Description 7 Unused 6 MD R/W Return 0. Programming Mode Related Setting Error Detect Returns the check result that a high level signal is input to the FWE pin and the error protection state is not entered.
Section 25 Flash Memory Bit Initial Bit Name Value 3 EB R/W Description R/W Erase Block Select Error Detect Returns the check result whether the specified eraseblock number is in the block range of the user MAT. 0: Setting of erase-block number is normal 1: Setting of erase-block number is abnormal 2, 1 Unused Return 0. 0 SF R/W Success/Fail Indicates whether the erasing processing is ended normally or not.
Section 25 Flash Memory 25.4.1 Boot Mode Boot mode executes programming/erasing user MAT and user boot MAT by means of the control command and program data transmitted from the host using the on-chip SCI. The tool for transmitting the control command and program data must be prepared in the host. The SCI communication mode is set to asynchronous mode. When reset start is executed after this LSI’s pin is set in boot mode, the boot program in the microcomputer is initiated.
Section 25 Flash Memory (1) SCI Interface Setting by Host When boot mode is initiated, this LSI measures the low period of asynchronous SCI-communication data (H'00), which is transmitted consecutively by the host. The SCI transmit/receive format is set to 8-bit data, 1 stop bit, and no parity. This LSI calculates the bit rate of transmission by the host by means of the measured low period and transmits the bit adjustment end sign (1 byte of H'00) to the host.
Section 25 Flash Memory (2) State Transition Diagram The overview of the state transition diagram after boot mode is initiated is shown in figure 25.8. 1. Bit rate adjustment After boot mode is initiated, the bit rate of the SCI interface is adjusted with that of the host. 2. Waiting for inquiry set command For inquiries about user-MAT size and configuration, MAT start address, and support state, the required information is transmitted to the host. 3.
Section 25 Flash Memory (Bit rate adjustment) H'00.......H'00 reception H'00 transmission (adjustment completed) Boot mode initiation (reset by boot mode) Bit rate adjustment H'55 2. ption rece Inquiry command reception Wait for inquiry setting command Inquiry command response 3. 4. 1.
Section 25 Flash Memory 25.4.2 USB Boot Mode The H8S/2472 Group supports the USB boot mode. USB boot mode executes programming/erasing of the user MAT by means of the control command and program data transmitted from the externally connected host via the USB. In USB boot mode, the tool for transmitting the control command and program data, and the program data must be prepared in the host. The system configuration in USB boot mode is shown in figure 25.9. Interrupts are ignored in USB boot mode.
Section 25 Flash Memory (1) Features • For enumeration information, refer to table 25.7. Table 25.7 Enumeration Information USB standard Ver.2.0 (Full speed) Transfer mode Transfer mode Control (in, out), Bulk (in, out) Maximum power consumption 100 mA Endpoint configuration EP0 Control (in out) 8 bytes Configuration 1 InterfaceNumber0 AlternateSetting0 EP1 Bulk (out) 64 bytes EP2 Bulk (in) 64 bytes Rev. 2.00 Aug.
Section 25 Flash Memory (2) State Transition Diagram The state transition after USB boot mode is initiated is shown in figure 25.10. Boot mode initiation (reset by boot mode) 1. Enumeration H'55 n eptio rec Inquiry command reception 2. Wait for inquiry setting command Processing of inquiry setting command Inquiry command response 3. 4.
Section 25 Flash Memory 4. After all user MAT are automatically erased, the state of waiting for programming/erasing command is entered. When the programming command is received, the state shifts to the state of waiting for programming data. The same applies to erasing. In addition to the commands for programming/erasing, there are commands for performing sum check, blank check (erasure check), and memory read of the user MAT, and acquiring the current status information.
Section 25 Flash Memory 25.4.3 User Program Mode The user MAT can be programmed/erased in user program mode. (The user boot MAT cannot be programmed/erased.) Programming/erasing is executed by downloading the program in the microcomputer. The overview flow is shown in figure 25.11. High voltage is applied to internal flash memory during the programming/erasing processing. Therefore, transition to reset or hardware standby must not be executed. Doing so may damage or destroy flash memory.
Section 25 Flash Memory (1) On-chip RAM Address Map when Programming/Erasing is Executed Parts of the procedure program that are made by the user, like download request, programming/erasing procedure, and determination of the result, must be executed in the on-chip RAM. The on-chip program that is to be downloaded is all in the on-chip RAM. Note that area in the on-chip RAM must be controlled so that these parts do not overlap. Figure 25.12 shows the program area to be downloaded.
Section 25 Flash Memory (2) Programming Procedure in User Program Mode The procedures for download, initialization, and programming are shown in figure 25.13. 1. Disable interrupts and bus master operation other than CPU Set FKEY to H'A5 2. Set FKEY to H'5A 10. Set SCO to 1 and execute download 3. Set parameters to ER1 and ER0 (FMPAR and FMPDR) 11. Clear FKEY to 0 4. Programming JSR FTDAR setting + 16 12. 5.
Section 25 Flash Memory 128-byte programming is performed in one program processing. When more than 128-byte programming is performed, programming destination address/program data parameter is updated in 128-byte units and programming is repeated. When less than 128-byte programming is performed, data must total 128 bytes by adding the invalid data. If the dummy data to be added is H'FF, the program processing period can be shortened. 1.
Section 25 Flash Memory After the on-chip program storage area is returned to the user-MAT space, the user procedure program is returned. In the download processing, the values of general registers of the CPU are held. In the download processing, any interrupts are not accepted. However, interrupt requests are held. Therefore, when the user procedure program is returned, the interrupts occur.
Section 25 Flash Memory 7. Initialization When a programming program is downloaded, the initialization program is also downloaded to the on-chip RAM. There is an entry point of the initialization program in the area from the start address specified by FTDAR + 32 bytes of the on-chip RAM. The subroutine is called and initialization is executed by using the following steps. MOV.
Section 25 Flash Memory 11. The parameter which is required for programming is set. The start address of the programming destination of the user MAT (FMPAR) is set to general register ER1. The start address of the program data area (FMPDR) is set to general register ER0. Example of the FMPAR setting FMPAR specifies the programming destination address.
Section 25 Flash Memory 15. After programming finishes, clear FKEY and specify software protection. If this LSI is restarted by a reset immediately after user MAT programming has finished, secure the reset period (period of RES = 0) of 100 µs which is longer than normal. (3) Erasing Procedure in User Program Mode The procedures for download, initialization, and erasing are shown in figure 25.14.
Section 25 Flash Memory For the downloaded on-chip program area, refer to the RAM map for programming/erasing in figure 25.12. A single divided block is erased by one erasing processing. For block divisions, refer to figure 25.4. To erase two or more blocks, update the erase block number and perform the erasing processing for each block. 1. Select the on-chip program to be downloaded Set the EPVB bit in FECS to 1. Several programming/erasing programs cannot be selected at one time.
Section 25 Flash Memory 5. Determine whether erasure of the necessary blocks has completed. If more than one block is to be erased, update the FEBS parameter and repeat steps 2 to 5. Blocks that have already been erased can be erased again. 6. After erasure completes, clear FKEY and specify software protection. If this LSI is restarted by a reset immediately after user MAT erasure has completed, secure the reset period (period of RES = 0) of 100 µs which is longer than normal.
Section 25 Flash Memory • Be careful not to damage on-chip RAM with overlapped settings. In addition to the erasing program area and programming program area, areas for the user procedure programs, work area, and stack area are reserved in on-chip RAM. Do not make settings that will overwrite data in these areas. • Be sure to initialize both the erasing program and programming program.
Section 25 Flash Memory 25.4.4 User Boot Mode This LSI has user boot mode which is initiated with different mode pin settings than those in boot mode or user program mode. User boot mode is a user-arbitrary boot mode, unlike boot mode that uses the on-chip SCI. Only the user MAT can be programmed/erased in user boot mode. Programming/erasing of the user boot MAT is only enabled in boot mode or programmer mode.
Section 25 Flash Memory Start programming procedure program 1 Select on-chip program to be downloaded and specify download destination by FTDAR Set FMATS to value other than H'AA to select user MAT MAT switchover Yes No Download error processing Set the FPEFEQ parameters Initialization JSR FTDAR setting + 32 FPFR = 0 ? Set parameter to ER0 and ER1 (FMPAR and FMPDR) Programming Clear FKEY to 0 User-MAT selection state Download Set FKEY to H'A5 Set SCO to 1 and execute download DPFR = 0 ? In
Section 25 Flash Memory read is undetermined. Perform MAT switching in accordance with the description in section 25.6, Switching between User MAT and User Boot MAT. Except for MAT switching, the programming procedure is the same as that in user program mode. The area that can be executed in the steps of the user procedure program (on-chip RAM, user MAT, and external space) is shown in section 25.4.5, Procedure Program and Storable Area for Programming Data. Rev. 2.00 Aug.
Section 25 Flash Memory (3) User MAT Erasing in User Boot Mode For erasing the user MAT in user boot mode, additional processing made by setting FMATS are required: switching from user-boot-MAT selection state to user-MAT selection state, and switching back to user-boot-MAT selection state after erasing completes. Figure 25.17 shows the procedure for erasing the user MAT in user boot mode.
Section 25 Flash Memory MAT switching is enabled by writing a specific value to FMATS. However note that while the MATs are being switched, the LSI is in an unstable state, e.g. access to a MAT is not allowed until MAT switching is completed, and if an interrupt occurs, from which MAT the interrupt vector is read is undetermined. Perform MAT switching in accordance with the description in section 25.6, Switching between User MAT and User Boot MAT.
Section 25 Flash Memory 25.4.5 Procedure Program and Storable Area for Programming Data In the descriptions in the previous section, the programming/erasing procedure programs and storable areas for program data are assumed to be in the on-chip RAM. However, the program and the data can be stored in and executed from other areas, such as part of flash memory which is not to be programmed or erased, or somewhere in the external address space. (1) Conditions that Apply to Programming/Erasing 1.
Section 25 Flash Memory should be transferred to the on-chip RAM to place the address that FMPDR indicates in an area other than the flash memory. In consideration of these conditions, there are three factors; operating mode, the bank structure of the user MAT, and operations. The areas in which the programming data can be stored for execution are shown in tables. Table 25.8 Executable MAT Initiated Mode Operation User Program Mode User Boot Mode* Programming Table 25.9 (1) Table 25.
Section 25 Flash Memory Table 25.
Section 25 Flash Memory Storable /Executable Area On-chip RAM Item Embedded Program External Space (Expanded Mode) User MAT Storage Area User MAT Execution of Programming × Determination of Program Result × Operation for Program Error × Operation for FKEY Clear × Note: * Selected MAT × Transferring the data to the on-chip RAM enables this area to be used. Rev. 2.00 Aug.
Section 25 Flash Memory Table 25.
Section 25 Flash Memory Storable /Executable Area Item On-chip RAM Selected MAT Embedded Program External Space (Expanded Mode) User MAT Storage Area User MAT Operation for Erasure Error × Operation for FKEY Clear × Rev. 2.00 Aug.
Section 25 Flash Memory Table 25.
Section 25 Flash Memory Storable/Executable Area Item On-chip RAM User Boot External Space User MAT (Expanded Mode) MAT Operation for Settings of Program Parameter × Execution of Programming × Determination of Program Result × Operation for Program Error Selected MAT ×* Operation for FKEY Clear × Switching MATs by FMATS × User Boot MAT Embedded Program Storage Area × 2 × Notes: 1. Transferring the data to the on-chip RAM enables this area to be used. 2.
Section 25 Flash Memory Table 25.
Section 25 Flash Memory Storable/Executable Area On-chip RAM Item User Boot External Space User MAT (Expanded Mode) MAT Operation for Settings of Erasure Parameter × Execution of Erasure × Determination of Erasure Result × Operation for Erasure Error ×* Operation for FKEY Clear × Switching MATs by FMATS × Note: * Selected MAT User Boot MAT Embedded Program Storage Area × × Switching FMATS by a program in the on-chip RAM enables this area to be used. Rev. 2.00 Aug.
Section 25 Flash Memory 25.5 Protection There are three kinds of flash memory program/erase protection: hardware, software, and error protection. 25.5.1 Hardware Protection Programming and erasing of flash memory is forcibly disabled or suspended by hardware protection. In this state, the downloading of an on-chip program and initialization are possible.
Section 25 Flash Memory Table 25.10 Hardware Protection Function to be Protected Item Description Download FWE pin protection • When a low level signal is input to the FWE pin, the FWE bit in FCCS is cleared and the program/eraseprotected state is entered. Reset/standby protection • The program/erase interface registers are initialized in the reset state (including a reset by the WDT) and standby mode and the program/eraseprotected state is entered.
Section 25 Flash Memory 25.5.2 Software Protection Software protection is set up in any of two ways: by disabling the downloading of on-chip programs for programming and erasing and by means of a key code. Table 25.11 Software Protection Function to be Protected Item Description Protection by the SCO bit • The program/erase-protected state is entered by clearing the SCO bit in FCCS which disables the downloading of the programming/erasing programs.
Section 25 Flash Memory 4. When a bus master other than the CPU, such as the DTC, gets bus mastership during programming/erasing. Error protection is cancelled only by a reset or by hardware-standby mode. Note that the reset should be released after the reset period of 100 µs which is longer than normal. Since high voltages are applied during programming/erasing of the flash memory, some voltage may remain after the error-protection state has been entered.
Section 25 Flash Memory 25.6 Switching between User MAT and User Boot MAT It is possible to alternate between the user MAT and user boot MAT. However, the following procedure is required because these MATs are allocated to address 0. (Switching to the user boot MAT disables programming and erasing. Programming of the user boot MAT should take place in boot mode or programmer mode.) 1. MAT switching by FMATS should always be executed from the on-chip RAM. 2.
Section 25 Flash Memory 25.7 Programmer Mode Along with its on-board programming mode, this LSI also has a programmer mode as a further mode for the programming and erasing of programs and data. In the programmer mode, a generalpurpose PROM programmer, which supports microcomputers with 512-Kbyte flash memory as a 1 device type* , can freely be used to write programs to the on-chip ROM. Program/erase is possible 2 on the user MAT and user boot MAT* .
Section 25 Flash Memory 25.8 Serial Communication Interface Specification for Boot Mode Initiating boot mode enables the boot program to communicate with the host by using the internal SCI. The serial communication interface specification is shown below. (1) Status The boot program has three states. 1. Bit-Rate-Adjustment State In this state, the boot program adjusts the bit rate to communicate with the host.
Section 25 Flash Memory Reset Bit-rate-adjustment state Inquiry/response wait Response Inquiry Operations for inquiry and selection Transition to programming/erasing Operations for response Operations for erasing user MATs and user boot MATs Programming/erasing wait Programming Erasing Operations for programming Checking Operations for erasing Operations for checking Figure 25.20 Boot Program States Rev. 2.00 Aug.
Section 25 Flash Memory (2) Bit-Rate-Adjustment State The bit rate is calculated by measuring the period of transfer of a low-level byte (H'00) from the host. The bit rate can be changed by the command for a new bit rate selection. After the bit rate has been adjusted, the boot program enters the inquiry and selection state. The bit-rate-adjustment sequence is shown in figure 25.21.
Section 25 Flash Memory 4. Programming of 128 bytes The size is not specified in commands. The size of n is indicated in response to the programming unit inquiry. 5. Memory read response This response consists of 4 bytes of data.
Section 25 Flash Memory • Size (4 bytes): 4-byte response to a memory read (4) Inquiry and Selection States The boot program returns information from the flash memory in response to the host's inquiry commands and sets the device code, clock mode, and bit rate in response to the host's selection command. Inquiry and selection commands are listed below. Table 25.
Section 25 Flash Memory The selection commands, which are device selection (H'10), clock mode selection (H'11), and new bit rate selection (H'3F), should be sent from the host in that order. These commands will certainly be needed. When two or more selection commands are sent at once, the last command will be valid. All of these commands, except for the boot program status inquiry command (H'4F), will be valid until the boot program receives the programming/erasing transition (H'40).
Section 25 Flash Memory (b) Device Selection The boot program will set the supported device to the specified device code. The program will return the selected device code in response to the inquiry after this setting has been made.
Section 25 Flash Memory (d) Clock Mode Selection The boot program will set the specified clock mode. The program will return the selected clockmode information after this setting has been made. The clock-mode selection command should be sent after the device-selection commands. Command H'11 Size Mode SUM • Command, H'11, (1 byte): Selection of clock mode • Size (1 byte): Amount of data that represents the modes • Mode (1 byte): A clock mode returned in reply to the supported clock mode inquiry.
Section 25 Flash Memory (e) Multiplication Ratio Inquiry The boot program will return the supported multiplication and division ratios.
Section 25 Flash Memory (f) Operating Clock Frequency Inquiry The boot program will return the number of operating clock frequencies, and the maximum and minimum values.
Section 25 Flash Memory (g) User Boot MAT Information Inquiry The boot program will return the number of user boot MATs and their addresses.
Section 25 Flash Memory • Area-last address (4 bytes): Last address of the area There are as many groups of data representing the start and last addresses as there are areas. • SUM (1 byte): Checksum (i) Erased Block Information Inquiry The boot program will return the number of erased blocks and their addresses.
Section 25 Flash Memory (k) New Bit-Rate Selection The boot program will set a new bit rate and return the new bit rate. This selection should be sent after sending the clock mode selection command.
Section 25 Flash Memory Error Response H'BF ERROR • Error response, H'BF, (1 byte): Error response to selection of new bit rate • ERROR: (1 byte): Error code H'11: H'24: H'25: H'26: H'27: (5) Sum checking error Bit-rate selection error The rate is not available. Error in input frequency This input frequency is not within the specified range. Multiplication-ratio error The ratio does not match an available ratio. Operating frequency error The frequency is not within the specified range.
Section 25 Flash Memory 4. Bit rate To facilitate error checking, the value (n) of clock select (CKS) in the serial mode register (SMR), and the value (N) in the bit rate register (BRR), which are found from the peripheral operating clock frequency (φ) and bit rate (B), are used to calculate the error rate to ensure that it is less than 4%. If the error is more than 4%, a bit rate error is generated.
Section 25 Flash Memory (6) Transition to Programming/Erasing State The boot program will transfer the erasing program, and erase the user MATs and user boot MATs in that order. On completion of this erasure, ACK will be returned and will enter the programming/erasing state. The host should select the device code, clock mode, and new bit rate with device selection, clockmode selection, and new bit-rate selection commands, and then send the command for the transition to programming/erasing state.
Section 25 Flash Memory (8) Command Order The order for commands in the inquiry selection state is shown below. 1. A supported device inquiry (H'20) should be made to inquire about the supported devices. 2. The device should be selected from among those described by the returned information and set with a device-selection (H'10) command. 3. A clock-mode inquiry (H'21) should be made to inquire about the supported clock modes. 4.
Section 25 Flash Memory (9) Programming/Erasing State A programming selection command makes the boot program select the programming method, a 128-byte programming command makes it program the memory with data, and an erasing selection command and block erasing command make it erase the block. The programming/erasing commands are listed below. Table 25.
Section 25 Flash Memory • Programming Programming is executed by a programming-selection command and a 128-byte programming command. Firstly, the host should send the programming-selection command and select the programming method and programming MATs. There are two programming selection commands, and selection is according to the area and method for programming. 1. User boot MAT programming selection 2.
Section 25 Flash Memory (a) User boot MAT programming selection The boot program will transfer a programming program. The data is programmed to the user boot MATs by the transferred programming program. Command H'42 • Command, H'42, (1 byte): User boot MAT programming selection Response H'06 • Response, H'06, (1 byte): Response to user boot MAT programming selection When the programming program has been transferred, the boot program will return ACK.
Section 25 Flash Memory • Command, H'50, (1 byte): 128-byte programming • Programming Address (4 bytes): Start address for programming Multiple of the size specified in response to the programming unit inquiry (i.e. H'00, H'01, H'00, H'00 : H'00010000) • Programming Data (128 bytes): Data to be programmed The size is specified in the response to the programming unit inquiry.
Section 25 Flash Memory Error Response H'D0 ERROR • Error Response, H'D0, (1 byte): Error response for 128-byte programming • ERROR: (1 byte): Error code H'11: Checksum error H'2A: Address error H'53: Programming error An error has occurred in programming and programming cannot be continued. (10) Erasure Erasure is performed with the erasure selection and block erasure command. Firstly, erasure is selected by the erasure selection command and the boot program then erases the specified block.
Section 25 Flash Memory (a) Erasure Selection The boot program will transfer the erasure program. User MAT data is erased by the transferred erasure program. Command • Command, H'48, (1 byte): Erasure selection Response • H'48 H'06 Response, H'06, (1 byte): Response for erasure selection After the erasure program has been transferred, the boot program will return ACK.
Section 25 Flash Memory On receiving block number H'FF, the boot program will stop erasure and wait for a selection command. Command H'58 Size Block number SUM • Command, H'58, (1 byte): Erasure • Size, (1 byte): The number of bytes that represents the block number This is fixed to 1.
Section 25 Flash Memory Error Response H'D2 ERROR • Error response: H'D2 (1 byte): Error response to memory read • ERROR: (1 byte): Error code H'11: Sum check error H'2A: Address error The read address is not in the MAT. H'2B: Size error The read size exceeds the MAT. (12) User Boot MAT Sum Check The boot program will return the byte-by-byte total of the contents of the bytes of the user boot MAT, as a 4-byte value.
Section 25 Flash Memory (14) User Boot MAT Blank Check The boot program will check whether or not all user boot MATs are blank and return the result. Command H'4C • Command, H'4C, (1 byte): Blank check for user boot MAT Response H'06 • Response, H'06, (1 byte): Response to the blank check of user boot MAT If all user MATs are blank (H'FF), the boot program will return ACK.
Section 25 Flash Memory (16) Boot Program State Inquiry The boot program will return indications of its present state and error condition. This inquiry can be made in the inquiry/selection state or the programming/erasing state. Command H'4F • Command, H'4F, (1 byte): Response H'5F Size Inquiry regarding boot program’s state Status ERROR SUM • Response, H'5F, (1 byte): Response to boot program state inquiry • Size (1 byte): The number of bytes. This is fixed to 2.
Section 25 Flash Memory Table 25.
Section 25 Flash Memory 25.9 Usage Notes 1. The initial state of the product at its shipment is in the erased state. For the product whose revision of erasing is undefined, we recommend to execute automatic erasure for checking the initial state (erased state) and compensating. 2. For the PROM programmer suitable for programmer mode in this LSI and its program version, refer to the instruction manual of the socket adapter. 3.
Section 25 Flash Memory 11. If data other than H'FFFFFFFF is written to the key code area (H'00003C to H'00003F) of flash memory, only H'00 can be read in programmer mode. (In this case, data is read as H'00. Rewrite is possible after erasing the data.) For reading in programmer mode, make sure to write H'FFFFFFFF to the entire key code area.
Section 25 Flash Memory Rev. 2.00 Aug.
Section 26 Boundary Scan (JTAG) Section 26 Boundary Scan (JTAG) The JTAG (Joint Test Action Group) is standardized as an international standard, IEEE Standard 1149.1, and is open to the public as IEEE Standard Test Access Port and Boundary-Scan Architecture.
Section 26 Boundary Scan (JTAG) ETCK ETMS TAP controller Decoder ETRST ETDI Shift register SDBSR SDBPR SDIR SDIDR ETDO Mux [Legend] SDIR: SDBPR: SDBSR: SDIDR: Instruction register Bypass register Boundary scan register ID code register Figure 26.1 JTAG Block Diagram Rev. 2.00 Aug.
Section 26 Boundary Scan (JTAG) 26.2 Input/Output Pins Table 26.1 shows the JTAG pin configuration. Table 26.1 Pin Configuration Pin Name Abbreviation I/O Function Test clock ETCK Input Test clock input Provides an independent clock supply to the JTAG. As the clock input to the ETCK pin is supplied directly to the JTAG, a clock waveform with a duty cycle close to 50% should be input. For details, see section 31, Electrical Characteristics.
Section 26 Boundary Scan (JTAG) 26.3 Register Descriptions The JTAG has the following registers. • Instruction register (SDIR) • Bypass register (SDBPR) • Boundary scan register (SDBSR) • ID code register (SDIDR) Instructions can be input to the instruction register (SDIR) by serial transfer from the test data input pin (ETDI). Data from SDIR can be output via the test data output pin (ETDO).
Section 26 Boundary Scan (JTAG) 26.3.1 Instruction Register (SDIR) SDIR is a 32-bit register. JTAG instructions can be transferred to SDIR by serial input from the ETDI pin. SDIR can be initialized when the ETRST pin is low or the TAP controller is in the Test-Logic-Reset state, but is not initialized by a reset or in standby mode. Only 4-bit instructions can be transferred to SDIR. If an instruction exceeding 4 bits is input, the last 4 bits of the serial data will be stored in SDIR.
Section 26 Boundary Scan (JTAG) 26.3.2 Bypass Register (SDBPR) SDBPR is a 1-bit shift register. In BYPASS, CLAMP, or HIGHZ mode, SDBPR is connected between the ETDI and ETDO pins. 26.3.3 Boundary Scan Register (SDBSR) SDBSR is a shift register provided on the PAD for controlling the I/O pins of this LSI. Using EXTEST mode or SAMPLE/PRELOAD mode, a boundary scan test conforming to the IEEE1149.1 standard can be performed. Table 26.
Section 26 Boundary Scan (JTAG) Table 26.3 Correspondence between Pins and Boundary Scan Register (H8S/2472 Group) Pin No. Pin Name Input/Output Bit No. from ETDI A1 C3 B1 C2 D3 C1 D2 E4 D1 VCC P45 P46 P47 P56 P57 VSS RES MD1 Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No. N1 M4 N2 P1 P2 R1 N3 R2 P3 N4 PA6 PA5 VCC PA4 PA3 NC PA2 NC PA1 NC Input 267 Enable Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No. M11 R12 P12 N12 R13 M12 P13 R14 P14 R15 PD0 NC AVSS P70 P71 P72 P73 P74 P75 P76 Input 177 Enable Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No. L15 K12 K13 K15 K14 J12 J13 J15 J14 H12 P67 VCC DrVCC USD- USD+ Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No. F14 E13 E15 E14 E12 D15 D14 D13 C15 D12 P26 P25 P24 P23 P22 P21 P20 P17 P16 P15 Input 129 Enable Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No. B7 D6 C6 A6 B6 C5 A5 B5 D5 P53 FWE P54 P55 P44 VCC UXTAL UEXTAL UXSEL Input 21 Enable Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Table 26.4 Correspondence between Pins and Boundary Scan Register (H8S/2462 Group and H8S/2463 Group) Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No. 20 21 22 23 24 25 26 27 28 29 P94 P93 P92 P91 P90 PC7 PC6 PC5 PC4 PC3 Input 296 Enable Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No. 60 61 62 63 64 65 66 67 68 69 PD6 PD5 PD4 PD3 PD2 PD1 PD0 AVSS P70 P71 Input 182 Enable Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No. 100 101 102 103 104 105 106 107 108 109 P22 P21 P20 P17 P16 P15 P14 P13 P12 P11 Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No.
Section 26 Boundary Scan (JTAG) Pin No. Pin Name Input/Output Bit No. 140 141 142 143 144 P44 VSS RESO XTAL EXTAL Input 2 Enable 1 Output 0 to ETDO Rev. 2.00 Aug.
Section 26 Boundary Scan (JTAG) 26.3.4 ID Code Register (SDIDR) SDIDR is a 32-bit register. In IDCODE mode, SDIDR can output a fixed code, H'0803D447, from the ETDO pin. However, no serial data can be written to SDIDR via the ETDI pin. 31 28 27 0000 1000 Version (4 bits) 12 0000 0011 Part Number (16 bits) Rev. 2.00 Aug.
Section 26 Boundary Scan (JTAG) 26.4 Operation 26.4.1 TAP Controller State Transitions Figure 26.2 shows the internal states of the TAP controller. State transitions basically conform to the IEEE1149.1 standard. 1 Test-logic-reset 0 0 1 1 Run-test/idle 1 Select-DR-scan 0 Select-IR-scan 0 1 1 Capture-DR 0 Shift-DR 1 Exit1-DR 0 Pause-DR 1 0 Capture-IR 0 0 Shift-IR 1 1 Exit1-IR 0 0 Pause-IR 1 0 1 0 0 Exit2-DR 1 Exit2-IR 1 Update-DR 1 0 Update-IR 1 0 Figure 26.
Section 26 Boundary Scan (JTAG) 26.4.2 JTAG Reset The JTAG can be reset in two ways. • The JTAG is reset when the ETRST pin is held at 0. • When ETRST = 1, the JTAG can be reset by inputting at least five ETCK clock cycles while ETMS = 1. 26.5 Boundary Scan The JTAG pins can be placed in the boundary scan mode stipulated by the IEEE1149.1 standard by setting a command in SDIR. 26.5.1 Supported Instructions This LSI supports the three essential instructions defined in the IEEE1149.
Section 26 Boundary Scan (JTAG) In a PRELOAD operation, an initial value is set in the parallel output latch of the boundary scan register from the scan path prior to the EXTEST instruction. Without a PRELOAD operation, when the EXTEST instruction was executed an undefined value would be output from the output pin until completion of the initial scan sequence (transfer to the output latch) (with the EXTEST instruction, the parallel output latch value is constantly output to the output pin).
Section 26 Boundary Scan (JTAG) (6) IDCODE (Instruction code: B'1110) When the IDCODE instruction is enabled, the value of the ID code register is output from the ETDO pin with LSB first when the TAP controller is in the Shift-DR state. While the IDCODE instruction is being executed, the test circuit does not affect the system circuit. When the TAP controller is in the Test-Logic-Reset state, the instruction register is initialized to the IDCODE instruction. Notes: 1.
Section 26 Boundary Scan (JTAG) 26.6 Usage Notes 1. A reset must always be executed by driving the ETRST pin to 0, regardless of whether or not the JTAG is to be activated. The ETRST pin must be held low for 20 ETCK clock cycles. For details, see section 31, Electrical Characteristics. To activate the JTAG after a reset, drive the ETRST pin to 1 and specify the ETCK, ETMS, and ETDI pins to any value.
Section 26 Boundary Scan (JTAG) 3. The registers are not initialized in standby mode. If the ETRST pin is set to 0 in standby mode, IDCODE mode will be entered. 4. The frequency of the ETCK pin must be lower than that of the system clock. For details, see section 31, Electrical Characteristics. 5. Data input/output in serial data transfer starts from the LSB. Figure 26.4 and 26.5 shows examples of serial data input/output. 6.
Section 26 Boundary Scan (JTAG) SDIDR serial data input/output SDIDR is captured into the shift register in Capture-DR in IDCODE mode, and bits 0 to 31 of SDIDR are output in that order from the ETDO pin in Shift-DR. Data input from the ETDI pin is not written to any register in Update-DR. ETDI Shift register Bit 31 . . . . Bit 0 ETDO Bit 31 SDIDR Bit 0 Capture-DR Figure 26.5 Serial Data Input/Output (2) Rev. 2.00 Aug.
Section 26 Boundary Scan (JTAG) Rev. 2.00 Aug.
Section 27 Clock Pulse Generator Section 27 Clock Pulse Generator This LSI incorporates a clock pulse generator which generates the system clock (φ), internal clock, bus master clock, and subclock (φSUB). The clock pulse generator consists of an oscillator, PLL multiplier circuit, system clock select circuit, medium-speed clock divider, bus master clock select circuit, subclock input circuit, and subclock waveform shaping circuit. Figure 27.1 shows a block diagram of the clock pulse generator.
Section 27 Clock Pulse Generator 27.1 Oscillator Clock pulses can be supplied either by connecting a crystal resonator or by providing external clock input. 27.1.1 Connecting Crystal Resonator Figure 27.2 shows a typical method of connecting a crystal resonator. An appropriate damping resistance Rd, given in table 27.1, should be used. An AT-cut parallel-resonance crystal resonator should be used. Figure 27.3 shows the equivalent circuit of a crystal resonator.
Section 27 Clock Pulse Generator Table 27.2 Crystal Resonator Parameters Frequency (MHz) 5 8 8.5 RS (max) (Ω) 100 80 70 C0 (max) (pF) 7 7 7 27.1.2 External Clock Input Method Figure 27.4 shows a typical method of connecting an external clock signal. To leave the XTAL pin open, incidental capacitance should be 10 pF or less. To input an inverted clock to the XTAL pin, the external clock should be tied to high in standby mode.
Section 27 Clock Pulse Generator 27.2 PLL Multiplier Circuit The PLL multiplier circuit generates a clock of 4 times the frequency of its input clock. The frequency range of the multiplied clock is shown in table 27.3. Table 27.3 Ranges of Multiplied Clock Frequency Crystal Resonator, External Clock 27.3 Input Clock (MHz) Multiplier System Clock (MHz) 5 to 8.
Section 27 Clock Pulse Generator 27.7 Clock Select Circuit The clock select circuit selects the system clock that is used in this LSI. A clock generated by the oscillator, to which the EXTAL and XTAL pins are input, and multiplied by the PLL circuit is selected as a system clock when returning from high-speed mode, mediumspeed mode, sleep mode, the reset state, or standby mode. Rev. 2.00 Aug.
Section 27 Clock Pulse Generator 27.8 Usage Notes 27.8.1 Note on Resonator Since all kinds of characteristics of the resonator are closely related to the board design by the user, use the example of resonator connection in this document for only reference; be sure to use an resonator that has been sufficiently evaluated by the user. Consult with the resonator manufacturer about the resonator circuit ratings which vary depending on the stray capacitances of the resonator and installation circuit.
Section 28 Power-Down Modes Section 28 Power-Down Modes For operating modes after the reset state is cancelled, this LSI has not only the normal program execution state but also four power-down modes in which power consumption is significantly reduced. In addition, there is also module stop mode in which reduced power consumption can be achieved by individually stopping on-chip peripheral modules.
Section 28 Power-Down Modes 28.1 Register Descriptions Power-down modes are controlled by the following registers. To access SBYCR, LPWRCR, MSTPCRH, and MSTPCRL, the FLSHE bit in the serial timer control register (STCR) must be cleared to 0. For details on STCR, see section 3.2.3, Serial Timer Control Register (STCR).
Section 28 Power-Down Modes Bit Bit Name Initial Value R/W Description 6 STS2 0 R/W Standby Timer Select 2 to 0 5 STS1 0 R/W 4 STS0 0 R/W Select the wait time for clock settling from clock oscillation start when canceling software standby mode. Select a wait time of 8 ms (oscillation settling time) or more, depending on the operating frequency. With an external clock, select a wait time of 500 µs (external clock output settling delay time) or more, depending on the operating frequency.
Section 28 Power-Down Modes Table 28.1 Operating Frequency and Wait Time STS2 STS1 STS0 Wait Time 20MHz 25MHz 34MHz Unit 0 0 0 8192 states 0.4 0.3 0.2 ms 0 0 1 16384 states 0.8 0.7 0.5 0 1 0 32768 states 1.6 1.3 1.0 0 1 1 65536 states 3.3 2.6 1.9 1 0 0 131072 states 6.6 5.2 3.9 1 0 1 262144 states 13.1 10.5 7.7 1 1 x Reserved* Recommended specification Note: * Setting prohibited. [Legend] x: Don't care Rev. 2.00 Aug.
Section 28 Power-Down Modes 28.1.2 Low-Power Control Register (LPWRCR) LPWRCR controls power-down modes. Bit Bit Name Initial Value R/W Description 7, 6 0 R/W Reserved The initial value should not be changed. 5 NESEL 0 R/W Noise Elimination Sampling Frequency Select Selects the frequency by which the subclock (φSUB) input from the EXCL pin is sampled using the clock (φ) generated by the system clock pulse generator.
Section 28 Power-Down Modes 28.1.3 Module Stop Control Registers H, L, and A (MSTPCRH, MSTPCRL, MSTPCRA) MSTPCR specifies on-chip peripheral modules to shift to module stop mode in module units. Each module can enter module stop mode by setting the corresponding bit to 1.
Section 28 Power-Down Modes • MSTPCRA Initial Value R/W Corresponding Module 7 to 3 MSTPA7 to MSTPA3 All 0 R/W Reserved 2 MSTPA2 0 R/W 14-bit PWM timer (PWMX_1) 1 MSTPA1 0 R/W 14-bit PWM timer (PWMX_0) 0 MSTPA0 0 R/W Reserved Bit Bit Name The initial values should not be changed. The initial value should not be changed.
Section 28 Power-Down Modes 28.1.4 Sub-Chip Module Stop Control Registers BH, BL (SUBMSTPBH, SUBMSTPBL) SUBMSTPB specifies on-chip peripheral modules to shift to module stop mode in module units. Each module can enter module stop mode by setting the corresponding bit to 1. • SUBMSTPBH Bit Bit Name Initial Value R/W 7 SMSTPB15 1 R/W Corresponding Module Reserved The initial values should not be changed.
Section 28 Power-Down Modes 28.2 Mode Transitions and LSI States Figure 28.1 shows the enabled mode transition diagram. The mode transition from program execution state to program halt state is performed by the SLEEP instruction. The mode transition from program halt state to program execution state is performed by an interrupt. The STBY input causes a mode transition from any state to hardware standby mode.
Section 28 Power-Down Modes Table 28.
Section 28 Power-Down Modes 28.3 Medium-Speed Mode The CPU makes a transition to medium-speed mode as soon as the current bus cycle ends according to the setting of the SCK2 to SCK0 bits in SBYCR. In medium-speed mode, the CPU operates on the operating clock (φ/2, φ/4, φ/8, φ/16, or φ/32) specified by the SCK2 to SCK0 bits. The bus masters other than the CPU (DTC) also operate in medium-speed mode when the DTSPEED bit in SBYCR is cleared to 0.
Section 28 Power-Down Modes Medium-speed mode φ, peripheral module clock Bus master clock Internal address bus SBYCR SBYCR Internal write signal Figure 28.2 Medium-Speed Mode Timing 28.4 Sleep Mode The CPU makes a transition to sleep mode if the SLEEP instruction is executed when the SSBY bit in SBYCR is cleared to 0. In sleep mode, CPU operation stops but the peripheral modules do not stop. The contents of the CPU's internal registers are retained.
Section 28 Power-Down Modes 28.5 Software Standby Mode The CPU makes a transition to software standby mode when the SLEEP instruction is executed with the SSBY bit in SBYCR set to 1 and the PSS bit in TCSR (WDT_1) cleared to 0. In software standby mode, the CPU, on-chip peripheral modules, and clock pulse generator all stop.
Section 28 Power-Down Modes Oscillator φ NMI NMIEG SSBY NMI exception Software standby mode handling (power-down mode) NMIEG = 1 SSBY = 1 SLEEP instruction Oscillation stabilization time tOSC2 NMI exception handling Figure 28.3 Software Standby Mode Application Example Rev. 2.00 Aug.
Section 28 Power-Down Modes 28.6 Hardware Standby Mode The CPU makes a transition to hardware standby mode from any mode when the STBY pin is driven low. In hardware standby mode, all functions enter the reset state. As long as the prescribed voltage is supplied, on-chip RAM data is retained. The I/O ports are set to the high-impedance state. In order to retain on-chip RAM data, the RAME bit in SYSCR should be cleared to 0 before driving the STBY pin low.
Section 28 Power-Down Modes 28.7 Module Stop Mode Module stop mode can be individually set for each on-chip peripheral module. When the corresponding MSTP bit in MSTPCR and SUBMSTP is set to 1, module operation stops at the end of the bus cycle and a transition is made to module stop mode. In turn, when the corresponding MSTP bit is cleared to 0, module stop mode is cancelled and the module operation resumes at the end of the bus cycle.
Section 29 List of Registers Section 29 List of Registers The register list gives information on the on-chip I/O register addresses, how the register bits are configured, and the register states in each operating mode. The information is given as shown below. 1. Register Addresses (address order) • Registers are listed from the lower allocation addresses. • The MSB-side address is indicated for 16-bit and 32-bit addresses. • Registers are classified by functional modules. • The access size is indicated. 2.
Section 29 List of Registers 29.1 Register Addresses (Address Order) The data bus width indicates the numbers of bits by which the register is accessed. The number of access states indicates the number of states based on the specified reference clock. Note: Access to undefined or reserved addresses is prohibited. Since operation or continued operation is not guaranteed when these registers are accessed, do not attempt such access.
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address Automatic PAUSE frame retransmission count set register TPAUSER 32 H'F964 EtherC 16 8 E-DMAC mode register EDMR 32 H'F980 E-DMAC 16 8 E-DMAC transmit request register EDTRR 32 H'F984 E-DMAC 16 8 E-DMAC receive request register EDRRR 32 H'F988 E-DMAC 16 8 Transmit descriptor list address register TDLAR 32 H'F98C E-DMAC 16 8 Receive descriptor l
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address Interrupt flag register 1 IFR1 8 H'FA01 USB 16 4 Interrupt flag register 2 IFR2 8 H'FA02 USB 16 4 Interrupt enable register 0 IER0 8 H'FA04 USB 16 4 Interrupt enable register 1 IER1 8 H'FA05 USB 16 4 Interrupt enable register 2 IER2 8 H'FA06 USB 16 4 Interrupt select register 0 ISR0 8 H'FA08 USB 16 4 Interrupt select register 1 ISR1 8
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address Divisor latch L FDLL 8 H'FC80 SCIF 16 2 Interrupt enable register FIER 8 H'FC81 SCIF 16 2 Divisor latch H FDLH 8 H'FC81 SCIF 16 2 Interrupt identification register FIIR 8 H'FC82 SCIF 16 2 FIFO control register FFCR 8 H'FC82 SCIF 16 2 Line control register FLCR 8 H'FC83 SCIF 16 2 Modem control register FMCR 8 H'FC84 SCIF 16 2 Line
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address BT control/status register 0 BTCSR0 8 H'FD04 LPC 16 2 BT control/status register 1 BTCSR1 8 H'FD05 LPC 16 2 BT control register BTCR 8 H'FD06 LPC 16 2 BT interrupt mask register BTIMSR 8 H'FD07 LPC 16 2 SMIC flag register SMICFLG 8 H'FD08 LPC 16 2 Host interface control register 5 HICR5 8 H'FD09 LPC 16 2 SMIC control/status register SM
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address Output data register 3 ODR3 8 H'FD21 LPC 16 2 Status register 3 STR3 8 H'FD22 LPC 16 2 SERIRQ control register 4 SIRQCR4 8 H'FD23 LPC 16 2 LPC channel 3 address register H LADR3H 8 H'FD24 LPC 16 2 LPC channel 3 address register L LADR3L 8 H'FD25 LPC 16 2 SERIRQ control register 0 SIRQCR0 8 H'FD26 LPC 16 2 SERIRQ control register 1 SIRQ
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address Event count status register ECS 16 H'FE40 EVC 16 2 Event count control register ECCR 8 H'FE42 EVC 8 2 Module stop control register A MSTPCRA 8 H'FE43 SYSTEM 8 2 Noise canceler enable register P3NCE 8 H'FE44 PORT 8 2 Noise canceler mode control register P3NCMC 8 H'FE45 PORT 8 2 Noise canceler cycle setting register NCCS 8 H'FE46 PORT 8 2
Section 29 List of Registers Module Data Bus Width Number of Access States H'FE93 IIC_4 8 2 H'FE93 IIC_4 8 2 Abbreviation Number of Bits Address I C bus mode register_4 ICMR_4 8 Slave address register_4 SAR_4 8 Register Name 2 2 I C bus control register_5 ICCR_5 8 H'FE94 IIC_5 8 2 I2C bus status register_5 ICSR_5 8 H'FE95 IIC_5 8 2 I2C bus data register_5 ICDR_5 8 H'FE96 IIC_5 8 2 Second slave address register_5 SARX_5 8 H'FE96 IIC_5 8 2 I C bus mode registe
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address Port 6 pull-up MOS control register P6PCR 8 H'FEBC PORT 8 2 Pin function control register PINFNCR 8 H'FEBE PORT 8 2 Port 4 pull-up MOS control register P4PCR 8 H'FEBF PORT 8 2 I2C bus control register_3 ICCR_3 8 H'FEC0 IIC_3 8 2 2 ICSR_3 8 H'FEC1 IIC_3 8 2 2 I C bus data register_3 ICDR_3 8 H'FEC2 IIC_3 8 2 Second slave address registe
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address Keyboard comparator control register KBCOMP 8 H'FEE4 EVC 8 2 DTC enable register F DTCERF 8 H'FEE6 DTC 8 2 Interrupt control register D ICRD 8 H'FEE7 INT 8 2 Interrupt control register A ICRA 8 H'FEE8 INT 8 2 Interrupt control register B ICRB 8 H'FEE9 INT 8 2 Interrupt control register C ICRC 8 H'FEEA INT 8 2 IRQ status register ISR 8
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address System control register 2 SYSCR2 8 H'FF83 SYSTEM 8 2 Standby control register SBYCR 8 H'FF84 SYSTEM 8 2 Low power control register LPWRCR 8 H'FF85 SYSTEM 8 2 Module stop control register H MSTPCRH 8 H'FF86 SYSTEM 8 2 Module stop control register L MSTPCRL 8 H'FF87 SYSTEM 8 2 2 ICCR_1 8 H'FF88 IIC_1 8 2 2 ICSR_1 8 H'FF89 IIC_1 8 2
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address Port A output data register PAODR 8 H'FFAA PORT 8 2 Port A input data register PAPIN 8 H'FFAB PORT 8 2 Port A data direction register PADDR 8 H'FFAB PORT 8 2 Port 1 pull-up MOS control register P1PCR 8 H'FFAC PORT 8 2 Port 2 pull-up MOS control register P2PCR 8 H'FFAD PORT 8 2 Port 3 pull-up MOS control register P3PCR 8 H'FFAE PORT 8 2
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address Bus control register BCR 8 H'FFC6 BSC 8 2 Wait state control register WSCR 8 H'FFC7 BSC 8 2 Timer control register_0 TCR_0 8 H'FFC8 TMR_0 8 2 Timer control register_1 TCR_1 8 H'FFC9 TMR_1 8 2 Timer control/status register_0 TCSR_0 8 H'FFCA TMR_0 8 2 Timer control/status register_1 TCSR_1 8 H'FFCB TMR_1 8 2 Time constant register A_0 TC
Section 29 List of Registers Module Data Bus Width Number of Access States Register Name Abbreviation Number of Bits Address Timer control register_X TCR_X 8 H'FFF0 TMR_X 8 2 Timer control/status register_X TCSR_X 8 H'FFF1 TMR_X 8 2 Timer counter_X TCNT_X 8 H'FFF4 TMR_X 8 2 Time constant register A_X TCORA_X 8 H'FFF6 TMR_X 8 2 Time constant register B_X TCORB_X 8 H'FFF7 TMR_X 8 2 Timer control register_Y TCR_Y 8 H'FFF0 TMR_Y 8 2 Timer control/status register_
Section 29 List of Registers 29.2 Register Bits Register addresses and bit names of the on-chip peripheral modules are described below. Each line covers eight bits, so 16-bit and 32-bit registers are shown as 2 lines and 4 lines, respectively.
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module RFLR EtherC RFL11 RFL10 RFL9 RFL8 RFL7 RFL6 RFL5 RFL4 RFL3 RFL2 RFL1 RFL0 LMON TROC31 TROC30 TROC29 TROC28 TROC27 TROC26 TROC25 TROC24 TROC23 TROC22 TROC21 TROC20 TROC19 TROC18 TROC17 TROC16 TROC15 TROC14 TROC
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module TSFRCR TSFC31 TSFC30 TSFC29 TSFC28 TSFC27 TSFC26 TSFC25 TSFC24 EtherC TSFC23 TSFC22 TSFC21 TSFC20 TSFC19 TSFC18 TSFC17 TSFC16 TSFC15 TSFC14 TSFC13 TSFC12 TSFC11 TSFC10 TSFC9 TSFC8 TSFC7 TSFC6 TSFC5 TSFC4 TSFC3 TSFC2 TSFC1 TSFC0 TLFC31 TLFC30 TLFC29 TLFC28 TLFC27 TLFC26 TLFC25 TLFC24 TLFC23 TLFC22 TLFC21 TLFC20 TLFC19 TLFC18 TLFC17 TLFC16 TLFC1
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module EDMR E-DMAC DE DL1 DL0 SWR TR RR TDLA31 TDLA30 TDLA29 TDLA28 TDLA27 TDLA26 TDLA25 TDLA24 TDLA23 TDLA22 TDLA
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module RMFCR E-DMAC TFTR FDR RMCR FCFTR TRIMD RBWAR RDFAR MFC15 MFC14 MFC13 MFC12 MFC11 MFC10 MFC9 MFC8 MFC7 MFC6 MFC5 MFC4 MFC3 MFC2 MFC1 MFC0 TFT10 TFT9 TFT8 TFT7 TFT6 TFT5 TFT4 TFT3 TFT2 TFT1 TFT0
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module TBRAR TBRA31 TBRA30 TBRA29 TBRA28 TBRA27 TBRA26 TBRA25 TBRA24 E-DMAC TBRA23 TBRA22 TBRA21 TBRA20 TBRA19 TBRA18 TBRA17 TBRA16 TBRA15 TBRA14 TBRA13 TBRA12 TBRA11 TBRA10 TBRA9 TBRA8 TBRA7 TBRA6 TBRA5 TBRA4 TBRA3 TBRA2 TBRA1 TBRA0 TDFA31 TDFA30 TDFA29 TDFA28 TDFA27 TDFA26 TDFA25 TDFA24 TDFA23 TDFA22 TDFA21 TDFA20 TDFA19 TDFA18 TDFA17 TDFA16 TDFA15
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module CTLR RWUPS RSME ASCE USB EPIR D7 D6 D5 D4 D3 D2 D1 D0 TRNTREG0 PTSTE SUSPEND txenl Txse0 Txdata TRNTREG1 xver_data dpls dmns FRBR bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 FTHR bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 FDLL bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 FIER EDS
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module SSRDR1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 SSU SSRDR2 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 SSRDR3 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 SSTRSR bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 HICR4 LADR12SEL SWENBL KCSENBL SMCENBL BTENBL BTSR0 FRDI HRDI HWRI HBTWI HBTRI BTSR1 HRSTI IRQCRI BEVTI B2HI H2BI CRRPI CRWPI
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module TWR8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 LPC TWR9 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 TWR10 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 TWR11 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 TWR12 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 TWR13 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 TWR14 bit 7
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module SIRQCR2 IEDIR3 LPC BTDTR bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 BTFVSR0 N7 N6 N5 N4 N3 N2 N1 N0 BTFVSR1 N7 N6 N5 N4 N3 N2 N1 N0 LADR12H bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 LADR12L bit 7 bit 6 bit 5 bit 4 bit 3 bit 1 bit 0 SCIFADRH bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 SCI
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module FCCS FWE FLER WEINTE SCO FLASH FPCS PPVS FECS EPVB FKEY K7 K6 K5 K4 K3 K2 K1 K0 FMATS MS7 MS6 MS5 MS4 MS3 MS2 MS1 MS0 FTDAR TDER TDA6 TDA5 TDA4 TDA3 TDA2 TDA1 TDA0 ICCR_4 ICE IEIC MST TRS ACKE BBSY IRIC SCP ICSR_4 ESTP STOP IRTR AASX AL AAS ADZ ACKB ICDR_4 bit 7 bit 6 bit 5 bit 4
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module ADDRA AD9 AD8 AD7 AD6 AD5 AD4 AD3 AD2 ADC AD1 AD0 AD9 AD8 AD7 AD6 AD5 AD4 AD3 AD2 AD1 AD0 AD9 AD8 AD7 AD6 AD5 AD4 AD3 AD2 AD1 AD0 AD9 AD8 AD7 AD6 AD5 AD4 AD3 AD2 AD1 AD0 AD9 AD8 AD7 AD6 AD5 AD4 AD3 AD2 AD1 AD0 AD9 AD8 AD7 AD6 AD5 AD4 AD3 AD2 AD1
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module ICMR_3 MLS WAIT CKS2 CKS1 CKS0 BC2 BC1 BC0 IIC_3 SAR_3 SVA6 SVA5 SVA4 SVA3 SVA2 SVA1 SVA0 FS ICCR_2 ICE IEIC MST TRS ACKE BBSY IRIC SCP ICSR_2 ESTP STOP IRTR AASX AL AAS ADZ ACKB ICDR_2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 SARX_2 SVAX6 SVAX5 SVAX4 SVAX3 SVAX2 SVAX1 SVAX0 FSX ICMR_2 MLS WAIT CKS2 CKS1 CKS0 BC2 BC1 BC0 S
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module ICRD ICRD7 ICRD6 ICRD5 ICRD2 ICRD1 ICRD0 INT ICRA ICRA7 ICRA6 ICRA5 ICRA4 ICRA3 ICRA2 ICRA1 ICRA0 ICRB ICRB7 ICRB6 ICRB4 ICRB3 ICRB2 ICRB1 ICRB0 ICRC ICRC7 ICRC6 ICRC5 ICRC4 ICRC3 ICRC2 ICRC1 ICRC0 ISR IRQ7F IRQ6F IRQ5F IRQ4F IRQ3F IRQ2F IRQ1F IRQ0F ISCRH IRQ7SCB IRQ7SCA IRQ6SCB IRQ6SCA IRQ5SCB IRQ5SCA IRQ4SCB IRQ4SCA ISCRL IRQ3SCB
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module MSTPCRL MSTP7 MSTP6 MSTP5 MSTP4 MSTP3 MSTP2 MSTP1 MSTP0 SYSTEM ICCR_1 ICE IEIC MST TRS ACKE BBSY IRIC SCP IIC_1 ICSR_1 ESTP STOP IRTR AASX AL AAS ADZ ACKB ICDR_1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 SARX_1 SVAX6 SVAX5 SVAX4 SVAX3 SVAX2 SVAX1 SVAX0 FSX ICMR_1 MLS WAIT CKS2 CKS1 CKS0 BC2 BC1 BC0 SAR_1 SVA6 SVA5 SVA4 SVA3 SV
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module PAODR PA7ODR PA6ODR PA5ODR PA4ODR PA3ODR PA2ODR PA1ODR PA0ODR PORT PAPIN PA7PIN PA6PIN PA5PIN PA4PIN PA3PIN PA2PIN PA1PIN PA0PIN PADDR PA7DDR PA6DDR PA5DDR PA4DDR PA3DDR PA2DDR PA1DDR PA0DDR P1PCR P17PCR P16PCR P15PCR P14PCR P13PCR P12PCR P11PCR P10PCR P2PCR P27PCR P26PCR P25PCR P24PCR P23PCR P22PCR P21PCR P20PCR P3PCR P37PCR P36PCR P35PCR P34
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module BCR ICIS BRSTRM BRSTS1 BRSTS0 IOS1 IOS0 BSC WSCR ABW256 AST256 ABW AST WMS1 WMS0 WC1 WC0 TCR_0 CMIEB CMIEA OVIE CKS2 CKS1 CKS0 TCR_1 CMIEB CMIEA OVIE CKS2 CKS1 CKS0 TCSR_0 CMFB CMFA OVF ADTE TCSR_1 CMFB CMFA OVF TCORA_0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 TCORA_1 bit 7 bit 6 bit 5 bit
Section 29 List of Registers Register Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module TCNT_X bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 TMR_X,Y TCORA_X bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 TCORB_X bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 TCR_Y CMIEB CMIEA OVIE CKS2 CKS1 CKS0 TCSR_Y CMFB CMFA OVF TCORA_Y bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 TCORB_Y bit 7 bit 6 bit 5 bit 4
Section 29 List of Registers 29.
Section 29 List of Registers Register Software Hardware WDT Reset High-Speed/ Medium-Speed Sleep Module Stop Standby Standby Module Initialized Initialized Initialized E-DMAC Initialized Initialized Initialized TRSCER Initialized Initialized Initialized RMFCR Initialized Initialized Initialized TFTR Initialized Initialized Initialized FDR Initialized Initialized Initialized RMCR Initialized Initialize
Section 29 List of Registers Register Software Hardware Abbreviation Reset WDT Reset High-Speed/ Medium-Speed Sleep Module Stop Standby Standby Module EPSZ0o Initialized Initialized Initialized USB EPSZ1 Initialized Initialized Initialized DASTS Initialized Initialized Initialized FCLR Initialized Initialized Initialized EPSTL Initialized Initialized Initialized TRG Initialized Initialized Initialize
Section 29 List of Registers Register Software Hardware Abbreviation Reset WDT Reset High-Speed/ Medium-Speed Sleep Module Stop Standby Standby Module SSSR Initialized Initialized Initialized SSU SSCR2 Initialized Initialized Initialized SSTDR0 Initialized Initialized Initialized SSTDR1 Initialized Initialized Initialized SSTDR2 Initialized Initialized Initialized SSTDR3 Initialized Initialized Initi
Section 29 List of Registers Register Software Hardware Abbreviation Reset WDT Reset High-Speed/ Medium-Speed Sleep Module Stop Standby Standby Module TWR3 LPC TWR4 TWR5 TWR6 TWR7 TWR8 TWR9 TWR10 TWR11 TWR12 TWR13 TWR14 TWR15
Section 29 List of Registers Register Abbreviation High-Speed/ Reset Software Hardware WDT Reset Medium-Speed Sleep Module Stop Standby Standby Module LPC HICR0 Initialized Initialized Initialized HICR1 Initialized Initialized Initialized HICR2 Initialized Initialized Initialized HICR3 SIRQCR2 Initialized Initialized Initialized BTDTR Initialized BTFVSR0 Initialized Initialized
Section 29 List of Registers Register Software Hardware Abbreviation Reset WDT Reset High-Speed/ Medium-Speed Sleep Module Stop Standby Standby Module PCPIN PORT PCDDR Initialized Initialized Initialized PDPIN PDDDR Initialized Initialized Initialized FCCS Initialized Initialized Initialized FPCS Initialized Initialized Initialized FECS Initialized Initialized Initialized
Section 29 List of Registers Register Software Hardware Abbreviation Reset WDT Reset High-Speed/ Medium-Speed Sleep Module Stop Standby Standby Module ADDRA Initialized Initialized Initialized Initialized Initialized ADC ADDRB Initialized Initialized Initialized Initialized Initialized ADDRC Initialized Initialized Initialized Initialized Initialized ADDRD Initialized Initialized Initialized Initialized Initialized ADDRE Initialized Initialized
Section 29 List of Registers Register Software Hardware Abbreviation Reset WDT Reset High-Speed/ Medium-Speed Sleep Module Stop Standby Standby Module DADRA_1 Initialized Initialized Initialized Initialized Initialized PWMX_1 DACR_1 Initialized Initialized Initialized Initialized Initialized DADRB_1 Initialized Initialized Initialized Initialized Initialized DACNT_1 Initialized Initialized Initialized Initialized Initialized CRCCR Initialized I
Section 29 List of Registers Register Software Hardware Abbreviation Reset WDT Reset High-Speed/ Medium-Speed Sleep Module Stop Standby Standby Module ABRKCR Initialized Initialized Initialized INT BARA Initialized Initialized Initialized BARB Initialized Initialized Initialized BARC Initialized Initialized Initialized IER16 Initialized Initialized Initialized ISR16 Initialized Initialized Initialize
Section 29 List of Registers Register Software Hardware Abbreviation Reset WDT Reset High-Speed/ Medium-Speed Sleep Module Stop Standby Standby Module TCR Initialized Initialized Initialized FRT TOCR Initialized Initialized Initialized OCRAR Initialized Initialized Initialized OCRAF Initialized Initialized Initialized DADRA_0 Initialized Initialized Initialized Initialized Initialized DACR_0 Initialized Initialized
Section 29 List of Registers Register Software Hardware Abbreviation Reset WDT Reset High-Speed/ Medium-Speed Sleep Module Stop Standby Standby Module PBPIN PORT P8DDR Initialized Initialized Initialized P7PIN PBDDR Initialized Initialized Initialized P8DR Initialized Initialized Initialized P9DDR Initialized Initialized Initialized P9DR Initialized Initialized Initialized
Section 29 List of Registers Register Software Hardware Abbreviation Reset WDT Reset High-Speed/ Medium-Speed Sleep Module Stop Standby Standby Module SMR_3 Initialized Initialized Initialized SCI_3 BRR_3 Initialized Initialized Initialized SCR_3 Initialized Initialized Initialized TDR_3 Initialized Initialized Initialized Initialized Initialized SSR_3 Initialized Initialized Initialized Initialized Initialized RDR_3 Init
Section 30 Platform Environment Control Interface (PECI) Section 30 Platform Environment Control Interface (PECI) Renesas Technology Corporation is only able to provide information contained in this section to the parties with which we have concluded a nondisclosure agreement. Please contact one of our sales representatives for details. If this module is not used, the PECI-related pins should be handled as follows. PECI is not supported by the H8S/2463 Group. • Connect the PEVref pin to VSS.
Section 30 Platform Environment Control Interface (PECI) Rev. 2.00 Aug.
Section 31 Electrical Characteristics Section 31 Electrical Characteristics 31.1 Absolute Maximum Ratings Table 31.1 lists the absolute maximum ratings. Table 31.1 Absolute Maximum Ratings Item Symbol Power supply voltage* Value Unit VCC, DrVCC –0.3 to +4.3 V Input voltage (pins multiplexed with analog input) (1) Vin –0.3 to AVCC + 0.3 Input voltage (pins multiplexed with IIC functions) (2) Vin –0.3 to +6.5 Input voltage (pins other than (1) and (2) above) Vin –0.3 to VCC + 0.
Section 31 Electrical Characteristics 31.2 DC Characteristics Table 31.2 lists the DC characteristics. Table 31.3 lists the permissible output currents. Table 31.4 lists the bus drive characteristics. Table 31.2 DC Characteristics (1) 1 Conditions: VCC = 3.0 V to 3.6 V, AVCC* = 3.0 V to 3.6 V, DrVCC = 3.0 V to 3.6 V, 1 1 AVref* = 3.0 V to AVCC, VSS = AVSS* = DrVSS = 0 V Symbol Min. Typ. Max.
Section 31 Electrical Characteristics Item Input RES, STBY, NMI, FWE, MD2, low MD1 voltage EXTAL (3) Test Unit Conditions Symbol Min. Typ. Max. VIL –0.3 VCC × 0.1 –0.3 VCC × 0.1 f > 25 MHz f ≤ 25 MHz –0.3 VCC × 0.2 Port 7 –0.3 AVCC × 0.2 CLKRUN, GA20, PME, LSMI, LSCI, SERIRQ, LAD3 to LAD0, LPCPD, LCLK, LRESET, LFRAME –0.3 VCC × 0.3 RM_REF-CLK, RM_CRS-DV, RM_RXD0, RM_RXD1, RM_RX-ER –0.3 0.8 Input pins other than (1) and (3) above –0.3 VCC × 0.
Section 31 Electrical Characteristics Table 31.2 DC Characteristics (2) 1 Conditions: VCC = 3.0 V to 3.6 V, AVCC* = 3.0 V to 3.6 V, DrVCC = 3.0 V to 3.6 V, 1 1 AVref* = 3.0 V to AVCC, VSS = AVSS* = DrVSS = 0 V Test Symbol Min. Typ. Max. Unit Conditions Item Input leakage RES, STBY, NMI, FWE, current MD2, MD1 Iin 1.0 1.0 VIN = 0.5 to AVCC – 0.5 V 1.0 VIN = 0.5 to VCC – 0.
Section 31 Electrical Characteristics 4. Supply current values are for VIH min = VCC – 0.2 V and VIL max = 0.2 V with all output pins unloaded and the on-chip pull-up MOSs in the off state. 5. When VCC = 3.0 V, VIH min = VCC – 0.2 V, and VIL max = 0.2 V. Table 31.3 Permissible Output Currents Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, DrVCC = 3.0 V to 3.6 V, 1 1 AVref* = 3.0 V to AVCC, VSS = AVSS* = DrVSS = 0 V Item Symbol Min.
Section 31 Electrical Characteristics This LSI 600 Ω HC0 to HC7 LED Figure 31.2 LED Drive Circuit (Example) Rev. 2.00 Aug.
Section 31 Electrical Characteristics 31.3 AC Characteristics Figure 31.3 shows the test conditions for the AC characteristics. 3V C = 30pF : All ports RL = 2.4 kΩ RH = 12 kΩ RL LSI output pin C I/O timing test levels • Low level : 0.8 V • High level : 1.5 V RH Figure 31.3 Output Load Circuit 31.3.1 Clock Timing Table 31.4 shows the clock timing.
Section 31 Electrical Characteristics Table 31.5 External Clock Input Conditions Conditions: VCC = 3.0 V to 3.6 V, VSS = 0 V, φ = 20 MHz to 34 MHz Item Symbol Min. Max. Unit Test Conditions External clock input low level pulse width tEXL 58.8 ns Figure 31.7 External clock input high level pulse width tEXH 58.8 ns External clock input rising time tEXr 5 ns External clock input falling time tEXf 5 ns Clock low level pulse width tCL 0.4 0.
Section 31 Electrical Characteristics tcyc tCH tCf φ tCL tCr Figure 31.4 System Clock Timing VCC STBY tOSC1 tOSC1 RES φ Figure 31.5 Oscillation Stabilization Timing φ NMI IRQi ( i = 0 to 15 ) tOSC2 Figure 31.6 Oscillation Stabilization Timing (Exiting Software Standby Mode) Rev. 2.00 Aug.
Section 31 Electrical Characteristics tEXH tEXL VCC × 0.5 EXTAL tEXr tEXf Figure 31.7 External Clock Input Timing VCC 2.7 V STBY VIH EXTAL φ (Internal and external) RES tDEXT* Note: The external clock output stabilization delay time (tDEXT) includes a RES pulse width (tRESW). Figure 31.8 Timing of External Clock Output Stabilization Delay Time Rev. 2.00 Aug.
Section 31 Electrical Characteristics tEXCLH tEXCLL VCC × 0.5 EXCL tEXCLr tEXCLf Figure 31.9 Subclock Input Timing Rev. 2.00 Aug.
Section 31 Electrical Characteristics 31.3.2 Control Signal Timing Table 31.7 shows the control signal timing. Only external interrupts NMI and IRQ0 to IRQ15 can be driven based on the subclock (φSUB = 32.768 kHz). Table 31.7 Control Signal Timing Conditions: VCC = 3.0 V to 3.6 V, VSS = 0 V, φ = 20 MHz to 34 MHz Item Symbol Min. Max. Unit Test Conditions RES setup time tRESS 200 ns Figure 31.
Section 31 Electrical Characteristics φ tNMIS tNMIH NMI tNMIW IRQi (i = 0 to 15) tIRQW tIRQS tIRQH IRQ Edge input tIRQS IRQ Level input Figure 31.11 Interrupt Input Timing Rev. 2.00 Aug.
Section 31 Electrical Characteristics 31.3.3 Bus Timing Table 31.8 shows the bus timing. In subclock (φSUB = 32.768 kHz) operation, external expansion mode operation cannot be guaranteed. Table 31.8 Bus Timing Conditions: VCC = 3.0 V to 3.6 V, VSS = 0 V, φ = 20 MHz to 34 MHz Item Symbol Min. Max. Unit Test Conditions Address delay time tAD 14.7 ns Figures 31.12 to 31.19 Address setup time tAS 0.5 × tcyc –14.7 Address hold time tAH 0.5 × tcyc – 9.
Section 31 Electrical Characteristics T1 T2 φ tAD A23 to A0, IOS* CS256 tCSD tAS tAH tASD tASD AS* tRSD1 RD (Read) tRSD2 tACC2 tAS tACC3 tRDS tRDH D15 to D0 (Read) tWRD2 HWR, LWR (Write) tWRD2 tAS tAH tWDD tWSW1 tWDH D15 to D0 (Write) Note: * AS is multiplexed with IOS. Either the AS or IOS function can be selected by the IOSE bit of SYSCR. Figure 31.12 Basic Bus Timing/2-State Access Rev. 2.00 Aug.
Section 31 Electrical Characteristics T1 T2 T3 φ tAD A23 to A0, IOS* CS256 tCSD tAS tAH tASD tASD AS* tRSD1 tRSD2 tACC4 RD (Read) tAS tRDS tACC5 tRDH D15 to D0 (Read) tWRD1 tWRD2 HWR, LWR (Write) tAH tWDD tWDS tWSW2 tWDH D15 to D0 (Write) Note: * AS is multiplexed with IOS. Either the AS or IOS function can be selected by the IOSE bit of SYSCR. Figure 31.13 Basic Bus Timing/3-State Access Rev. 2.00 Aug.
Section 31 Electrical Characteristics T1 Tw T2 T3 φ A23 to A0, IOS* CS256 AS* RD (Read) D15 to D0 (Read) HWR, LWR (Write) D15 to D0 (Write) tWTS tWTH tWTS tWTH WAIT Note: * AS is multiplexed with IOS. Either the AS or IOS function can be selected by the IOSE bit of SYSCR. Figure 31.14 Basic Bus Timing/3-State Access with One Wait State Rev. 2.00 Aug.
Section 31 Electrical Characteristics T1 T2 φ tAD Address [A23 to A0] Even tCSD IOS (IOSE = 1) CS256 (CS256E = 1) tAS tASD tAH tASD AS tHBD HBE LBE L tRSD1 RD Read Bus Cycle WR Read Bus Cycle tRSD2 tACC2 tAS L tRDS tACC3 tRDH D15 to D8 Valid D7 to D0 Invalid RD Write Bus Cycle L WR Write Bus Cycle tWRD1 tAS tAH tWDD D15 to D8 tWRD2 tWSW1 tWDH Valid Undified D7 to D0 Figure 31.15 Even Byte Access (ADMXE = 0) Rev. 2.00 Aug.
Section 31 Electrical Characteristics T1 T2 φ tAD Address [A23 to A0] Odd tCSD IOS (IOSE = 1) CS256 (CS256E = 1) tAS tASD tAH tASD AS HBE L tLBD LBE tRSD1 RD Read Bus Cycle WR Read Bus Cycle tRSD2 tACC2 tAS L tRDS tACC3 tRDH D15 to D8 Invalid D7 to D0 Valid RD Write Bus Cycle WR Write Bus Cycle L tWRD1 tAS tAH tWDD D15 to D8 D7 to D0 tWRD2 tWSW1 tWDH Undifined Valid Figure 31.16 Odd Byte Access (ADMXE = 0) Rev. 2.00 Aug.
Section 31 Electrical Characteristics T1 T2 φ tAD Address [A23 to A0] tCSD IOS (IOSE = 1) CS256 (CS256E = 1) tAS tASD tAH tASD AS tHBD HBE tLBD LBE tRSD1 RD Read Bus Cycle WR Read Bus Cycle tRSD2 tACC2 tAS L tRDS tACC3 tRDH D15 to D8 Valid D7 to D0 Valid RD Write Bus Cycle L WR Write Bus Cycle tWRD1 tAS tAH tWDD D15 to D8 tWRD2 tWSW1 tWDH Valid Valid D7 to D0 Figure 31.17 Word Access (ADMXE = 0) Rev. 2.00 Aug.
Section 31 Electrical Characteristics T1 T1 T2 or T3 T2 φ tAD A23 to A0, IOS* CS256 tAS tAH tASD tASD AS* tRSD2 RD (Read) tACC3 tRDS tRDH D15 to D0 (Read) Note: * AS is multiplexed with IOS. Either the AS or IOS function can be selected by the IOSE bit of SYSCR. Figure 31.18 Burst ROM Access Timing/2-State Access Rev. 2.00 Aug.
Section 31 Electrical Characteristics T1 T2 or T3 T1 φ tAD A23 to A0, IOS* CS256 AS* tRSD2 RD (Read) tACC1 tRDS tRDH D15 to D0 (Read) Note: * AS is multiplexed with IOS. Either the AS or IOS function can be selected by the IOSE bit of SYSCR. Figure 31.19 Burst ROM Access Timing/1-State Access Rev. 2.00 Aug.
Section 31 Electrical Characteristics 31.3.4 Multiplex Bus Timing Table 31.9 shows the Multiplex bus interface timing. In subclock (φSUB = 32.768 kHz) operation, external expansion mode operation cannot be guaranteed. Table 31.9 Multiplex Bus Timing Conditions: VCC = 3.0 V to 3.6 V, VSS = 0 V, φ = 20 MHz to 34 MHz Item Symbol Min.. Max. Unit Test Conditions Address delay time tAD 14.7 ns Figures 31.20, Address setup time 2 tAS2 0.5 × tcyc − 14.7 Address hold time 2 tAH2 0.
Section 31 Electrical Characteristics T1 T3 T2 T4 φ tCSD IOS, CS256 tAHD AH tRSD1 tRSD2 tACC2 RD (Read) tRDS tACC6 AD15 to AD0 (Read) D15 to D0 A15 to A0 tAD tAS2 tAH2 tWRD2 tWRD2 tWSW1 HWR, LWR (Write) tAD AD15 to AD0 (Write) tWDD A15 to A0 tWDH D15 to D0 Figure 31.20 Multiplex Bus Timing/Data 2-State Access Rev. 2.00 Aug.
Section 31 Electrical Characteristics T1 T2 T3 T4 T5 φ tCSD IOS, CS256 tAHD AH tRSD1 tRSD2 tACC4 RD (Read) tRDS tRDH tACC7 AD15 to AD0 (Read) A15 to A0 tAD tAS2 D15 to D0 tAH2 tWRD1 HWR, LWR (Write) AD15 to AD0 (Write) tWRD2 tWSW2 tAD tWDD A15 to A0 tWDS tWDH D15 to D0 Figure 31.21 Multiplex Bus Timing/Data 3-State Access Rev. 2.00 Aug.
Section 31 Electrical Characteristics 31.3.5 Timing of On-Chip Peripheral Modules Tables 31.10 to 31.13 show the on-chip peripheral module timing. The on-chip peripheral modules that can be operated by the subclock (φSUB = 32.768 kHz) are I/O ports, external interrupts (NMI, IRQ0 to IRQ15), watchdog timer, and 8-bit timer (channels 0 and 1) only. Rev. 2.00 Aug.
Section 31 Electrical Characteristics Table 31.10 Timing of On-Chip Peripheral Modules Conditions: VCC = 3.0 V to 3.6 V, VSS = 0 V, φ SUB = 32.768 kHz*, φ = 20 MHz to 34 MHz Item Symbol Min. Max. Unit Test Conditions ns Figure 31.22 Output data delay time tPWD 29.4 Input data setup time tPRS 19.6 Input data hold time tPRH 19.6 PWMX Timer output delay time tPWOD 29.4 ns Figure 31.23 SCI Input clock cycle tScyc 4 tcyc Figure 31.24 6 tSCKW 0.4 0.
Section 31 Electrical Characteristics Table 31.11 Timing of On-Chip Peripheral Modules (2) Conditions: VCC = 3.0 V to 3.6 V, VSS = 0 V, φ = 20 MHz to 34 MHz Item SSU Clock cycle time Master Symbol Min. Max. Unit Test Conditions tSUcyc 4 256 tcyc Figure 31.28 4 256 Slave Clock high pulse width Master 80 80 80 80 tRISE 20 tFALL 20 ns tSU 25 ns 30 10 10 2.5 2.
Section 31 Electrical Characteristics T2 T1 φ tPRS tPRH Ports 1 to 9 and A to F (read) tPWD Ports 1 to 6, 8, 9 and A to F (write) Figure 31.22 I/O Port Input/Output Timing φ tPWOD PWX3 to PWX0 Figure 31.23 PWMX Output Timing tSCKW tSCKr tSCKf SCK1, SCK3 tScyc Figure 31.24 SCK Clock Input Timing SCK1, SCK3 tTXD TxD1, TxD3 (transmit data) tRXS tRXH RxD1, RxD3 (receive data) Figure 31.25 SCI Input/Output Timing (Clock Synchronous Mode) Rev. 2.00 Aug.
Section 31 Electrical Characteristics φ tTRGS ADTRG Figure 31.26 A/D Converter External Trigger Input Timing φ tRESD tRESD RESO tRESOW Figure 31.27 WDT Output Timing (RESO) SCS (output) tLEAD tHI tFALL tRISE tLAG SSCK (output) CPOS = 1 tLO tHI SSCK (output) CPOS = 0 tLO tSUcyc SSO (output) tOH tOD SSI (input) tSU tH Figure 31.28 SSU Timing (Master, CPHS = 1) Rev. 2.00 Aug.
Section 31 Electrical Characteristics SCS (output) tLEAD tHI tFALL tRISE tLAG tTD SSCK (output) CPOS = 1 tLO tHI SSCK (output) CPOS = 0 tSUcyc tLO SSO (output) tOH tOD SSI (input) tSU tH Figure 31.29 SSU Timing (Master, CPHS = 0) SCS (input) tLEAD tHI tFALL tRISE tLAG tTD SSCK (input) CPOS = 1 tLO tHI SSCK (input) CPOS = 0 tLO tSUcyc SSO (input) tSU tREL tH SSI (output) tSA tOH tOD Figure 31.30 SSU Timing (Slave, CPHS = 1) Rev. 2.00 Aug.
Section 31 Electrical Characteristics SCS (input) tLEAD tHI tFALL tRISE tLAG tTD SSCK (input) CPOS = 1 tLO tHI SSCK (input) CPOS = 0 tSUcyc tLO SSO (input) tREL tSU tH SSI (output) tSA tOH tOD Figure 31.31 SSU Timing (Slave, CPHS = 0) Rev. 2.00 Aug.
Section 31 Electrical Characteristics 2 Table 31.12 I C Bus Timing Conditions: VCC = 3.0 V to 3.6 V, VSS = 0 V, φ = 20 MHz to 34 MHz Item Symbol Min. Typ. Max. Unit Test Conditions SCL input cycle time tSCL 12 tcyc Figure 31.32 SCL input high pulse width tSCLH 3 SCL input low pulse width tSCLL 5 SCL, SDA input rise time tSr 7.5* SCL, SDA input fall time tSf 300 tOf 20 + 0.
Section 31 Electrical Characteristics SDA0 to SDA5 VIH VIL tBUF tSCLH tSTAH tSP tSTAS tSTOS SCL0 to SCL5 P* S* tSf Sr* tSCLL P* tSr tSDAS tSCL tSDAH Note: * S, P, and Sr indicate the following conditions: S: Start condition P: Stop condition Sr: Repeated start condition 2 Figure 31.32 I C Bus Interface Input/Output Timing Table 31.13 LPC Module Timing Conditions: VCC = 3.0 V to 3.6V, VSS = 0 V, φ = 20 MHz to 34 MHz Item Symbol Min. Typ. Max.
Section 31 Electrical Characteristics tLCKH tLcyc LCLK tLCKL LCLK tTXD LAD3 to LAD0, SERIRQ, CLKRUN (Transmit signal) tRXS tRXH LAD3 to LAD0, SERIRQ, CLKRUN, LFRAME (Receive signal) tOFF LAD3 to LAD0, SERIRQ, CLKRUN (Transmit signal) Figure 31.33 LPC Interface (LPC) Timing Rev. 2.00 Aug.
Section 31 Electrical Characteristics Table 31.14 Ethernet Controller Signal Timing Conditions: VCC = 3.0 V to 3.6V, VSS = 0 V, φ = 20 MHz to 34 MHz Item Symbol Min. Typ. Max. Unit Test Conditions RM_REF-CLK cycle time Tck 20 ns Figure 31.34 RM_REF-CLK frequency 50 50 + MHz 100 ppm RM_REF-CLK duty cycle 35 65 % 0.5 3.5 ns 12.5 RM_REF-CLK rise/fall time Tckr/Tckf 1 Tco 2.
Section 31 Electrical Characteristics Tck RM_REF-CLK Tco RM_TXD_EN Tco Preamble RM_TXD1, RM_TXD0 SFD CRC DATA Figure 31.35 RMII Transmit Timing RM_REF-CLK Tsu Thd RM_CRS-DV Thd Tsu RM_RXD1, RM_RXD0 Preamble CRC DATA SFD RM_RX-ER L Figure 31.36 RMII Receive Timing (Normal Operation) RM_REF-CLK RM_CRS-DV RM_RXD1, RM_RXD0 Preamble SFD DATA Tsu XXXX Thd RM_RX-ER Figure 31.37 RMII Receive Timing (When an Error is Detected) Rev. 2.00 Aug.
Section 31 Electrical Characteristics MDC tMDIOh tMDIOs MDIO Figure 31.38 MDIO Input Timing MDC tMDIOdh MDIO Figure 31.39 MDIO Output Timing RM_REF-CLK tWOLd WOL Figure 31.40 WOL Output Timing Rev. 2.00 Aug.
Section 31 Electrical Characteristics Table 31.15 USB Characteristics when On-Chip USB Transceiver is Used (USD+, USD− pin characteristics) Conditions: VCC = DrVCC = 3.0 V to 3.6 V, VSS = DrVSS = AVSS= 0 V, φ = 20 MHz to 34 MHz Item Input Output Symbol Min. Max. Unit Test Conditions Input high voltage VIH 2.0 V Input low voltage VIL 0.8 V Differential input sensitivity VDI 0.2 V Differential common mode range VCM 0.8 2.5 V Output high voltage VOH 2.
Section 31 Electrical Characteristics Rise time USD+, USD- Fall time 90% VCRS 90% 10% Differential data lines 10% tR tF Figure 31.41 Data Signal Timing USD+ RS = 22 Ω Test point CL = 50 pF USD- RS = 22 Ω Test point CL = 50 pF Figure 31.42 Load Condition Rev. 2.00 Aug.
Section 31 Electrical Characteristics Table 31.16 JTAG Timing Conditions: VCC = 3.0 V to 3.6 V, VSS = 0 V, φ = 20 MHz to 34 MHz Item Symbol Min. Max. Unit Test Conditions ETCK clock cycle time tTCKcyc 29.4* 50* ns Figure 31.42 ETCK clock high pulse width tTCKH 15 ETCK clock low pulse width tTCKL 15 ETCK clock rise time tTCKr 5 ETCK clock fall time tTCKf 5 ETRST pulse width tTRSTW 20 tcyc Figure 31.43 ns Figure 31.
Section 31 Electrical Characteristics ETCK tRSTHW RES ETRST tTRSTW Figure 31.44 Reset Hold Timing ETCK tTMSS tTMSH tTDIS tTDIH ETMS ETDI tTDOD ETDO Figure 31.45 JTAG Input/Output Timing Rev. 2.00 Aug.
Section 31 Electrical Characteristics 31.4 A/D Conversion Characteristics Table 31.17 lists the A/D conversion characteristics. Table 31.17 A/D Conversion Characteristics (AN7 to AN0 Input: 80/160-State Conversion) Condition A: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, AVref = 3.0 V to AVCC VSS = AVSS = 0 V, φ = 20 MHz Condition B: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, AVref = 3.0 V to AVCC, VSS = AVSS = 0 V, φ = 20 MHz to 34 MHz Condition A Condition B Item Min. Typ. Max. Min. Typ.
Section 31 Electrical Characteristics 31.5 Flash Memory Characteristics Table 31.18 lists the flash memory characteristics. Table 31.18 Flash Memory Characteristics Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Avref = 3.0 V to AVCC, VSS = AVSS = 0 V Ta = 0°C to +75°C (operating temperature range for programming/erasing in regular specifications) Item Symbol Test Conditions Min. Typ. Max.
Section 31 Electrical Characteristics 31.6 Usage Notes It is necessary to connect a bypass capacitor between the VCC pin and VSS pin and a capacitor between the VCL pin and VSS pin for stable internal step-down power. An example of connection is shown in figure 31.45. Vcc power supply Bypass capacitor 10 µF VCC External capacitor for internal step-down power stabilization VCL One 0.1 µF / 0.47 µF or two in parallel 0.01 µF VSS It is recommended that a bypass capacitor be connected to the VCC pin.
Section 31 Electrical Characteristics Rev. 2.00 Aug.
Appendix Appendix A. I/O Port States in Each Processing State Table A.
Appendix MCU Operating Port Name Mode Pin Name EXPE Setting Reset Standby Mode Standby Mode Sleep Mode Execution State Port 97 0 T T kept kept I/O port WAIT 1 (CS256E=0) T T WAIT CS256 1 (CS256E=1) H H CS256 Port 96 X T T kept kept I/O port Port 95 0 T T kept kept I/O port AS, IOS 1 H H AS/IOS Port 94, 93 X T T kept kept I/O port Port 92 0 T T kept kept I/O port HBE 1 H H HBE Port 91 0 / 1 (ADMXE=0) T T kept kept I/O port AH 1 (ADMXE=1)
Appendix MCU Operating Port Name Mode Pin Name EXPE Setting Reset Standby Mode Standby Mode Sleep Mode Execution State Port D X T T kept kept I/O port Port E X T T kept kept I/O port Port F X T T kept kept I/O port Hardware Software Program [Legend] H: High level L: Low level T: High impedance kept: Input port pins are in the high-impedance state (when DDR = 0 and PCR = 1, the input pullup MOS remains on). Output port pins retain their states.
Appendix B.
Appendix Package Dimensions JEITA Package Code P-LFBGA176-13x13-0.80 RENESAS Code PLBG0176GA-A Previous Code BP-176/BP-176V MASS[Typ.] 0.45g D w S A E w S B x4 v y1 S A1 A S y S e ZD A Reference Dimension in Millimeters Symbol Min Nom Max e R P N M B L D 13.0 E 13.0 v 0.15 H w G A 0.20 1.40 F A1 K J E 0.35 0.40 0.80 0.45 0.45 0.50 0.55 e D C ZE C. B A 1 2 3 4 5 6 φb 7 8 9 10 11 12 13 14 15 φx M S A B b x 0.08 y 0.10 y1 0.2 SD SE ZD 0.
Appendix JEITA Package Code P-LQFP144-20x20-0.50 RENESAS Code PLQP0144KA-A Previous Code 144P6Q-A / FP-144L / FP-144LV MASS[Typ.] 1.2g HD *1 D 108 73 109 NOTE) 1. DIMENSIONS "*1" AND "*2" DO NOT INCLUDE MOLD FLASH. 2. DIMENSION "*3" DOES NOT INCLUDE TRIM OFFSET. 72 bp c Reference Symbol *2 E HE c1 b1 A 36 Index mark ZD c 37 1 A2 144 ZE Terminal cross section A1 F L D E A2 HD HE A A1 bp b1 c c1 L1 *3 e y bp x Detail F Figure C.2 Package Dimensions (PLQP0144KA-A) Rev. 2.
Appendix JEITA Package Code P-TQFP144-16x16-0.40 RENESAS Code PTQP0144LC-A Previous Code TFP-144/TFP-144V MASS[Typ.] 0.6g HD *1 D 108 73 109 NOTE: 1. DIMENSIONS"*1"AND"*2" DO NOT INCLUDE MOLD FLASH 2. DIMENSION"*3"DOES NOT INCLUDE TRIM OFFSET. 72 HE b1 c ZE c1 *2 E bp Reference Symbol 37 144 Terminal cross section 1 36 ZD Index mark c A2 A F θ *3 y bp L A1 e x M L1 Detail F D E A2 HD HE A A1 bp b1 c c1 θ e x y ZD ZE L L1 Dimension in Millimeters Min Nom Max 16 16 1.
Appendix Rev. 2.00 Aug.
Main Revisions and Additions in this Edition Item Page Revision (See Manual for Details) Lineup of the H8S/2463 Group products added Section 1 Overview 1 Amended USB function module (USB)* 1.1 Overview 1 10-bit A/D converter Platform Environment Control Interface (PECI)* 2 Boundary scan (JTAG) Clock pulse generator Notes: 1. Supported only by the H8S/2472 Group. 2. Supported only by the H8S/2472 Group and the H8S/2462 Group.
Page Revision (See Manual for Details) 1.2 Block Diagram 3 Amended 8-bit timer × 4 SSU CRC calculator Port 6 FRT USB* 1 IIC_0 to IIC_5 PECI* 2 Port 7 Port A SCIF Port 5 Figure 1.
Item Page Figure 1.
Item Page Revision (See Manual for Details) Section 3 MCU Operating Modes 67 Added Initial 3.2.3 Serial Timer Control Register (STCR) Bit Bit Name Value R/W 3 FLSHE R/W 0 Description Flash Memory Control Register Enable Enables or disables CPU access for flash memory registers (FCCS, FPCS, FECS, FKEY, FMATS, FTDAR), control registers of power-down states (SBYCR, LPWRCR, MSTPCRH, MSTPCRL), and control registers of on-chip peripheral modules (BCR2, WSCR2, PCSR, SYSCR2).
Item Page Revision (See Manual for Details) Section 5 Interrupt Controller 82 Amended Register Table 5.2 Correspondence between Interrupt Source and ICR Bit ICRC ICRD 7 SCI_3 IRQ8 to IRQ11 2 IIC_2, IIC_3 PECI*2 1 LPC SCIF 0 USB*1 — [Legend] n: A to D : Reserved. The write value should always be 0. Notes: 1. Supported only by the H8S/2472 Group. 2. Supported only by the H8S/2472 Group and the H8S/2462 Group. Table 5.
Item Page Revision (See Manual for Details) 8.1.10 Port A 243 Amended • PA5/ExIRQ5/EVENT5/A21/WOL The pin function is switched as shown below according to the setting of the address 18, and the PA5DDR bit. Setting the ISS5 bit in ISSR to 1 makes the pin function as the ExIRQ5 input pin. When using the pin as the ExIRQ5 input, or an EVENT input pin, clear the PA5DDR bit to 0.
Item Page Revision (See Manual for Details) 8.2.10 Port A 327 Amended • PA5/ExIRQ5/EVENT5/A21/WOL The pin function is switched as shown below according to the setting of the MPDE bit in ECMR in EtherC, the address 18, and the PA5DDR bit. Setting the ISS5 bit in ISSR to 1 makes the pin function as the ExIRQ5 input pin. When using the pin as the ExIRQ5 input, or an EVENT input pin, clear the PA5DDR bit to 0.
Item Page Revision (See Manual for Details) • 420 Amended TCSR_1 Bit Bit Name Description 5 TME Timer Enable When this bit is set to 1, TCNT starts counting. When this bit is cleared, TCNT stops counting and is initialized to H'00. When PSS = 1, TCNT is not initialized. Write H'00 to TCNT to initialize TCNT. Section 15 Serial Communication Interface with FIFO (SCIF) 510 Register name amended • Sub-chip module stop control register BL (SUBMSTPBL) 15.3 Register Descriptions Table 15.
Item Page Revision (See Manual for Details) Section 19 LPC Interface (LPC) 678 Amended 19.3.1 Host Interface Control Registers 0 and 1 (HICR0 and HICR1) • Bit Bit Name Description 0 LSCIB LSCI output Bit Controls LSCI output in combination with the LSCIE bit. For details, refer to description on the HICR1 LSCIE bit in HICR0. Figure 19.11 Clock Start 749 Request Timing Amended LCLK 1 2 3 4 5 6 CLKRUN Driven by the host processor Pull-up enable Driven by the slave processor Table 19.
Item Page Revision (See Manual for Details) Section 21 Ethernet Controller Direct Memory Access Controller (E-DMAC) 806 Amended 21.2.8 Transmit/Receive Status Copy Enable Register (TRSCER) TRSCER specifies whether or not transmit and receive status information reported by bits 7 and 4 in the EtherC/E-DMAC status register is to be indicated in bit RFE in the corresponding descriptor. Bits in this register correspond to bits 7 and 4 in the EtherC/E-DMAC status register (EESR).
Item Page Revision (See Manual for Details) 21.3.1 Descriptor List and Data Buffers 818 Amended (1) Transmit Descriptor Bit Bit Name Initial value R/W Description (a) Transmit Descriptor 0 (TD0) 27 TFE 0 R/W Transmit Frame Error Indicates that one or other bit of the transmit frame status indicated by bits 26 to 0 is set. Whether or not the transmit frame status information is copied into this bit is specified by the transmit/receive status copy enable register.
Item Page Revision (See Manual for Details) 21.3.1 Descriptor List and Data Buffers 823 Amended Bit Name (2) Receive Descriptor Bit (a) Receive Descriptor 0 (RD0) 26 to 0 Initial value RFS26 to All 0 RFS0 R/W Description R/W Receive Frame Status These bits indicate the error status during frame reception. … RFS8: Abort Detection (indicates any of bits RFS3 to RFS0 has been set.) … 22.10.
Item Page Revision (See Manual for Details) Section 25 Flash Memory 985 Description amended … , this LSI also has a programmer mode as a further mode for the programming and erasing of programs and data. In the programmer mode, a general-purpose PROM programmer, which supports microcomputers with 256-Kbyte or 512-Kbyte 1 flash memory as a device type* , can freely be used to write programs to the on-chip ROM. … 25.7 Programmer Mode In programmer mode, provide a 6-MHz input-clock signal. 25.
Item Page Revision (See Manual for Details) Section 26 Boundary Scan (JTAG) 1019 Deleted Table 26.1 Pin Configuration Table 26.3 1025, Correspondence 1029 between Pins and Boundary Scan Register (H8S/2472 Group) Pin Name Function Test clock Test clock inputProvides an independent clock supply to the JTAG. As the clock input to the ETCK pin is supplied directly to the JTAG, a clock waveform with a duty cycle close to 50% should be input. For details, see section 31, Electrical Characteristics.
Item Page Table 26.4 1031 Correspondence between Pins and Boundary Scan Register (H8S/2462 Group and H8S/2463 Group) 1033 Revision (See Manual for Details) Description added Though the pin no. for the H8S/2462 Group and the H8S/2463 Group differs, the bit no. for these products is the same. The following table is listed with the pin no. of the H8S/2462 Group. Amended Pin No. Pin Name Input/Output Bit No. 35 PA5 Input 251 Enable 252 Output 249 — — — — — — 36 26.
Item Page Revision (See Manual for Details) 29.2 Register Bits 1089, 1103 Amended Register Abbreviation Bit 3 Bit 2 Bit 1 Bit 0 Module TRSCER E-DMAC Notes: The registers related to USB are supported only by the H8S/2472 Group. The registers related to PECI are supported only by the H8S/2472 Group and the H8S/2462 Group. 29.
Item Page Revision (See Manual for Details) Appendix 1168 Amended and added B. Product Lineup Product Type Type Code Mark Code H8S/2472 F-ZTAT version (wide temperature specifications) R4F2472 H8S/2463 F-ZTAT version R4F2463 (regular specifications) Figure C.3 Package Dimensions (PTQP0144LC-A) 1171 F2472VBR34DV F2463VTE34V F-ZTAT version (wide temperature specifications) R4F2463 F2463VTE34DV H8S/2462 F-ZTAT version (wide temperature specifications) R4F2462 F2462VFQ34DV Added Rev. 2.
Rev. 2.00 Aug.
Index Numerics B 14-bit PWM timer (PWMX)................... 359 16-bit count mode................................... 408 16-bit free-running timer (FRT) ............. 375 16-bit, 2-state access space ..................... 133 16-bit, 3-state access space ..................... 136 256-kbyte expansion area ....................... 121 8-bit timer (TMR)................................... 393 8-bit, 2-state access space ....................... 131 8-bit, 3-state access space .......................
Control transfer....................................... 870 Conversion cycle .................................... 367 CPU operating modes Advanced mode .................................... 30 CPU operating modes ............................... 28 Normal mode ........................................ 28 CRC operation circuit ............................. 499 Crystal oscillator................................... 1050 Flash multipurpose address area parameter ................................................
Interrupt control modes ............................ 93 Interrupt controller.................................... 79 Interrupt exception handling..................... 76 Interrupt exception handling sequence ... 100 Interrupt exception handling vector table ............................................... 90 Interrupt mask bit...................................... 36 interrupt mask level .................................. 35 Interrupt-in transfer................................. 879 Interval timer mode ......
ADDR................................................. 896 APR .................................................... 774 BARA ................................................... 83 BARB ................................................... 83 BARC ................................................... 83 BRR .................................................... 447 BTCR.................................................. 727 BTCSR ............................................... 724 BTDTR .............................
ICDR................................................... 591 ICMR.................................................. 595 ICRA..................................................... 82 ICRB..................................................... 82 ICRC..................................................... 82 ICRD..................................................... 82 ICSMBCR .......................................... 617 ICSR ................................................... 609 ICXR.............................
PCDDR....................... 254, 259, 338, 343 PCODR............................... 255, 339, 344 PCPIN................................. 255, 339, 344 PCSR .................................................. 365 PDODR............................................... 260 PDPIN................................................. 260 PEDDR ............................... 264, 348, 353 PEODR ....................... 264, 269, 349, 354 PEPIN ......................... 265, 269, 349, 354 PFDDR ..........................
Reset ......................................................... 74 Reset exception handling.......................... 74 RXI1 ....................................................... 489 RXI2 ....................................................... 489 S Sample-and-hold circuit ......................... 903 Scan mode .............................................. 901 SCIF Control from LPC Interface .......... 749 Serial communication interface (SCI) .... 431 Serial communication interface specification......
Rev. 2.00 Aug.
Renesas 16-Bit Single-Chip Microcomputer Hardware Manual H8S/2472, H8S/2463, H8S/2462 Group Publication Date: Rev.1.00, Mar. 12, 2008 Rev.2.00, Aug. 20, 2008 Published by: Sales Strategic Planning Div. Renesas Technology Corp. Edited by: Customer Support Department Global Strategic Communication Div. Renesas Solutions Corp. 2008. Renesas Technology Corp., All rights reserved. Printed in Japan.
Sales Strategic Planning Div. Nippon Bldg., 2-6-2, Ohte-machi, Chiyoda-ku, Tokyo 100-0004, Japan RENESAS SALES OFFICES http://www.renesas.com Refer to "http://www.renesas.com/en/network" for the latest and detailed information. Renesas Technology America, Inc. 450 Holger Way, San Jose, CA 95134-1368, U.S.A Tel: <1> (408) 382-7500, Fax: <1> (408) 382-7501 Renesas Technology Europe Limited Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.K.
H8S/2472, H8S/2463, H8S/2462 Group Hardware Manual 1753, Shimonumabe, Nakahara-ku, Kawasaki-shi, Kanagawa 211-8668 Japan REJ09B0403-0200