Page 3
(iii) prevention against any malfunction or mishap. Notes regarding these materials 1. These materials are intended as a reference to assist our customers in the selection of the Renesas Technology Corp. product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any other rights, belonging to Renesas Technology Corp.
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.
Page 5
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 Modules The configuration of the functional description of each module differs according to the module.
Preface This LSI is a RISC (Reduced Instruction Set Computer) microcomputer which includes a Renesas Technology-original RISC CPU as its core, and the peripheral functions required to configure a system. Target Users: This manual was written for users who will be using this LSI in the design of application systems.
Page 7
Abbreviations Arithmetic Logic Unit ASID Address Space Identifier Ball Grid Array Compare Match Timer (Timer/Counter) Clock Pulse Generator Central Processing Unit Double Data Rate DDRIF DDR-SDRAM Interface Direct Memory Access DMAC Direct Memory Access Controller FIFO First-In First-Out FLCTL NAND Flash Memory Controller Floating-point Unit Audio Codec HSPI...
Page 8
MMCIF Multimedia Card Interface Memory Management Unit Most Significant Bit Program Counter Peripheral Component Interconnect PCIC PCI (local bus) Controller RISC Reduced Instruction Set Computer Realtime Clock SCIF Serial Communication Interface with FIFO SIOF Serial Interface with FIFO Serial Sound Interface Test Access Port Translation Lookaside Buffer Timer Unit...
Page 15
Section 12 DDR-SDRAM Interface (DDRIF)...........401 12.1 Features..........................401 12.2 Input/Output Pins ....................... 403 12.3 Address Space, Bus Width, and Data Alignment............... 404 12.3.1 Address Space of the DDRIF................404 12.3.2 Memory Data Bus Width ..................405 12.3.3 Data Alignment..................... 406 12.4 Register Descriptions ......................
Page 16
13.4.4 Target Access......................532 13.4.5 Host Bus Bridge Mode ..................541 13.4.6 Normal mode ......................544 13.4.7 Power Management ....................544 13.4.8 PCI Local Bus Basic Interface................545 Section 14 Direct Memory Access Controller (DMAC)........557 14.1 Features..........................557 14.2 Input/Output Pins....................... 559 14.3 Register Descriptions......................
Page 18
17.5 Module Standby State ......................649 17.5.1 Transition to Module Standby Mode ..............649 17.5.2 Cancellation of Module Standby Mode and Resume..........649 17.6 DDR-SDRAM Power Supply Backup................650 17.6.1 Self-Refresh and Initialization ................650 17.6.2 DDR-SDRAM Backup Sequence when Turning Off System Power Supply ..651 17.7 RTC Power Supply Backup ....................
Page 19
19.3.3 Control Register (CMTCTL) ................684 19.3.4 Interrupt Status Register (CMTIRQS) ..............688 19.3.5 Channels 0 to 3 Time Registers (CMTCH0T to CMTCH3T)....... 689 19.3.6 Channels 0 to 1 Stop Time Registers (CMTCH0ST to CMTCH1ST)....689 19.3.7 Channels 0 to 3 Counters (CMTCH0C to CMTCH3C)........690 19.4 Operation ...........................
Page 20
20.4 Operation ........................... 727 20.4.1 Time Setting Procedures..................727 20.4.2 Time Reading Procedures..................728 20.4.3 Alarm Function..................... 729 20.5 Interrupts..........................730 20.6 Usage Notes ........................730 20.6.1 Register Initialization.................... 730 20.6.2 Crystal Oscillator Circuit ..................730 20.6.3 Interrupt source and request generating order............732 Section 21 Serial Communication Interface with FIFO (SCIF)......
Page 21
22.3.2 Clock Select Register (SISCR) ................804 22.3.3 Control Register (SICTR) ..................806 22.3.4 Transmit Data Register (SITDR) ................809 22.3.5 Receive Data Register (SIRDR) ................810 22.3.6 Transmit Control Data Register (SITCR) ............. 811 22.3.7 Receive Control Data Register (SIRCR) .............. 812 22.3.8 Status Register (SISTR)..................
Page 25
28.2.19 Port G Data Register (PGDR)................1084 28.2.20 Port H Data Register (PHDR)................1085 28.2.21 Port J Data Register (PJDR) ................1085 28.2.22 Port K Data Register (PKDR)................1086 28.2.23 Port L Data Register (PLDR)................1086 28.2.24 Port M Data Register (PMDR) ................1087 28.2.25 Port E Pull-Up Control Register (PEPUPR) ............
Page 27
31.4 AC Characteristic Test Conditions................... 1214 31.5 Change in Delay Time Based on Load Capacitance ............1215 Appendix ......................1217 CPU Operation Mode Register (CPUOPM) ..............1217 Instruction Prefetching and Its Side Effects..............1219 Speculative Execution for Subroutine Return..............1220 Register Address Map...................... 1221 Package Dimensions ......................
Page 28
Rev.1.00 Dec. 13, 2005 Page xxviii of l...
Page 29
Figures Section 1 Overview Figure 1.1 SH7780 Block Diagram ....................9 Figure 1.2 SH7780 Pin Arrangement.................... 10 Figure 1.3 Physical Address Space of SH7780................28 Figure 1.4 Relationship between AREASEL Bits and Memory Address Map......29 Section 2 Programming Model Figure 2.1 Data Formats .......................
Page 30
Section 7 Memory Management Unit (MMU) Figure 7.1 Role of MMU......................149 Figure 7.2 Virtual Address Space (AT in MMUCR = 0)............150 Figure 7.3 Virtual Address Space (AT in MMUCR = 1)............151 Figure 7.4 P4 Area........................153 Figure 7.5 Physical Address Space..................... 154 Figure 7.6 UTLB Configuration ....................
Page 31
Figure 11.2 Correspondence between Virtual Address Space and External Memory Space of LBSC......................321 Figure 11.3 External Memory Space Allocation (29-bit address mode)........323 Figure 11.4 Basic Timing of SRAM Interface................362 Figure 11.5 Example of 32-Bit Data-Width SRAM Connection ..........363 Figure 11.6 Example of 16-Bit Data-Width SRAM Connection ..........
Page 32
Figure 11.34 Wait Cycles between Access Cycles ..............394 Figure 11.35 Arbitration Sequence..................... 396 Figure 11.36 Example of the Bus Release Restraint by the DMAC CHCR LCKN bit ....398 Section 12 DDR-SDRAM Interface (DDRIF) Figure 12.1 DDRIF Block Diagram ................... 402 Figure 12.2 Physical Address Space of This LSI ...............
Page 33
Figure 13.11 PCI Local Bus to SuperHyway Bus Address Translation (PCIC I/O Space) ..535 Figure 13.12 Endian Conversion from PCI Local Bus to SuperHyway bus (Non-Byte Swapping: TBS = 0) ................537 Figure 13.13 Endian Conversion from PCI Local Bus to SuperHyway bus (Non-Byte Swapping: TBS = 1) ................
Page 34
Section 15 Clock Pulse Generator (CPG) Figure 15.1 Block Diagram of CPG ................... 614 Figure 15.2 Points for Attention when Using Crystal Resonator..........622 Figure 15.3 Points for Attention when Using PLL and DLL Circuit.......... 623 Section 16 Watchdog Timer and Reset Figure 16.1 Block Diagram of WDT ..................
Page 35
Figure 19.5 CMT_CTRn Assert Timing (channel 0 and 1) ............694 Figure 19.6 32-Bit Timer Mode: Output Compare (channel 1 and channel 0) ......694 Figure 19.7 32-bit Timer Mode: Output Compare Operation Timing (Example of High output in Active and Not Active by CMTCHnST)....695 Figure 19.8 32-bit Timer Mode: Output Compare Operation Timing (Example of High output in Active and Not Active by CMTFRT)......
Page 36
Figure 21.12 Sample Serial Reception Flowchart (2)..............780 Figure 21.13 Sample SCIF Receive Operation (Example with 8-Bit Data, Parity, One Stop Bit) ..........782 Figure 21.14 Sample Operation Using Modem Control (SCIF0_RTS) (Only in Channel 0)..782 Figure 21.15 Data Format in Clocked Synchronous Communication ........783 Figure 21.16 Sample SCIF Initialization Flowchart ..............
Page 37
Figure 23.4 Timing Conditions when FBS = 1................864 Section 24 Multimedia Card Interface (MMCIF) Figure 24.1 Block Diagram of MMCIF..................866 Figure 24.2 DR Access Example ....................899 Figure 24.3 Example of Command Sequence for Commands Not Requiring Command Response ................ 903 Figure 24.4 Example of Operational Flow for Commands Not Requiring Command Response ................
Page 38
Figure 24.18 Example of Command Sequence for Commands with Write Data (Stream Transfer)....................924 Figure 24.19 Example of Operational Flow for Commands with Write Data (Single Block Transfer) ..................925 Figure 24.20 Example of Operational Flow for Commands with Write Data (1) (Open-ended Multiple Block Transfer) ..............
Page 39
Figure 25.5 Sample Flowchart for Off-Chip Codec Register Read (1) ........978 Figure 25.6 Sample Flowchart for Off-Chip Codec Register Read (2) ........979 Figure 25.7 Sample Flowchart for Off-Chip Codec Register Read (3) ........980 Section 26 Serial Sound Interface (SSI) Module Figure 26.1 Block Diagram of SSI Module ................
Page 40
Figure 27.7 Sector Access when Unusable Sector Exists in Continuous Sectors..... 1048 Figure 27.8 NAND Flash Command Access (Block Erase)............. 1050 Figure 27.9 NAND Flash Sector Access (Flash Write) Using DMA ........1051 Figure 27.10 NAND Flash Command Access (Flash Read) ............ 1052 Section 28 General Purpose I/O (GPIO) Figure 28.1 Port Data Output Timing (Example of Port A) .............
Page 41
Figure 31.18 PCMCIA I/O Bus Cycle (TEDx = 1, THEx = 1, IW/PCIW = 1, One Internal Wait, Dynamic Bus Sizing)........1175 Figure 31.19 MPX Basic Bus Cycle: Read................1176 Figure 31.20 MPX Basic Bus Cycle: Write................1177 Figure 31.21 MPX Bus Cycle: Burst Read................1178 Figure 31.22 MPX Bus Cycle: Burst Write ................
Page 42
Figure 31.56 SSI Receive Timing (2)..................1206 Figure 31.57 Command Issue Timing of NAND-type Flash Memory ........1208 Figure 31.58 Address Issue Timing of NAND-type Flash Memory......... 1209 Figure 31.59 Data Read Timing of NAND-type Flash Memory ..........1209 Figure 31.60 Data Write Timing of NAND-type Flash Memory ..........1210 Figure 31.61 Status Read Timing of NAND-type Flash Memory ..........
Page 43
Tables Section 1 Overview Table 1.1 SH7780 Features....................... 2 Table 1.2 Pin Functions ......................11 Section 2 Programming Model Table 2.1 Initial Register Values..................... 35 Table 2.2 Bit Allocation for FPU Exception Handling............45 Section 3 Instruction Set Table 3.1 Execution Order of Delayed Branch Instructions ...........
Page 44
Section 7 Memory Management Unit (MMU) Table 7.1 Register Configuration..................156 Table 7.2 Register States in Each Processing State .............. 156 Section 8 Caches Table 8.1 Cache Features...................... 197 Table 8.2 Store Queue Features .................... 197 Table 8.3 Register Configuration..................200 Table 8.4 Register States in Each Processing State ..............
Page 45
Table 11.10 16-Bit External Device/Big-Endian Access and Data Alignment..... 353 Table 11.11 8-Bit External Device/Big-Endian Access and Data Alignment....... 354 Table 11.12 32-Bit External Device/Little-Endian Access and Data Alignment....355 Table 11.13 16-Bit External Device/Little-Endian Access and Data Alignment....355 Table 11.14 8-Bit External Device/Little-Endian Access and Data Alignment....
Page 46
Section 15 Clock Pulse Generator (CPG) Table 15.1 CPG Pin Configuration..................616 Table 15.2 Clock Operating Modes ..................617 Table 15.3 Register configuration................... 618 Table 15.4 Register States of CPG in Each Processing Mode ..........618 Section 16 Watchdog Timer and Reset Table 16.1 Pin Configuration....................
Page 47
Section 21 Serial Communication Interface with FIFO (SCIF) Table 21.1 Pin Configuration....................739 Table 21.2 Register Configuration..................740 Table 21.3 Register States of SCIF in Each Processing Mode ..........741 Table 21.4 SCSMR Settings ....................758 Table 21.5 SCSMR Settings for Serial Transfer Format Selection......... 770 Table 21.6 SCSMR and SCSCR Settings for SCIF Clock Source Selection......
Page 48
Section 25 Audio Codec Interface (HAC) Table 25.1 Pin Configuration....................956 Table 25.2 Register Configuration..................957 Table 25.3 Register States of HAC in Each Processing Mode ..........957 Table 25.4 AC97 Transmit Frame Structure................973 Table 25.5 AC97 Receive Frame Structure ................974 Section 26 Serial Sound Interface (SSI) Module Table 26.1 Pin Configuration....................
Page 49
= −20 to 75°C / −40 to 85°C)......... 1156 Table 31.2 DC Characteristics (T Table 31.3 Permissible Output Currents ................1159 Table 31.4 Clock Timing ...................... 1159 Table 31.5 Clock and Control Signal Timing ............... 1160 Table 31.6 Control Signal Timing ..................1163 Table 31.7 Bus Timing ......................
Section 1 Overview Section 1 Overview SH7780 Features The SH7780 is an integrated system-on-a-chip microprocessor that is designed as a high performance, embedded, stand-alone Host Processor aimed at the multimedia, infotainment and consumer networking market. The SH7780 features a DDR-SDRAM interface that can be coupled to the DDR320* or 266 SDRAM.
• PCI bus interface (External bus): 32-bit address/data multiplexing External bus frequency: 33M or 66 MHz • Renesas Technology original architecture • 32-bit internal data bus • General-register files: Sixteen 32-bit general registers (eight 32-bit shadow registers) ...
Page 53
Section 1 Overview Item Features • On-chip floating-point coprocessor • Supports single-precision (32 bits) and double-precision (64 bits) • Supports IEEE754-compliant data types and exceptions • Two rounding modes: Round to Nearest and Round to Zero • Handling of denormalized numbers: Truncation to zero or interrupt generation for IEEE754 compliance •...
Section 1 Overview Item Features • Memory 4 Gbytes of physical address space, 256 address space identifiers management (address space identifier ASID: 8 bits) unit (MMU) • Supports single virtual memory mode and multiple virtual memory mode • Supports multiple page sizes: 1 Kbyte, 4 Kbytes, 64 Kbytes, or 1 Mbyte •...
Page 55
Section 1 Overview Item Features • Interrupt controller Nine independent external interrupts: NMI and IRQ7 to IRQ0 (INTC) NMI: Fall/rise selectable IRQ: Fall/rise/high level/low level selectable 15-level signed external interrupts: IRL3 to IRL0, or IRL7 to IRL4 • •...
Page 56
Section 1 Overview Item Features • PCI bus controller PCI bus controller (subset of revision 2.2) (PCIC) 32-bit bus 33 MHz/66 MHz support • PCI master/target support • PCI host function support Built-in bus arbiter • Interrupt requests can be sent to CPU •...
Page 57
Section 1 Overview Item Features • Timer unit (TMU) 6-channel auto-reload 32-bit timer • Input-capture function (only channel 2) • Choice of seven types counter input clocks (external and peripheral clocks) • Compare Match 4-channel auto-reload 32-bit timers Timer (CMT) •...
Page 58
Section 1 Overview Item Features • Audio codec Digital interface for audio codec interface (HAC) • Supports transfer for slot 1 to slot 4 • Choice of 16- or 20-bit DMA transfer • Supports various sampling rates by adjusting slot data •...
Section 1 Overview Pin Functions Table 1.2 lists the pin functions of the SH7780. In the I/O column, I, O, and IO indicate input, output, and input/output, respectively. In the GPIO column, for example, A0 indicates the port A0, which also functions as a general I/O port (input/output). Table 1.2 Pin Functions Pin Name...
Page 75
Section 1 Overview Pin Name Function GPIO* AC20 CS1 Chip select 1 AC21 VSS-PLL2 — PLL2 GND AC22 VDD — Internal VDD AC23 VDDQ — I/O VDD AC24 VDDQ — I/O VDD AC25 MPMD Mode control Address bus VDDQ — I/O VDD Address bus Address bus...
Page 76
Section 1 Overview Pin Name Function GPIO* AD25 VSSQ — I/O GND VSSQ — I/O GND Address bus Address bus Address bus Address bus Data bus Data bus WE3/IOWR Selection signal for D31 to D24 Data bus AE10 D17 Data bus AE11 WE2/IORD Selection signal for D23 to D16/PCMCIA IORD...
Section 1 Overview Memory Address Map The SH7780 supports 32-bit virtual address space, and supports both 29-bit and 32-bit physical address spaces (normal mode and extended mode). For details of mappings from the virtual address space to the physical address spaces, see section 7, Memory Management Unit (MMU). The external memory space of the SH7780 consists of the LBSC space, DDRIF space and PCIC space.
Section 1 Overview SuperHyway Bus The SH7780 is implemented with the SuperHyway bus as the system bus. The SuperHyway bus is a 32-bit-address, 64-bit-data internal bus capable of up to 200 MHz operation that is connected to on-chip modules to allow high speed communication. Each module that is connected to the SuperHyway bus operates as an initiator (i.e.
Section 1 Overview SuperHyway Memory (SuperHyway RAM) The SH7780 includes an on-chip SuperHyway memory which stores instructions or data. The SuperHyway memory has the following features. • Capacity × × Total SuperHyway memory capacity is 32 Kbytes (512 words 256 bits 2 pages).
Section 2 Programming Model Section 2 Programming Model The programming model of this LSI is explained in this section. This LSI has registers and data formats as shown below. Data Formats The data formats supported in this LSI are shown in figure 2.1. Byte (8 bits) Word (16 bits) Longword (32 bits)
Section 2 Programming Model Register Descriptions 2.2.1 Privileged Mode and Banks Processing Modes: This LSI has two processing modes, user mode and privileged mode. This LSI normally operates in user mode, and switches to privileged mode when an exception occurs or an interrupt is accepted.
Section 2 Programming Model Floating-Point Registers and System Registers Related to FPU: There are thirty-two floating- point registers, FR0–FR15 and XF0–XF15. FR0–FR15 and XF0–XF15 can be assigned to either of two banks (FPR0_BANK0–FPR15_BANK0 or FPR0_BANK1–FPR15_BANK1). FR0–FR15 can be used as the eight registers DR0/2/4/6/8/10/12/14 (double-precision floating- point registers, or pair registers) or the four registers FV0/4/8/12 (register vectors), while XF0–...
Section 2 Programming Model 2.2.2 General Registers Figure 2.3 shows the relationship between the processing modes and general registers. This LSI has twenty-four 32-bit general registers (R0_BANK0 to R7_BANK0, R0_BANK1 to R7_BANK1, and R8 to R15). However, only 16 of these can be accessed as general registers R0 to R15 in one processing mode.
Section 2 Programming Model Note on Programming: As the user's R0 to R7 are assigned to R0_BANK0 to R7_BANK0, and after an exception or interrupt R0 to R7 are assigned to R0_BANK1 to R7_BANK1, it is not necessary for the interrupt handler to save and restore the user's R0 to R7 (R0_BANK0 to R7_BANK0).
Section 2 Programming Model 2.2.4 Control Registers Status Register (SR): BIt: Initial value: R/W: BIt: IMASK Initial value: R/W: Initial Bit Name Value Description — Reserved For details on reading/writing this bit, see General Precautions on Handling of Product. Processing Mode Selects the processing mode.
Page 91
Section 2 Programming Model Initial Bit Name Value Description 27 to 16 — All 0 Reserved For details on reading/writing this bit, see General Precautions on Handling of Product. FPU Disable Bit When this bit is set to 1 and an FPU instruction is not in a delay slot, a general FPU disable exception occurs.
Section 2 Programming Model Saved Status Register (SSR) (32 bits, Privileged Mode, Initial Value = Undefined): The contents of SR are saved to SSR in the event of an exception or interrupt. Saved Program Counter (SPC) (32 bits, Privileged Mode, Initial Value = Undefined): The address of an instruction at which an interrupt or exception occurs is saved to SPC.
Page 93
Section 2 Programming Model Floating-Point Status/Control Register (FPSCR) BIt: Cause Initial value: R/W: BIt: Cause Enable (EN) Flag Initial value: R/W: Initial Bit Name Value Description 31 to 22 — All 0 Reserved For details on reading/writing this bit, see General Precautions on Handling of Product.
Page 94
Section 2 Programming Model Initial Bit Name Value Description 17 to 12 Cause All 0 FPU Exception Cause Field FPU Exception Enable Field 11 to 7 Enable (EN) All 0 FPU Exception Flag Field 6 to 2 Flag All 0 Each time an FPU operation instruction is executed, the FPU exception cause field is cleared to 0.
Section 2 Programming Model Memory-Mapped Registers Some control registers are mapped to the following memory areas. Each of the mapped registers has two addresses. H'1C00 0000 to H'1FFF FFFF H'FC00 0000 to H'FFFF FFFF These two areas are used as follows. •...
Section 2 Programming Model Data Formats in Registers Register operands are always longwords (32 bits). When a memory operand is only a byte (8 bits) or a word (16 bits), it is sign-extended into a longword when loaded into a register. Figure 2.6 Formats of Byte Data and Word Data in Register Rev.1.00 Dec.
Section 2 Programming Model Data Formats in Memory Memory data formats are classified into bytes, words, and longwords. Memory can be accessed in an 8-bit byte, 16-bit word, or 32-bit longword form. A memory operand less than 32 bits in length is sign-extended before being loaded into a register.
Section 2 Programming Model Processing States This LSI has major three processing states: the reset state, instruction execution state, and power- down state. Reset State: In this state the CPU is reset. The reset state is divided into the power-on reset state and the manual reset.
Section 2 Programming Model Usage Note 2.7.1 Notes on self-modified codes* This LSI prefetches instructions more drastically than conventional SH-4 to accelerate the processing speed. Therefore if the instruction in the memory is modified and it is executed immediately, then the pre-modified code that is prefetched are likely to be executed. In order to execute the modified code definitely, one of the following sequences should be executed between the execution of modifying codes and modified codes.
Section 3 Instruction Set Section 3 Instruction Set This LSI's instruction set is implemented with 16-bit fixed-length instructions. This LSI can use byte (8-bit), word (16-bit), longword (32-bit), and quadword (64-bit) data sizes for memory access. Single-precision floating-point data (32 bits) can be moved to and from memory using longword or quadword size.
Page 102
Section 3 Instruction Set T Bit: The T bit in SR is used to show the result of a compare operation, and is referenced by a conditional branch instruction. An example of the use of a conditional branch instruction is shown below.
Section 3 Instruction Set Addressing Modes Addressing modes and effective address calculation methods are shown in table 3.2. When a location in virtual memory space is accessed (AT in MMUCR = 1), the effective address is translated into a physical memory address. If multiple virtual memory space systems are selected (SV in MMUCR = 0), the least significant bit of PTEH is also referenced as the access ASID.
Page 104
Section 3 Instruction Set Addressing Instruction Calculation Mode Format Effective Address Calculation Method Formula Register @(disp:4, Rn) Effective address is register Rn contents with Byte: Rn + disp → EA indirect with 4-bit displacement disp added. After disp is displacement zero-extended, it is multiplied by 1 (byte), 2 Word: Rn + (word), or 4 (longword), according to the operand...
Page 105
Section 3 Instruction Set Addressing Instruction Calculation Mode Format Effective Address Calculation Method Formula PC-relative @(disp:8, PC) Effective address is PC + 4 with 8-bit displacement Word: PC + 4 + disp × 2 → with disp added. After disp is zero-extended, it is displacement multiplied by 2 (word), or 4 (longword), according to the operand size.
Page 106
Section 3 Instruction Set Addressing Instruction Calculation Mode Format Effective Address Calculation Method Formula PC-relative disp:12 Effective address is PC + 4 with 12-bit PC + 4 + disp × 2 → Branch- displacement disp added after being sign-extended Target multiplied by 2.
Section 3 Instruction Set Instruction Set Table 3.3 shows the notation used in the SH instruction lists shown in tables 3.4 to 3.13. Table 3.3 Notation Used in Instruction List Item Format Description Instruction OP.Sz SRC, DEST Operation code mnemonic Size SRC: Source operand...
Page 108
Section 3 Instruction Set Item Format Description Privileged mode "Privileged" means the instruction can only be executed in privileged mode. T bit Value of T bit after —: No change instruction execution "New" means the instruction which is newly added in this LSI.
Section 3 Instruction Set Table 3.4 Fixed-Point Transfer Instructions Instruction Operation Instruction Code Privileged T Bit New imm → sign extension → Rn #imm,Rn 1110nnnniiiiiiii — — — (disp × 2 + PC + 4) → sign 1001nnnndddddddd — — —...
Page 110
→ Rn Rm:Rn middle 32 bits → Rn XTRCT Rm,Rn 0010nnnnmmmm1101 — — — The assembler of Renesas uses the value after scaling (×1, ×2, or ×4) as the Note: displacement (disp). Rev.1.00 Dec. 13, 2005 Page 60 of 1286 REJ09B0158-0100...
Section 3 Instruction Set Table 3.8 Branch Instructions Instruction Operation Instruction Code Privileged T Bit When T = 0, disp × 2 + PC + label 10001011dddddddd — — — 4 → PC When T = 1, nop BF/S label Delayed branch;...
Section 4 Pipelining Section 4 Pipelining This LSI is a 2-ILP (instruction-level-parallelism) superscalar pipelining microprocessor. Instruction execution is pipelined, and two instructions can be executed in parallel. Pipelines Figure 4.1 shows the basic pipelines. Normally, a pipeline consists of seven stages: instruction sfetch (I1/I2), decode and register read (ID), execution (E1/E2/E3), and write-back (WB).
Section 4 Pipelining Figure 4.2 shows the instruction execution patterns. Representations in figure 4.2 and their descriptions are listed in table 4.1. Table 4.1 Representations of Instruction Execution Patterns Representation Description CPU EX pipe is occupied CPU LS pipe is occupied (with memory access) CPU LS pipe is occupied (without memory access) Either CPU EX pipe or CPU LS pipe is occupied E1/S1...
Section 4 Pipelining 1 issue cycle + 0 to 2 branch cycles (1-1) BF, BF/S, BT, BT/S, BRA, BSR: In branch instructions that are categorized Note: E1/S1 E2/s2 E3/s3 as (1-1), the number of branch cycles may be reduced by prefetching. (I1) (I2) (ID)
Section 4 Pipelining Parallel-Executability Instructions are categorized into six groups according to the internal function blocks used, as shown in table 4.2. Table 4.3 shows the parallel-executability of pairs of instructions in terms of groups. For example, ADD in the EX group and BRA in the BR group can be executed in parallel. Table 4.2 Instruction Groups Instruction...
Section 4 Pipelining Table 4.3 Combination of Preceding and Following Instructions Preceding Instruction (addr) Following Instruction (addr+2) Note: The following table shows the parallel-executability of pairs of instructions in this LSI. It is different from table 4.3. Preceding Instruction (addr) FLSR FLSM Following...
Section 4 Pipelining Issue Rates and Execution Cycles Instruction execution cycles are summarized in table 4.4. Instruction Group in the table 4.4 corresponds to the category in the table 4.2. Penalty cycles due to a pipeline stall are not considered in the issue rates and execution cycles in this section. 1.
Section 5 Exception Handling Section 5 Exception Handling Summary of Exception Handling Exception handling processing is handled by a special routine which is executed by a reset, general exception handling, or interrupt. For example, if the executing instruction ends abnormally, appropriate action must be taken in order to return to the original program sequence, or report the abnormality before terminating the processing.
Section 5 Exception Handling 5.2.1 TRAPA Exception Register (TRA) The TRAPA exception register (TRA) consists of 8-bit immediate data (imm) for the TRAPA instruction. TRA is set automatically by hardware when a TRAPA instruction is executed. TRA can also be modified by software. Bit: Initial value: R/W:...
Section 5 Exception Handling 5.2.2 Exception Event Register (EXPEVT) The exception event register (EXPEVT) consists of a 12-bit exception code. The exception code set in EXPEVT is that for a reset or general exception event. The exception code is set automatically by hardware when an exception occurs.
Section 5 Exception Handling 5.2.3 Interrupt Event Register (INTEVT) The interrupt event register (INTEVT) consists of a 14-bit exception code. The exception code is set automatically by hardware when an exception occurs. INTEVT can also be modified by software. Bit: Initial value: R/W: Bit:...
Section 5 Exception Handling Exception Handling Functions 5.3.1 Exception Handling Flow In exception handling, the contents of the program counter (PC), status register (SR), and R15 are saved in the saved program counter (SPC), saved status register (SSR), and saved general register15 (SGR), and the CPU starts execution of the appropriate exception handling routine according to the vector address.
Section 5 Exception Handling Exception Flow 5.5.1 Exception Flow Figure 5.1 shows an outline flowchart of the basic operations in instruction execution and exception handling. For the sake of clarity, the following description assumes that instructions are executed sequentially, one by one. Figure 5.1 shows the relative priority order of the different kinds of exceptions (reset, general exception, and interrupt).
Section 5 Exception Handling 5.5.2 Exception Source Acceptance A priority ranking is provided for all exceptions for use in determining which of two or more simultaneously generated exceptions should be accepted. Five of the general exceptions—general illegal instruction exception, slot illegal instruction exception, general FPU disable exception, slot FPU disable exception, and unconditional trap exception—are detected in the process of instruction decoding, and do not occur simultaneously in the instruction pipeline.
Section 5 Exception Handling 5.5.3 Exception Requests and BL Bit When the BL bit in SR is 0, exceptions and interrupts are accepted. When the BL bit in SR is 1 and an exception other than a user break is generated, the CPU's internal registers and the registers of the other modules are set to their states following a manual reset, and the CPU branches to the same address as in a reset (H'A0000000).
Section 5 Exception Handling Description of Exceptions The various exception handling operations explained here are exception sources, transition address on the occurrence of exception, and processor operation when a transition is made. 5.6.1 Resets Power-On Reset: • Condition: Power-on reset request •...
Page 159
Section 5 Exception Handling Instruction TLB Multiple-Hit Exception: • Source: Multiple ITLB address matches • Transition address: H'A0000000 • Transition operations: The virtual address (32 bits) at which this exception occurred is set in TEA, and the corresponding virtual page number (22 bits) is set in PTEH [31:10]. ASID in PTEH indicates the ASID when this exception occurred.
Section 5 Exception Handling 5.6.2 General Exceptions Data TLB Miss Exception: • Source: Address mismatch in UTLB address comparison • Transition address: VBR + H'00000400 • Transition operations: The virtual address (32 bits) at which this exception occurred is set in TEA, and the corresponding virtual page number (22 bits) is set in PTEH [31:10].
Page 161
Section 5 Exception Handling Instruction TLB Miss Exception: • Source: Address mismatch in ITLB address comparison • Transition address: VBR + H'00000400 • Transition operations: The virtual address (32 bits) at which this exception occurred is set in TEA, and the corresponding virtual page number (22 bits) is set in PTEH [31:10].
Page 162
Section 5 Exception Handling Initial Page Write Exception: • Source: TLB is hit in a store access, but dirty bit D = 0 • Transition address: VBR + H'00000100 • Transition operations: The virtual address (32 bits) at which this exception occurred is set in TEA, and the corresponding virtual page number (22 bits) is set in PTEH [31:10].
Page 163
Section 5 Exception Handling Data TLB Protection Violation Exception: • Source: The access does not accord with the UTLB protection information (PR bits) shown below. Privileged Mode User Mode Only read access possible Access not possible Read/write access possible Access not possible Only read access possible Only read access possible Read/write access possible...
Page 164
Section 5 Exception Handling Instruction TLB Protection Violation Exception: • Source: The access does not accord with the ITLB protection information (PR bits) shown below. Privileged Mode User Mode Access possible Access not possible Access possible Access possible • Transition address: VBR + H'00000100 •...
Page 165
Section 5 Exception Handling Data Address Error: • Sources: Word data access from other than a word boundary (2n +1) Longword data access from other than a longword data boundary (4n +1, 4n + 2, or 4n +3) ...
Page 166
Section 5 Exception Handling Instruction Address Error: • Sources: Instruction fetch from other than a word boundary (2n +1) Instruction fetch from area H'80000000 to H'FFFFFFFF in user mode Area H'E5000000 to H'E5FFFFFF can be accessed in user mode. For details, see section 9, L Memory.
Page 167
Section 5 Exception Handling Unconditional Trap: • Source: Execution of TRAPA instruction • Transition address: VBR + H'00000100 • Transition operations: As this is a processing-completion-type exception, the PC contents for the instruction following the TRAPA instruction are saved in SPC. The value of SR and R15 when the TRAPA instruction is executed are saved in SSR and SGR.
Page 168
Section 5 Exception Handling General Illegal Instruction Exception: • Sources: Decoding of an undefined instruction not in a delay slot Delayed branch instructions: JMP, JSR, BRA, BRAF, BSR, BSRF, RTS, RTE, BT/S, BF/S Undefined instruction: H'FFFD Decoding in user mode of a privileged instruction not in a delay slot Privileged instructions: LDC, STC, RTE, LDTLB, SLEEP, but excluding LDC/STC instructions that access GBR •...
Page 169
Section 5 Exception Handling Slot Illegal Instruction Exception: • Sources: Decoding of an undefined instruction in a delay slot Delayed branch instructions: JMP, JSR, BRA, BRAF, BSR, BSRF, RTS, RTE, BT/S, BF/S Undefined instruction: H'FFFD Decoding of an instruction that modifies PC in a delay slot Instructions that modify PC: JMP, JSR, BRA, BRAF, BSR, BSRF, RTS, RTE, BT, BF, BT/S, BF/S, TRAPA, LDC Rm,SR, LDC.L @Rm+,SR, ICBI, PREFI ...
Page 170
Section 5 Exception Handling General FPU Disable Exception: • Source: Decoding of an FPU instruction* not in a delay slot with SR.FD =1 • Transition address: VBR + H'00000100 • Transition operations: The PC and SR contents for the instruction at which this exception occurred are saved in SPC and SSR.
Page 171
Section 5 Exception Handling Slot FPU Disable Exception: • Source: Decoding of an FPU instruction in a delay slot with SR.FD =1 • Transition address: VBR + H'00000100 • Transition operations: The PC contents for the preceding delayed branch instruction are saved in SPC. The SR and R15 contents when this exception occurred are saved in SSR and SGR.
Page 172
Section 5 Exception Handling Pre-Execution User Break/Post-Execution User Break: • Source: Fulfilling of a break condition set in the user break controller • Transition address: VBR + H'00000100, or DBR • Transition operations: In the case of a post-execution break, the PC contents for the instruction following the instruction at which the breakpoint is set are set in SPC.
Page 173
Section 5 Exception Handling FPU Exception: • Source: Exception due to execution of a floating-point operation • Transition address: VBR + H'00000100 • Transition operations: The PC and SR contents for the instruction at which this exception occurred are saved in SPC and SSR .
Section 5 Exception Handling 5.6.3 Interrupts NMI (Nonmaskable Interrupt): • Source: NMI pin edge detection • Transition address: VBR + H'00000600 • Transition operations: The PC and SR contents for the instruction immediately after this exception is accepted are saved in SPC and SSR. The R15 contents at this time are saved in SGR. Exception code H'1C0 is set in INTEVT.
Section 5 Exception Handling General Interrupt Request: • Source: The interrupt mask level bits setting in SR is smaller than the interrupt level of interrupt request, and the BL bit in SR is 0 (accepted at instruction boundary). • Transition address: VBR + H'00000600 •...
Page 176
Section 5 Exception Handling • Instructions that make two accesses to memory With MAC instructions, memory-to-memory arithmetic/logic instructions, TAS instructions, and MOVUA instructions, two data transfers are performed by a single instruction, and an exception will be detected for each of these data transfers. In these cases, therefore, the following order is used to determine priority.
Section 5 Exception Handling Usage Notes 1. Return from exception handling A. Check the BL bit in SR with software. If SPC and SSR have been saved to memory, set the BL bit in SR to 1 before restoring them. B.
Page 178
Section 5 Exception Handling 5. Changing the SR register value and accepting exception A. When the MD or BL bit in the SR register is changed by the LDC instruction, the acceptance of the exception is determined by the changed SR value, starting from the next instruction.* In the completion type exception, an exception is accepted after the next instruction has been executed.
Section 6 Floating-Point Unit (FPU) Section 6 Floating-Point Unit (FPU) Features The FPU has the following features. • Conforms to IEEE754 standard • 32 single-precision floating-point registers (can also be referenced as 16 double-precision registers) • Two rounding modes: Round to Nearest and Round to Zero •...
Section 6 Floating-Point Unit (FPU) Data Formats 6.2.1 Floating-Point Format A floating-point number consists of the following three fields: • Sign bit (s) • Exponent field (e) • Fraction field (f) The SH-4A can handle single-precision and double-precision floating-point numbers, using the formats shown in figures 6.1 and 6.2.
Page 181
Section 6 Floating-Point Unit (FPU) Table 6.1 Floating-Point Number Formats and Parameters Parameter Single-Precision Double-Precision Total bit width 32 bits 64 bits Sign bit 1 bit 1 bit Exponent field 8 bits 11 bits Fraction field 23 bits 52 bits Precision 24 bits 53 bits...
Section 6 Floating-Point Unit (FPU) 6.2.2 Non-Numbers (NaN) Figure 6.3 shows the bit pattern of a non-number (NaN). A value is NaN in the following case: • Sign bit: Don't care • Exponent field: All bits are 1 • Fraction field: At least one bit is 1 The NaN is a signaling NaN (sNaN) if the MSB of the fraction field is 1, and a quiet NaN (qNaN) if the MSB is 0.
Section 6 Floating-Point Unit (FPU) See SH-4A Software Manual for details of floating-point operations when a non-number (NaN) is input. 6.2.3 Denormalized Numbers For a denormalized number floating-point value, the exponent field is expressed as 0, and the fraction field as a non-zero value. When the DN bit in FPSCR of the FPU is 1, a denormalized number (source operand or operation result) is always positive or negative zero in a floating-point operation that generates a value (an operation other than transfer instructions between registers, FNEG, or FABS).
Section 6 Floating-Point Unit (FPU) Register Descriptions 6.3.1 Floating-Point Registers Figure 6.4 shows the floating-point register configuration. There are thirty-two 32-bit floating- point registers comprised with two banks: FPR0_BANK0 to FPR15_BANK0, and FPR0_BANK1 to FPR15_BANK1. These thirty-two registers are referenced as FR0 to FR15, DR0/2/4/6/8/10/12/14, FV0/4/8/12, XF0 to XF15, XD0/2/4/6/8/10/12/14, and XMTRX.
Section 6 Floating-Point Unit (FPU) 6.3.2 Floating-Point Status/Control Register (FPSCR) bit: Cause Initial value: R/W: bit: Cause Enable (EN) Flag Initial value: R/W: Bit Name Initial Value Description 31 to 22 — All 0 Reserved These bits are always read as 0. The write value should always be 0.
Page 188
Section 6 Floating-Point Unit (FPU) Bit Name Initial Value Description 17 to 12 Cause All 0 FPU Exception Cause Field FPU Exception Enable Field 11 to 7 Enable All 0 FPU Exception Flag Field 6 to 2 Flag All 0 Each time an FPU operation instruction is executed, the FPU exception cause field is cleared to 0.
Section 6 Floating-Point Unit (FPU) Table 6.3 Bit Allocation for FPU Exception Handling Invalid Division Overflow Underflow Inexact Field Name Error (E) Operation (V) by Zero (Z) Cause FPU exception Bit 17 Bit 16 Bit 15 Bit 14 Bit 13 Bit 12 cause field Enable...
Section 6 Floating-Point Unit (FPU) Rounding In a floating-point instruction, rounding is performed when generating the final operation result from the intermediate result. Therefore, the result of combination instructions such as FMAC, FTRV, and FIPR will differ from the result when using a basic instruction such as FADD, FSUB, or FMUL.
Section 6 Floating-Point Unit (FPU) Floating-Point Exceptions 6.5.1 General FPU Disable Exceptions and Slot FPU Disable Exceptions FPU-related exceptions are occurred when an FPU instruction is executed with SR.FD set to 1. When the FPU instruction is in other than delayed slot, the general FPU disable exception is occurred.
Page 193
Section 6 Floating-Point Unit (FPU) • Underflow (U): FPSCR.Enable.U = 1 and instruction with possibility of operation result underflow • Inexact exception (I): FPSCR.Enable.I = 1 and instruction with possibility of inexact operation result All exception events that originate in the FPU are assigned as the same exception event. The meaning of an exception is determined by software by reading from FPSCR and interpreting the information it contains.
Section 6 Floating-Point Unit (FPU) Graphics Support Functions The SH-4A supports two kinds of graphics functions: new instructions for geometric operations, and pair single-precision transfer instructions that enable high-speed data transfer. 6.6.1 Geometric Operation Instructions Geometric operation instructions perform approximate-value computations. To enable high-speed computation with a minimum of hardware, the SH-4A ignores comparatively small values in the partial computation results of four multiplications.
Section 6 Floating-Point Unit (FPU) • Matrix (4 × 4) × matrix (4 × 4): This operation requires the execution of four FTRV instructions. Since an inexact exception is not detected by an FIRV instruction, the inexact exception (I) bit in both the FPU exception cause field and flag field are always set to 1 when an FTRV instruction is executed.
Page 196
Section 6 Floating-Point Unit (FPU) Rev.1.00 Dec. 13, 2005 Page 146 of 1286 REJ09B0158-0100...
Section 7 Memory Management Unit (MMU) Section 7 Memory Management Unit (MMU) This LSI supports an 8-bit address space identifier, a 32-bit virtual address space, and a 29-bit physical address space. Address translation from virtual addresses to physical addresses is enabled by the memory management unit (MMU) in this LSI.
Page 198
Section 7 Memory Management Unit (MMU) When address translation from virtual memory to physical memory is performed using the MMU, it may happen that the translation information has not been recorded in the MMU, or the virtual memory of a different process is accessed by mistake. In such cases, the MMU will generate an exception, change the physical memory mapping, and record the new address translation information.
Section 7 Memory Management Unit (MMU) Virtual Memory Physical Process 1 Physical Memory Physical Process 1 Memory Memory Process 1 Virtual Physical Process 1 Process 1 Memory Memory Physical Memory Process 2 Process 2 Process 3 Process 3 Figure 7.1 Role of MMU 7.1.1 Address Spaces Virtual Address Space: This LSI supports a 32-bit virtual address space, and can access a 4-...
Section 7 Memory Management Unit (MMU) Mapping from the virtual address space to the 29-bit physical address space is carried out using the TLB. Physical address space H'0000 0000 H'0000 0000 Area 0 Area 1 Area 2 Area 3 U0 area Area 4 P0 area Cacheable...
Section 7 Memory Management Unit (MMU) Physical address space H'0000 0000 H'0000 0000 Area 0 Area 1 Area 2 Area 3 P0 area U0 area Cacheable Area 4 Cacheable Address translation possible Area 5 Address translation possible Area 6 Area 7 H'8000 0000 H'8000 0000 P1 area...
Page 202
Section 7 Memory Management Unit (MMU) • P0, P3, and U0 Areas: The P0, P3, and U0 areas allow address translation using the TLB and access using the cache. When the MMU is disabled, replacing the upper 3 bits of an address with 0s gives the corresponding physical address.
Section 7 Memory Management Unit (MMU) The area from H'F400 0000 to H'F4FF FFFF is used for direct access to the operand cache address array. For details, see section 8.6.3, OC Address Array. The area from H'F500 0000 to H'F5FF FFFF is used for direct access to the operand cache data array.
Page 205
Section 7 Memory Management Unit (MMU) Address Translation: When the MMU is used, the virtual address space is divided into units called pages, and translation to physical addresses is carried out in these page units. The address translation table in external memory contains the physical addresses corresponding to virtual addresses and additional information such as memory protection codes.
Section 7 Memory Management Unit (MMU) 7.2.1 Page Table Entry High Register (PTEH) PTEH consists of the virtual page number (VPN) and address space identifier (ASID). When an MMU exception or address error exception occurs, the VPN of the virtual address at which the exception occurred is set in the VPN bit by hardware.
Section 7 Memory Management Unit (MMU) Initial Bit Name Value Description 31 to 10 Virtual Page Number 9, 8 All 0 Reserved These bits are always read as 0. The write value should always be 0. 7 to 0 ASID Address Space Identifier 7.2.2...
Section 7 Memory Management Unit (MMU) Initial Bit Name Value Description Page Management Information The meaning of each bit is same as that of corresponding bit in Common TLB (UTLB). For details, see section 7.3, TLB Functions. ...
Section 7 Memory Management Unit (MMU) 7.2.5 MMU Control Register (MMUCR) The individual bits perform MMU settings as shown below. Therefore, MMUCR rewriting should be performed by a program in the P1 or P2 area. After MMUCR has been updated, execute one of the following three methods before an access (including an instruction fetch) to the P0, P3, U0, or store queue area is performed.
Page 211
Section 7 Memory Management Unit (MMU) Initial Bit Name Value Description 31 to 26 LRUI All 0 Least Recently Used ITLB These bits indicate the ITLB entry to be replaced. The LRU (least recently used) method is used to decide the ITLB entry to be replaced in the event of an ITLB miss.
Page 212
Section 7 Memory Management Unit (MMU) Initial Bit Name Value Description 17, 16 All 0 Reserved These bits are always read as 0. The write value should always be 0. 15 to 10 All 0 UTLB Replace Counter These bits serve as a random counter for indicating the UTLB entry for which replacement is to be performed with an LDTLB instruction.
Page 213
Section 7 Memory Management Unit (MMU) Initial Bit Name Value Description Reserved This bit is always read as 0. The write value should always be 0. Address Translation Enable Bit These bits enable or disable the MMU. 0: MMU disabled 1: MMU enabled MMU exceptions are not generated when the AT bit is 0.
Section 7 Memory Management Unit (MMU) 7.2.6 Physical Address Space Control Register (PASCR) PASCR controls the operation in the physical address space. Bit: Initial value: R/W: Bit: Initial value: R/W: Initial Bit Name Value Description 31 to 8 All 0 Reserved These bits are always read as 0.
Section 7 Memory Management Unit (MMU) 7.2.7 Instruction Re-Fetch Inhibit Control Register (IRMCR) When the specific resource is changed, IRMCR controls whether the instruction fetch is performed again for the next instruction. The specific resource means the part of control registers, TLB, and cache.
Page 216
Section 7 Memory Management Unit (MMU) Initial Bit Name Value Description Re-Fetch Inhibit after LDTLB Execution This bit controls whether re-fetch is performed for the next instruction after the LDTLB instruction has been executed. 0: Re-fetch is performed 1: Re-fetch is not performed Re-Fetch Inhibit after Writing Memory-Mapped TLB This bit controls whether re-fetch is performed for the next instruction after writing memory-mapped...
Section 7 Memory Management Unit (MMU) TLB Functions 7.3.1 Unified TLB (UTLB) Configuration The UTLB is used for the following two purposes: 1. To translate a virtual address to a physical address in a data access 2. As a table of address translation information to be recorded in the ITLB in the event of an ITLB miss The UTLB is so called because of its use for the above two purposes.
Page 218
Section 7 Memory Management Unit (MMU) • SH: Share status bit When 0, pages are not shared by processes. When 1, pages are shared by processes. • SZ[1:0]: Page size bits Specify the page size. 00: 1-Kbyte page 01: 4-Kbyte page 10: 64-Kbyte page 11: 1-Mbyte page •...
Section 7 Memory Management Unit (MMU) 1: Cacheable When the control register area is mapped, this bit must be cleared to 0. • D: Dirty bit Indicates whether a write has been performed to a page. 0: Write has not been performed 1: Write has been performed •...
Section 7 Memory Management Unit (MMU) 7.3.2 Instruction TLB (ITLB) Configuration The ITLB is used to translate a virtual address to a physical address in an instruction access. Information in the address translation table located in the UTLB is cached into the ITLB. Figure 7.8 shows the ITLB configuration.
Section 7 Memory Management Unit (MMU) 7.3.3 Address Translation Method Figure 7.9 shows a flowchart of a memory access using the UTLB. Data access to virtual address (VA) VA is VA is VA is VA is in P0, U0, in P4 area in P2 area in P1 area or P3 area...
Section 7 Memory Management Unit (MMU) Figure 7.10 shows a flowchart of a memory access using the ITLB. Instruction access to virtual address (VA) VA is in P0, U0, VA is VA is VA is or P3 area in P1 area in P4 area in P2 area MMUCR.AT = 1...
Section 7 Memory Management Unit (MMU) MMU Functions 7.4.1 MMU Hardware Management This LSI supports the following MMU functions. 1. The MMU decodes the virtual address to be accessed by software, and performs address translation by controlling the UTLB/ITLB in accordance with the MMUCR settings. 2.
Section 7 Memory Management Unit (MMU) 7.4.3 MMU Instruction (LDTLB) A TLB load instruction (LDTLB) is provided for recording UTLB entries. When an LDTLB instruction is issued, this LSI copies the contents of PTEH and PTEL to the UTLB entry indicated by the URC bit in MMUCR.
Section 7 Memory Management Unit (MMU) 7.4.5 Avoiding Synonym Problems When 1- or 4-Kbyte pages are recorded in TLB entries, a synonym problem may arise. The problem is that, when a number of virtual addresses are mapped onto a single physical address, the same physical address data is recorded in a number of cache entries, and it becomes impossible to guarantee data integrity.
Section 7 Memory Management Unit (MMU) MMU Exceptions There are seven MMU exceptions: instruction TLB multiple hit exception, instruction TLB miss exception, instruction TLB protection violation exception, data TLB multiple hit exception, data TLB miss exception, data TLB protection violation exception, and initial page write exception. Refer to figures 7.9 and 7.10 for the conditions under which each of these exceptions occurs.
Section 7 Memory Management Unit (MMU) 7.5.2 Instruction TLB Miss Exception An instruction TLB miss exception occurs when address translation information for the virtual address to which an instruction access is made is not found in the UTLB entries by the hardware ITLB miss handling routine.
Section 7 Memory Management Unit (MMU) 7.5.3 Instruction TLB Protection Violation Exception An instruction TLB protection violation exception occurs when, even though an ITLB entry contains address translation information matching the virtual address to which an instruction access is made, the actual access type is not permitted by the access right specified by the PR bit. The instruction TLB protection violation exception processing carried out by hardware and software is shown below.
Section 7 Memory Management Unit (MMU) 7.5.4 Data TLB Multiple Hit Exception A data TLB multiple hit exception occurs when more than one UTLB entry matches the virtual address to which a data access has been made. When a data TLB multiple hit exception occurs, a reset is executed, and cache coherency is not guaranteed.
Section 7 Memory Management Unit (MMU) 9. Branches to the address obtained by adding offset H'0000 0400 to the contents of VBR, and starts the data TLB miss exception handling routine. Software Processing (Data TLB Miss Exception Handling Routine): Software is responsible for searching the external memory page table and assigning the necessary page table entry.
Section 7 Memory Management Unit (MMU) 9. Branches to the address obtained by adding offset H'0000 0100 to the contents of VBR, and starts the data TLB protection violation exception handling routine. Software Processing (Data TLB Protection Violation Exception Handling Routine): Resolve the data TLB protection violation, execute the exception handling return instruction (RTE), terminate the exception handling routine, and return control to the normal flow.
Section 7 Memory Management Unit (MMU) 4. When the entry to be replaced in entry replacement is specified by software, write that value to the URC bits in MMUCR. If URC is greater than URB at this time, the value should be changed to an appropriate value after issuing an LDTLB instruction.
Section 7 Memory Management Unit (MMU) 7.6.1 ITLB Address Array The ITLB address array is allocated to addresses H'F200 0000 to H'F2FF FFFF in the P4 area. An address array access requires a 32-bit address field specification (when reading or writing) and a 32-bit data field specification (when writing).
Section 7 Memory Management Unit (MMU) 7.6.2 ITLB Data Array The ITLB data array is allocated to addresses H'F300 0000 to H'F37F FFFF in the P4 area. A data array access requires a 32-bit address field specification (when reading or writing) and a 32-bit data field specification (when writing).
Section 7 Memory Management Unit (MMU) 7.6.3 UTLB Address Array The UTLB address array is allocated to addresses H'F600 0000 to H'F60F FFFF in the P4 area. An address array access requires a 32-bit address field specification (when reading or writing) and a 32-bit data field specification (when writing).
Section 7 Memory Management Unit (MMU) 7.7.1 Overview of 32-Bit Address Extended Mode In 32-bit address extended mode, the privileged space mapping buffer (PMB) is introduced. The PMB maps virtual addresses in the P1 or P2 area which are not translated in 29-bit address mode to the 32-bit physical address space.
Section 7 Memory Management Unit (MMU) With a 512-Mbyte page, PPN[31:29] are valid. • C: Cacheability bit Indicates whether a page is cacheable. 0: Not cacheable 1: Cacheable • WT: Write-through bit Specifies the cache write mode. 0: Copy-back mode 1: Write-through mode •...
Section 7 Memory Management Unit (MMU) VPN[31:30] is 10 or not. When an entry from the PMB is recorded in the ITLB, H′00, 01, and 1 are recorded in the ASID, PR, and SH fields which do not exist in the PMB, respectively. 7.7.5 Memory-Mapped PMB Configuration To enable the PMB to be managed by software, its contents are allowed to be read from and...
Section 7 Memory Management Unit (MMU) 12 11 Address field 1 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Data field VPN: Physical page number : Reserved bits (write value should be 0 Validity bit and read value is undefined )
Section 7 Memory Management Unit (MMU) 7.7.6 Notes on Using 32-Bit Address Extended Mode When using 32-bit address extended mode, note that the items described in this section are extended or changed as follows. PASCR: The SE bit is added in bit 31 in the control register (PASCR). The bits 6 to 0 of the UB in the PASCR are invalid (Note that the bit 7 of the UB is still valid).
Page 245
Section 7 Memory Management Unit (MMU) ITLB: The PPN field in the ITLB is extended to bits 31 to 10. UTLB: The PPN field in the UTLB is extended to bits 31 to 10. The same UB bit as that in the PMB is added in each entry of the UTLB.
Page 246
Section 7 Memory Management Unit (MMU) 4. Note that the V bit is mapped to both address array and data array in PMB registration. That is, first write 0 to the V bit in one of arrays and then write 1 to the V bit in another array. Rev.1.00 Dec.
Section 8 Caches Section 8 Caches This LSI has an on-chip 32-Kbyte instruction cache (IC) for instructions and an on-chip 32-Kbyte operand cache (OC) for data. Features The features of the cache are shown in table 8.1. This LSI supports two 32-byte store queues (SQs) to perform high-speed writes to external memory.
Section 8 Caches The operand cache of this LSI uses the 4-way set-associative, each way comprising 256 cache lines. Figure 8.1 shows the configuration of the operand cache. The instruction cache is 4-way set-associative, each way is comprising 256 cache lines. Figure 8.2 shows the configuration of the instruction cache.
Section 8 Caches • Data array The data field holds 32 bytes (256 bits) of data per cache line. The data array is not initialized by a power-on or manual reset. • LRU In a 4-way set-associative method, up to 4 items of data can be registered in the cache at each entry address.
Section 8 Caches 8.2.1 Cache Control Register (CCR) CCR controls the cache operating mode, the cache write mode, and invalidation of all cache entries. CCR modifications must only be made by a program in the non-cacheable P2 area. After CCR has been updated, execute one of the following three methods before an access (including an instruction fetch) to the cacheable area is performed.
Page 252
Section 8 Caches Initial Bit Name Value Description 10, 9 All 0 Reserved These bits are always read as 0. The write value should always be 0. IC Enable Bit Selects whether the IC is used. Note however when address translation is performed, the IC cannot be used unless the C bit in the page management information is also 1.
Section 8 Caches 8.2.2 Queue Address Control Register 0 (QACR0) QACR0 specifies the area maped which store queue 0 (SQ0) is mapped when the MMU is disabled. Bit: Initial value: R/W: Bit: AREA0 Initial value: R/W: Initial Bit Name Value Description ...
Section 8 Caches 8.2.3 Queue Address Control Register 1 (QACR1) QACR1 specifies the area onto which store queue 1 (SQ1) is mapped when the MMU is disabled. Bit: Initial value: R/W: Bit: AREA1 Initial value: R/W: Initial Bit Name Value Description ...
Section 8 Caches 8.2.4 On-Chip Memory Control Register (RAMCR) RAMCR controls the number of ways in the IC and OC. RAMCR modifications must only be made by a program in the non-cacheable P2 area. After RAMCR has been updated, execute one of the following three methods before an access (including an instruction fetch) to the cacheable area or the L memory area is performed.
Page 256
Section 8 Caches Initial Bit Name Value Description 31 to 10 All 0 Reserved These bits are always read as 0. The write value should always be 0. On-Chip Memory Access Mode Bit For details, see section 9.4, L Memory Protective Functions.
Section 8 Caches Operand Cache Operation 8.3.1 Read Operation When the Operand Cache (OC) is enabled (OCE = 1 in CCR) and data is read from a cacheable area, the cache operates as follows: 1. The tag, V bit, U bit, and LRU bits on each way are read from the cache line indexed by virtual address bits [12:5].
Section 8 Caches 5. Cache miss (with write-back) The tag and data field of the cache line on the way which is selected to replace are saved in the write-back buffer. Then data is read into the cache line on the way which is selected to replace from the physical address space corresponding to the virtual address.
Section 8 Caches 5. Cache miss (with write-back) The tag and data field of the cache line on the way which is selected to replace are saved in the write-back buffer. Then data is read into the cache line on the way which is selected to replace from the physical address space corresponding to the virtual address.
Page 260
Section 8 Caches 5. Cache miss (copy-back, no write-back) A data write in accordance with the access size is performed for the data of the data field on the hit way which is indexed by virtual address bits [4:0]. Then, the data, excluding the cache- missed data which is written already, is read into the cache line on the way which is selected to replace from the physical address space corresponding to the virtual address.
Section 8 Caches 8.3.4 Write-Back Buffer In order to give priority to data reads to the cache and improve performance, this LSI has a write- back buffer which holds the relevant cache entry when it becomes necessary to purge a dirty cache entry into external memory as the result of a cache miss.
Section 8 Caches Instruction Cache Operation 8.4.1 Read Operation When the IC is enabled (ICE = 1 in CCR) and instruction fetches are performed from a cacheable area, the instruction cache operates as follows: 1. The tag, V bit, U bit and LRU bits on each way are read from the cache line indexed by virtual address bits [12:5].
Section 8 Caches 8.4.2 Prefetch Operation When the IC is enabled (ICE = 1 in CCR) and instruction prefetches are performed from a cacheable area, the instruction cache operates as follows: 1. The tag, V bit, Ubit and LRU bits on each way are read from the cache line indexed by virtual address bits [12:5].
Section 8 Caches Cache Operation Instruction 8.5.1 Coherency between Cache and External Memory Coherency between cache and external memory should be assured by software. In this LSI, the following six instructions are supported for cache operations. Details of these instructions are given in the Software Manual.
Section 8 Caches PURGE transaction: When the operand cache is enabled, the PURGE transaction checks the operand cache and invalidates the hit entry. If the invalidated entry is dirty, the data is written back to the external memory. If the transaction is not hit to the cache, it is no-operation. FLUSH transaction: When the operand cache is enabled, the FLUSH transaction checks the operand cache and if the hit line is dirty, then the data is written back to the external memory.
Section 8 Caches Memory-Mapped Cache Configuration To enable the IC and OC to be managed by software, the IC contents can be read from or written to by a program in the P2 area by means of a MOV instruction in privileged mode. Operation is not guaranteed if access is made from a program in another area.
Section 8 Caches 8.6.1 IC Address Array The IC address array is allocated to addresses H'F000 0000 to H'F0FF FFFF in the P4 area. An address array access requires a 32-bit address field specification (when reading or writing) and a 32-bit data field specification.
Section 8 Caches 5 4 3 2 1 0 Address field 1 1 1 1 0 0 0 0 Entry * * * * * * * * * 10 9 Data field : Validity bit : Association bit : Reserved bits (write value should be 0 and read value is undefined ) : Don't care Figure 8.5 Memory-Mapped IC Address Array Rev.1.00 Dec.
Section 8 Caches 8.6.2 IC Data Array The IC data array is allocated to addresses H'F100 0000 to H'F1FF FFFF in the P4 area. A data array access requires a 32-bit address field specification (when reading or writing) and a 32-bit data field specification.
Section 8 Caches 8.6.3 OC Address Array The OC address array is allocated to addresses H'F400 0000 to H'F4FF FFFF in the P4 area. An address array access requires a 32-bit address field specification (when reading or writing) and a 32-bit data field specification.
Section 8 Caches Note: This function may not be supported in the future SuperH Series. Therefore, it is recommended that the OCBI, OCBP, or OCBWB instruction should be used to operate the OC definitely by reporting data TLB miss exception. 1312 5 4 3 2 1 0 Address field...
Section 8 Caches 8.6.4 OC Data Array The OC data array is allocated to addresses H'F500 0000 to H'F5FF FFFF in the P4 area. A data array access requires a 32-bit address field specification (when reading or writing) and a 32-bit data field specification.
Section 8 Caches Store Queues This LSI supports two 32-byte store queues (SQs) to perform high-speed writes to external memory. 8.7.1 SQ Configuration There are two 32-byte store queues, SQ0 and SQ1, as shown in figure 8.9. These two store queues can be set independently.
Section 8 Caches 8.7.3 Transfer to External Memory Transfer from the SQs to external memory can be performed with a prefetch instruction (PREF). Issuing a PREF instruction for addresses H'E000 0000 to H'E3FF FFFC in the P4 area starts a transfer from the SQs to external memory.
Section 8 Caches 8.7.4 Determination of SQ Access Exception Determination of an exception in a write to an SQ or transfer to external memory (PREF instruction) is performed as follows according to whether the MMU is enabled or disabled. If an exception occurs during a write to an SQ, the SQ contents before the write are retained.
Section 8 Caches Notes on Using 32-Bit Address Extended Mode In 32-bit address extended mode, the items described in this section are extended as follows. 1. The tag bits [28:10] (19 bits) in the IC and OC are extended to bits [31:10] (22 bits). 2.
Section 9 L Memory Section 9 L Memory This LSI includes on-chip L-memory which stores instructions or data. Features • Capacity • Total L memory capacity is 16 Kbytes. The L memory is divided into two pages (pages 0 and 1). •...
Section 9 L Memory Register Descriptions The following registers are related to L memory. Table 9.2 Register Configuration Access Register Name Abbreviation P4 Address* Area 7 Address* Size On-chip memory control RAMCR H'FF000074 H'1F000074 register L memory transfer source LSA0 H'FF000050 H'1F000050 address register 0...
Section 9 L Memory 9.2.1 On-Chip Memory Control Register (RAMCR) RAMCR controls the protective functions in the L memory. Bit : Initial value : R/W: Bit : IC2W OC2W Initial value : R/W: Initial Bit Name Value Description 31to10 — All 0 Reserved These bits are always read as 0.
Section 9 L Memory 9.2.2 L Memory Transfer Source Address Register 0 (LSA0) When MMUCR.AT = 0 or RAMCR.RP = 0, the LSA0 specifies the transfer source physical address for block transfer to page 0 of the L memory. Bit : L0SADR Initial value : R/W:...
Page 281
Section 9 L Memory Initial Bit Name Value Description 5 to 0 L0SSZ Undefined R/W L Memory Page 0 Block Transfer Source Address Select When MMUCR.AT = 0 or RAMCR.RP = 0, these bits select whether the operand addresses or L0SADR values are used as bits 15 to 10 of the transfer source physical address for block transfer to the L memory.
Section 9 L Memory 9.2.3 L Memory Transfer Source Address Register 1 (LSA1) When MMUCR.AT = 0 or RAMCR.RP = 0, the LSA1 specifies the transfer source physical address for block transfer to page 1 in the L memory. Bit : L1DADR Initial value : R/W:...
Page 283
Section 9 L Memory Initial Bit Name Value Description 5 to 0 L1SSZ Undefined R/W L Memory Page 1 Block Transfer Source Address Select When MMUCR.AT = 0 or RAMCR.RP = 0, these bits select whether the operand addresses or L1SADR values are used as bits 15 to 10 of the transfer source physical address for block transfer to page 1 in the L memory.
Section 9 L Memory 9.2.4 L Memory Transfer Destination Address Register 0 (LDA0) When MMUCR.AT = 0 or RAMCR.RP = 0, LDA0 specifies the transfer destination physical address for block transfer to page 0 of the L memory. Bit : L0SADR Initial value : R/W:...
Page 285
Section 9 L Memory Initial Bit Name Value Description 5 to 0 L0DSZ Undefined R/W L Memory Page 0 Block Transfer Destination Address Select When MMUCR.AT = 0 or RAMCR.RP = 0, these bits select whether the operand addresses or L0DADR values are used as bits 15 to 10 of the transfer destination physical address for block transfer to page 0 in the L memory.
Section 9 L Memory 9.2.5 L Memory Transfer Destination Address Register 1 (LDA1) When MMUCR.AT = 0 or RAMCR.RP = 0, LDA1 specifies the transfer destination physical address for block transfer to page 1 in the L memory. Bit : L1SADR Initial value : R/W:...
Page 287
Section 9 L Memory Initial Bit Name Value Description 5 to 0 L1DSZ Undefined R/W L Memory Page 1 Block Transfer Destination Address Select When MMUCR.AT = 0 or RAMCR.RP = 0, these bits select whether the operand addresses or L1DADR values are used as bits 15 to 10 of the transfer destination physical address for block transfer to page 1 in the L memory.
Section 9 L Memory Operation 9.3.1 Access from the CPU and FPU L memory access from the CPU and FPU is direct via the instruction bus and operand bus by means of the virtual address. As long as there is no conflict on the page, the L memory is accessed in one cycle.
Page 289
Section 9 L Memory When the PREF instruction is issued to the L memory area, address conversion is performed in order to generate the physical address bits [28:10] in accordance with the SZ bit specification. The physical address bits [9:5] are generated from the virtual address prior to address conversion. The physical address bits [4:0] are fixed to 0.
Section 9 L Memory L Memory Protective Functions This LSI implements the following protective functions to the L memory by using the on-chip memory access mode bit (RMD) and the on-chip memory protection enable bit (RP) in the on-chip memory control register (RAMCR). •...
Section 9 L Memory Usage Notes 9.5.1 Page Conflict In the event of simultaneous access to the same page from different buses, page conflict occurs. Although each access is completed correctly, this kind of conflict tends to lower L memory accessibility.
Page 292
Section 9 L Memory Rev.1.00 Dec. 13, 2005 Page 242 of 1286 REJ09B0158-0100...
Section 10 Interrupt Controller (INTC) Section 10 Interrupt Controller (INTC) The interrupt controller (INTC) determines the priority of interrupt sources and controls the flow of interrupt requests to the CPU (SH-4A). The INTC has registers for setting the priority of each of the interrupts and processing of interrupt requests follows the priority order set in these registers by the user.
Section 10 Interrupt Controller (INTC) CPU Exception IRQOUT Output control Handling Input control Interrupt (noise canseler, IRQ/IRL7 to acceptance detection) IRQ/IRL0 Priority determination USERIMASK.UIMASK IRQ/IRL7 and GPIO SR.IMASK Port E6 are multiplexed INTPRI GPIO Port Bus interface E6 to E0 ICR0, ICR1 H1, H0 K5, K4...
Section 10 Interrupt Controller (INTC) 10.1.1 Interrupt Method The basic flow of exception handling for interrupts is as follows. In interrupt exception handling, the contents of the program counter (PC), status register (SR), and R15 are saved in the saved program counter (SPC), saved status register (SSR), and saved general register15 (SGR), and the CPU starts execution of the interrupt exception handling routine at the corresponding vector address.
Section 10 Interrupt Controller (INTC) 10.1.2 Interrupt Types in INTC Table 10.1 shows an example of the interrupt types. The INTC supports both external interrupts and on-chip module interrupts. External interrupts refer to the interrupts input through the external NMI, IRL, and IRQ pins. The IRQ and IRL interrupts are assigned to the same pins in the SH7780.
Page 297
Section 10 Interrupt Controller (INTC) Number of Sources Source (Max.) Priority INTEVT Remarks IRL[7:4] pin = H'9 External Inverse of values on the input H'320 High interrupts interrupt* pins (because the signals are IRL[3:0] pin = H'9 active low) IRL[7:4] pin = H'A H'340 For example IRL[3:0] pin = H'A...
Page 298
Section 10 Interrupt Controller (INTC) Number of Sources Source (Max.) Priority INTEVT Remarks On-chip DMAC(0) 7(5/7) Values set in INT2PRI0 to H'640 DMINT0* module INT2PRI7 H'660 DMINT1* interrupts H'680 DMINT2* H'6A0 DMINT3* H'6C0 DMAE* SCIF-ch0 4 H'700 ERI0* H'720 RXI0* H'740 BRI0* H'760...
Page 299
Section 10 Interrupt Controller (INTC) Number of Sources Source (Max.) Priority INTEVT Remarks On-chip MMCIF Values set in INT2PRI0 to H'D00 FSTAT module INT2PRI7 H'D20 TRAN interrupts H'D40 H'D60 FRDY DMAC(1) 6 (4/6) H'D80 DMINT8* H'DA0 DMINT9* H'DC0 DMINT10* H'DE0 DMINT11* TMU-ch3 1 H'E00...
Section 10 Interrupt Controller (INTC) 10.3.1 Interrupt Control Register 0 (ICR0) ICR0 is a 32-bit readable and partially writable register that sets the input signal detection mode for the external interrupt input pins (IRQ/IRL [7:0]) and NMI pin, and indicates the level being input on the NMI pin.
Page 306
Section 10 Interrupt Controller (INTC) Initial Name Value Description NMIB NMI Block Mode Selects whether an NMI interrupt is held until the BL bit in SR is cleared to 0 or detected immediately when the BL bit in SR of the CPU is set to 1. 0: An NMI interrupt is held when the BL bit in SR is set to 1 (initial value) 1: An NMI interrupt is not held when the BL bit in SR is...
Page 307
Section 10 Interrupt Controller (INTC) Initial Name Value Description IRLM1 IRL Pin Mode 1 Selects whether IRQ/IRL7 to IRQ/IRL4 are used as 4- bit level-encoded interrupt requests or as four independent interrupts. 0: IRQ/IRL7 to IRQ/IRL4 are used as the 4-bit level- encoded interrupt requests (IRL [7:4] interrupt;...
Section 10 Interrupt Controller (INTC) 10.3.2 Interrupt Control Register 1 (ICR1) ICR1 is a 32-bit readable/writable register that specifies the individual input signal detection modes of external interrupt input pins IRQ/IRL7 to IRQ/IRL0. These settings are only valid for pins configured as individual IRQ interrupts; that is, for pins for which the IRLM0 or IRLM1 bit in ICR0 is set to 1.
Section 10 Interrupt Controller (INTC) Note: When an IRQ pin is set for level input (IRQnS1 = 1), the interrupt source is held until the CPU accepts the interrupt (this is also true for other interrupts). Therefore, even if an interrupt source is disabled before this LSI returns from sleep mode, branching of processing to the interrupt handler when this LSI returns from sleep mode is guaranteed.
Section 10 Interrupt Controller (INTC) 10.3.4 Interrupt Source Register (INTREQ) INTREQ is a 32-bit readable and conditionally writable register that indicates which of the IRQ [n] (n = 0 to 7) interrupts is currently asserting a request for the INTC. Even if an interrupt is masked by the setting in INTPRI or INTMSK0, operation of the corresponding INTREQ bit is not affected.
Section 10 Interrupt Controller (INTC) 10.3.5 Interrupt Mask Registers (INTMSK0 to INTMSK2) INTMSK0 to INTMSK2 are 32-bit readable and conditionally writable registers that control mask settings for the interrupt requests. To clear a mask setting for interrupts, write 1 to the corresponding bit in INTMSKCLR0 to INTMSKCLR2.
Page 312
Section 10 Interrupt Controller (INTC) Initial Name Value Description 23 to 0 All 0 Reserved These bits are always read as 0. The write value should always be 0. Note: When the 4-bit encoded interrupt inputs are to be used, write B'1111 to the IM [03:00] or IM [07:04] bits to mask single-pin interrupts in the ranges IRQ/IRL [3:0] or IRQ/IRL [7:4], respectively.
Page 313
Section 10 Interrupt Controller (INTC) • Interrupt mask register 2 (INTMSK2) INTMSK2 settings are valid for particular IRL interrupt codes generated by the pattern of input signals on pins IRL7 to IRL4 or IRL3 to IRL0 and when all IRL interrupts from the corresponding set of pins are not masked by the setting in INTMSK1.
Page 314
Section 10 Interrupt Controller (INTC) Initial Name Value Description IM007 Sets masking of interrupt- [When reading] request generation by IRL3 0: The interrupt is to IRL0 = HLLL (H'8). acceptable. IM006 Sets masking of interrupt- 1: The interrupt is request generation by IRL3 masked.
Page 315
Section 10 Interrupt Controller (INTC) Initial Name Value Description IM111 Sets masking of interrupt- [When reading] request generation by IRL7 0: The interrupt is to IRL4 = LHLL (H'4). acceptable. IM110 Sets masking of interrupt- 1: The interrupt is request generation by IRL7 masked.
Section 10 Interrupt Controller (INTC) 10.3.7 NMI Flag Control Register (NMIFCR) NMIFCR is a 32-bit readable and conditionally writable register that has an NMI flag (NMIFL bit) which can be read or cleared by software. The NMIFL bit is automatically set to 1 by hardware when an NMI interrupt is detected by the INTC.
Page 322
Section 10 Interrupt Controller (INTC) Initial Name Value Description NMIFL R/(W) NMI Interrupt Request Signal Detection Indicates whether an NMI interrupt request signal has been detected. This bit is automatically set to 1 when the INTC detects an NMI interrupt request. Write 0 to clear the bit.
Section 10 Interrupt Controller (INTC) 10.3.8 User Interrupt Mask Level Register (USERIMASK) USERIMASK is a 32-bit readable and conditionally writable register that sets the acceptable interrupt level. When addresses in area 7 are accessed by using the MMU’s address translation function, USERIMASK can be accessed in user mode.
Page 324
Section 10 Interrupt Controller (INTC) Initial Name Value Description 31 to 24 WKEY H'00 When writing a value to bits 7 to 4, always write H'A5 here. These bits are always read as 0. 23 to 8 — All 0 Reserved These bits are always read as 0.
Page 325
Section 10 Interrupt Controller (INTC) 4. Set the UIMASK bits so that B-type interrupts are masked during execution of the device driver that is operating in user mode. 5. Process interrupts with a high priority in the device driver. 6. Clear the UIMASK bits to 0 to return from processing in the device driver. Rev.1.00 Dec.
Section 10 Interrupt Controller (INTC) 10.3.9 On-chip Module Interrupt Priority Registers (INT2PRI0 to INT2PRI7) INT2PRI0 to INT2PRI7 are 32-bit readable/writable registers used to set priorities (levels 31 to 0) for the on-chip module interrupts. INT2PRI0 to INT2PRI7 are initialized to H'0000 0000 by a reset.
Section 10 Interrupt Controller (INTC) 10.3.10 Interrupt Source Register (INT2A0: Not affected by Mask States) INT2A0 is a 32-bit read-only register that indicates interrupt states of interrupt source modules regardless of the corresponding mask states. Even if interrupt masking is set in the interrupt mask register, corresponding bits in INT2A0 indicate source modules for which interrupt conditions have been satisfied (the corresponding interrupt is not generated).
Page 328
Section 10 Interrupt Controller (INTC) Initial Value R/W Source Function Description — PCIC (5) Indicates PCIERR and Indicates interrupt sources for PCIPWD3 to PCIPWD0 the individual peripheral interrupt sources modules (INT2A0 is not affected by the state of the — PCIC (4) Indicates PCIINTD interrupt mask register).
Page 329
Section 10 Interrupt Controller (INTC) Initial Value R/W Source Function Description — Indicates RTC interrupt Indicates interrupt sources for source the individual peripheral modules (INT2A0 is not — TMU channels 3 Indicates the TMU channel affected by the state of the to 5 3 to 5 interrupt sources interrupt mask register).
Section 10 Interrupt Controller (INTC) 10.3.11 Interrupt Source Register (INT2A1: Affected by Mask States) INT2A is a 32-bit read-only register that indicates interrupt states of interrupt source modules for which the interrupts are not masked. Note that if an interrupt mask is set in the interrupt mask register, INT2A1 does not indicate the interrupt state of the source module in the corresponding bit.
Page 331
Section 10 Interrupt Controller (INTC) Initial Value R/W Source Function Description PCIC (5) Indicates PCIERR and Indicates interrupt sources for the PCIPWD3 to PCIPWD0 individual peripheral modules interrupt sources (INT2A1 is affected by the state of the interrupt mask register). PCIC (4) Indicates PCIINTD interrupt source...
Section 10 Interrupt Controller (INTC) Initial Value R/W Source Function Description Indicates the RTC interrupt Indicates interrupt sources for the source individual peripheral modules (INT2A1 is affected by the state of Indicates the TMU channel 3 the interrupt mask register). channels to 5 interrupt source 3 to 5...
Section 10 Interrupt Controller (INTC) Table 10.8 Correspondence between Bits in INT2MSKR and Interrupt Masking Initial Value R/W Target Function Description Masks interrupts for 31 to All 1 (Reserved) These bits are always read as 1. individual modules. The write value should always be 1. [When reading] R/W GPIO Masks the GPIO interrupt...
Page 334
Section 10 Interrupt Controller (INTC) Initial Value R/W Target Function Description R/W RTC Masks the RTC interrupt Masks interrupts for individual modules. R/W TMU channels Masks TMU channels 3 to 5 [When reading] 3 to 5 interrupts 0: No masking R/W TMU channels Masks TMU channels 0 to 2 0 to 2...
Section 10 Interrupt Controller (INTC) 10.3.13 Interrupt Mask Clear Register (INT2MSKCR) INT2MSKCR is a 32-bit write-only register used to clear mask settings in the interrupt mask register. Setting a bit in this register to 1 clears the masking of the corresponding interrupt source. The bits of this register are always read as 0.
Page 336
Section 10 Interrupt Controller (INTC) Initial Value R/W Target Function Description R/W PCIC (2) Clears the PCIINTB interrupt Clears interrupt masking masking for each peripheral module. R/W PCIC (1) Clears the PCIINTA interrupt [When reading] masking Always 0 R/W PCIC (0) Clears the PCISERR interrupt masking [When writing]...
Section 10 Interrupt Controller (INTC) 10.3.14 On-chip Module Interrupt Source Registers (INT2B0 to INT2B7) INT2B0 to INT2B7 are 32-bit read-only registers that indicate more details on sources within interrupt source modules for which the interrupt state is indicated in the interrupt source register. INT2B0 to INT2B7 are not affected by the state of masking in the interrupt mask register.
Page 338
Section 10 Interrupt Controller (INTC) INT2B1: Indicates detailed interrupt sources for the RTC. Module Name Detailed Source Description 31 to 3 (Reserved) Indicates RTC interrupt sources. This register indicates the RTC These bits are always interrupt sources even if the mask read as 0.
Page 339
Section 10 Interrupt Controller (INTC) INT2B3: Indicates detailed interrupt sources for the DMAC. Module Name Detailed Source Description DMAC 31 to 14 (Reserved) Indicates DMAC interrupt sources. This register indicates These bits are always read DMAC interrupt sources even if as 0.
Page 340
Section 10 Interrupt Controller (INTC) INT2B4: Indicates detailed interrupt sources for the PCIC. Module Name Detailed Source Description PCIC 31 to 10 (Reserved) Indicates PCIC interrupt sources. This register indicates the PCIC These bits are always interrupt sources even if a mask read as 0.
Page 341
Section 10 Interrupt Controller (INTC) INT2B5: Indicates detailed interrupt sources for the MMC. Module Name Detailed Source Description MMCIF 31 to 4 (Reserved) Indicates MMC interrupt sources. This register indicates MMC interrupt These bits are always sources even if the mask setting for read as 0.
Page 342
Section 10 Interrupt Controller (INTC) INT2B6: Indicates detailed interrupt sources for the FLCTL. Module Name Detailed Source Description FLCTL 31 to 4 (Reserved) Indicates FLCTL interrupt sources. This register indicates FLCTL These bits are always interrupt sources even if the mask read as 0.
Page 343
Section 10 Interrupt Controller (INTC) INT2B7: Indicates detailed interrupt sources for the GPIO. Description Module Name Detailed Source 31 to 26 GPIO (Reserved) Indicates GPIO interrupt sources. This register indicates the states of PORTE6I GPIO interrupt from port E GPIO interrupt sources even if pin 6.
Section 10 Interrupt Controller (INTC) 10.3.15 GPIO Interrupt Set Register (INT2GPIC) INT2GPIC enables interrupt requests input from the following pins: pins 0 to 6 of port E, pins 0 and 1 of port H, pin 0 of port J, and pins 4 and 5 of port J. A GPIO interrupt is an active low level-sensed signal.
Section 10 Interrupt Controller (INTC) Table 10.10 shows the correspondence between the interrupt input pins and bits in INT2GPIC. Table 10.10 Correspondence between Interrupt Input Pins and Bits in INT2GPIC Initial Value R/W Name Function Description 31 to All 0 R/W (Reserved) These bits are always read Enables a GPIO interrupt...
Section 10 Interrupt Controller (INTC) 10.4 Interrupt Sources There are four types of interrupt sources: NMI, IRQ, IRL, and on-chip modules. Each interrupt has a priority level (16 to 0), with level 16 as the highest and level 1 as the lowest. When level 0 is set, the interrupt is masked and interrupt requests are ignored.
Section 10 Interrupt Controller (INTC) upward compatibility with the “level-sense IRQ mode” of current SH-4 products (here, too, the detection of high or low levels is selectable). Note: When high-or low-level detection is selected, once the interrupt request has been detected, the INTC holds the interrupt request as an interrupt source in INTREQ even if the level on the IRQ interrupt pin has been changed and canceled.
Section 10 Interrupt Controller (INTC) Note: There is no interrupt source register for IRL interrupt requests. When the holding function is in use, however, operation is as follows. If, after detection of an IRL interrupt, the levels on the IRL pins are changed or withdraw the interrupt before it has been accepted by the CPU, the detection circuit retains the highest detected priority level for IRL interrupts until the CPU accepts any interrupt request (IRL or not) or the corresponding mask bit has been set to 1.
Section 10 Interrupt Controller (INTC) interrupt request within this LSI. Processing can be continued without any problem after the execution of an RTE instruction. 10.4.5 Interrupt Priority Levels of On-chip Module Interrupts When any interrupt is generated, the INTC outputs the corresponding interrupt exception code (INTEVT code) to the CPU.
Section 10 Interrupt Controller (INTC) INTC distinguishes between priority levels of H'1A and H'1B, Priority level H'01 acts as an interrupt request mask. although both become the same level after rounding off for the CPU. INTC INTC Priority level: higher (H'1B) lower (H'1A) Priority level: H'01 Priority level:...
Section 10 Interrupt Controller (INTC) 10.5 Operation 10.5.1 Interrupt Sequence The sequence of interrupt operations is described below. Figure 10.4 is the flowchart of the operations. 1. Interrupt request sources send interrupt request signals to the INTC. 2. The INTC selects the interrupt with the highest-priority among the interrupts that have been sent, according to the priority levels set in INTPRI and INT2PRI0 to INT2PRI7.
Section 10 Interrupt Controller (INTC) 10.5.2 Multiple Interrupts When multiple interrupts must be handled, the interrupt handling routine should include the following procedure: 1. Identify the interrupt source by using the INTEVT code as an offset in branching to the corresponding interrupt handling routine.
Section 10 Interrupt Controller (INTC) 10.6 Interrupt Response Time Table 10.13 shows the components of the interrupt response time for the five classes of interrupt in terms of response time. The response time is the interval from generation of an interrupt request until the start of interrupt exception handling;...
Section 10 Interrupt Controller (INTC) 10.7 Usage Notes 10.7.1 To Clear Interrupt Request When Holding Function Selected When an IRQ level-sense interrupt request or IRL level-encoded interrupt request (IRQ/IRL level interrupt request) is generated and the holding function is in use, the interrupt request must be cleared in the interrupt handling routine after it has been accepted.
Section 10 Interrupt Controller (INTC) 10.7.2 Notes on Setting IRQ/IRL[7:0] Pin Function When switching between individual interrupt and level-encoded interrupt functions on the IRQ/IRL[7:0] pins, the INTC may wind up holding an interrupt that was generated by mistake. Therefore, to prevent the detection of such unintentional interrupts, mask all IRQ and IRL interrupts before switching between IRQ/IRL[7:0] pin functions.
Page 364
Section 10 Interrupt Controller (INTC) IRQ interrupt requests held in the detection circuit are not cleared even if a 0 is written to the corresponding bit in INTPRI. The IRQ interrupt sources detected by the INTC (which will be cleared when they are accepted by the CPU) can be confirmed by reading INTREQ. When not using holding function (ICR0.LSH = 1), the interrupt request is not held but the interrupt source is set to the corresponding bit in INTREQ that is to be cleared when the CPU accepts it.
Section 11 Local Bus State Controller (LBSC) Section 11 Local Bus State Controller (LBSC) The local bus state controller (LBSC) divides the external memory space and outputs control signals corresponding to the specifications of various types of memory and bus interfaces. The LBSC enables the connection of SRAM or ROM, etc., to this LSI.
Page 366
Section 11 Local Bus State Controller (LBSC) • MPX interface Address/data multiplexing Connectable areas: 0 to 2 and 4 to 6 Settable bus width: 32 bits • Byte control SRAM interface SRAM interface with byte control Connectable areas: 1 and 4 Settable bus widths: 32 and 16 bits •...
Section 11 Local Bus State Controller (LBSC) Bus interface Wait CSnWCR control unit CS0 to CS2 Area CS4 to CS6 CSnBCR control CE2A, CE2B unit A25 to A0 BACK, BS RD/FRAME WE3/IOWR Memory CSnPCR WE2/IORD control WE1, WE0/REG unit D31 to D0 BREQ, IOIS16 MODE5 to MODE3 LBSC...
Section 11 Local Bus State Controller (LBSC) 11.2 Input/Output Pins Table 11.1 shows the LBSC pin configuration. Table 11.1 Pin Configuration Pin Name Function Description A25 to A0 Address Bus Output Address output D31 to D0* Data Bus Data input/output Bus Cycle Start Output Signal that indicates the start of a bus cycle.
Page 369
Section 11 Local Bus State Controller (LBSC) Pin Name Function Description IOIS16* 16-Bit I/O Input 16-bit I/O signal when setting PCMCIA interface. Valid only in little endian mode BREQ* Bus Release Input Bus release request signal Request BACK Bus Request Output Bus release acknowledge signal Acknowledge...
Section 11 Local Bus State Controller (LBSC) 11.3 Area Overview 11.3.1 Space Divisions The architecture of this LSI provides a 32-bit address space. The virtual address space is divided into five areas (P0 to P4 areas) according to the upper address value. This LSI supports both a 29-bit and a 32-bit physical address space, and the LBSC supports a 29- bit physical address space.
Section 11 Local Bus State Controller (LBSC) H'0000 0000 H'0000 0000 Area 0 H'0400 0000 Area 1 H'0800 0000 P0 and P0 and Area 2 U0 areas U0 areas H'0C00 0000 (Area 3) H'1000 0000 Area 4 H'1400 0000 Area 5 H'8000 0000 H'1800 0000 P1 area...
Section 11 Local Bus State Controller (LBSC) Specifiable External Bus Width Area addresses Size Connectable Memory (bits) Access Size* H'1C00 0000 to 64 Mbytes — H'1FFF FFFF Notes: 1. The memory bus width is specified by external pins (MODE3 and MODE4). 2.
Section 11 Local Bus State Controller (LBSC) 11.3.2 Memory Bus Width The memory bus width of the LBSC can be set independently for each area. For area 0, a bus width of 8, 16, or 32 bits is set according to the external pin settings at a power-on reset by the PRESET pin.
Section 11 Local Bus State Controller (LBSC) 11.3.3 Data Alignment This LSI supports the big endian and little endian methods of data alignment. The data alignment method is specified using the external pin (MODE5) at a power-on reset. Table 11.4 Correspondence Between External Pin (MODE5) and Endian Mode 5 Endian Big endian...
Section 11 Local Bus State Controller (LBSC) Table 11.6 PCMCIA Support Interface IC Memory Card Interface I/O Card Interface Signal Signal Corresponding Name* I/O* Function Name* I/O* Function Pin of this LSI Ground Ground Data Data Data Data Data Data Data Data...
Page 377
Section 11 Local Bus State Controller (LBSC) IC Memory Card Interface I/O Card Interface Signal Signal Corresponding Name* I/O* Function Name* I/O* Function Pin of this LSI Data Data Data Data Data Data IOIS16 IOIS16 Write protect 16-bit I/O port ...
Page 378
Section 11 Local Bus State Controller (LBSC) IC Memory Card Interface I/O Card Interface Signal Signal Corresponding Name* I/O* Function Name* I/O* Function Pin of this LSI RESET Reset RESET Reset Output from port WAIT WAIT RDY* Wait request Wait request INPACK Input acknowledge ...
Section 11 Local Bus State Controller (LBSC) 11.4 Register Descriptions Table 11.7 shows the LBSC register configuration. Table 11.8 shows the register state in each processing mode. Table 11.7 Register Configuration Area 7 Access Register Name Abbrev. P4 Address Address Size* Memory Address Map Select Register MMSELR H'FF40 0020...
Section 11 Local Bus State Controller (LBSC) Table 11.8 Register State in Each Processing Mode Register Name Abbrev. Power-On Reset Manual Reset Sleep Memory Address Map Select Register MMSELR H'0000 0000 H'0000 0000 Retained Bus Control Register H'x000 0000 Retained Retained CS0 Bus Control Register CS0BCR...
Section 11 Local Bus State Controller (LBSC) 11.4.1 Memory Address Map Select Register (MMSELR) MMSELR is a 32-bit register that selects memory address maps for areas 2 to 5. This register should be accessed at the address H'FF40 0020 in longword. Writing is accepted only when the upper 16-bit data is H'A5A5 to prevent unintentional writing.
Page 382
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description 2 to 0 AREASEL DDRIF/PCIC Memory Space Select 000: Sets area 3 (H'0C00 0000 to H'0FFF FFFF) as the DDRIF space and other areas as the LBSC space 001: Sets area 3 (H'0C00 0000 to H'0FFF FFFF) as the DDRIF space, area 4 (H'1000 0000 to H'13FF FFFF) as the PCI memory space, and other areas as the LBSC space...
Section 11 Local Bus State Controller (LBSC) The instruction to modify the value of the MMSELR should be allocated non-cacheable P2 area and an address that will not be affected by an address map change. Write to MMSELR before enabling the Instruction cache, Operand cache, and MMU address translation, and then do not write to it again until after power-on reset or manual reset.
Page 384
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description DPUP Data Pin Pull-Up Resistor Control Specifies the pull-up resistor state of the data pins (D31 to D0). This bit is initialized by a power-on reset. The pins are not pulled up when access is performed or when the bus is released, even if the pull-up resistor is 0: Cycles in which the pull-up resistors of the data pins (D31 to D0) are turned on are inserted before and...
Page 385
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description 19, 18 All 0 Reserved These bits are always read as 0. The write value should always be 0. BREQ Enable BREQEN Indicates whether or not an external bus request can be accepted.
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description 6 to 0 All 0 Asynchronous Input ASYNC[6:0] Enable asynchronous input to the corresponding pins. 0: Input signals to the corresponding pins must be synchronized with CLKOUT 1: Input signals to the corresponding pins can be asynchronous to CLKOUT ASYNC[6]: DREQ3 ASYNC[5]: DREQ2...
Page 387
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description Reserved This bit is always read as 0. The write value should always be 0. 30 to 28 IWW Idle Cycles between Write-Read/Write-Write Specify the number of idle cycles to be inserted after an access to a memory connected to the space is completed.
Page 388
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description Reserved This bit is always read as 0. The write value should always be 0. 22 to 20 IWRWS Idle Cycles between Read-Write to Same Space Specify the number of idle cycles to be inserted after an access to a memory connected to the space is completed.
Page 389
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description Reserved This bit is always read as 0. The write value should always be 0. 14 to 12 IWRRS Idle Cycles between Read-Read to Same Space Specify the number of idle cycles to be inserted after an access to a memory connected to the space is completed.
Page 390
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description 9, 8 R/W* Bus Width Specify the bus width. Set to 11 for the MPX interface, and set to 10 or 11 for the byte control SRAM interface. In CS0BCR, the external pins (MODE3 and MODE4) are sampled at a power-on reset.
Page 391
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description R/W* MPX Interface Setting Selects the type of MPX interface 0: Interface that is specified by TYPE bits 1: MPX interface selected Note: * The MPX bit in CS0BCR is read-only. 2 to 0 TYPE Memory Type Setting...
Section 11 Local Bus State Controller (LBSC) 11.4.4 CSn Wait Control Register (CSnWCR) CSnWCR (n = 0 to 2, 4 to 6) are 32-bit readable/writable registers that specify the number of wait cycles to be inserted, the pitch of data access for burst memory accesses, and the number of cycles to be inserted for the address setup time to the read/write strobe assertion or for the data hold time from the write strobe negation.
Page 393
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description Reserved This bit is always read as 0. The write value should always be 0. 26 to 24 ADH Address Hold Cycle Specify the number of cycles to be inserted to ensure the address hold time to the CSn negation.
Page 394
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description Reserved This bit is always read as 0. The write value should always be 0. RD Hold Cycle (RD Negation–CSn Negation Delay 18 to 16 RDH Cycle) Specify the number of cycles to be inserted from RD negation to CSn negation.
Page 395
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description Reserved This bit is always read as 0. The write value should always be 0. WE Hold Cycle (WE Negation–CSn Negation Delay 10 to 8 Cycle) Specify the number of cycles to be inserted from WE negation to CSn negation.
Page 396
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description 3 to 0 IW[3:0] 1111 Insert Wait Cycle Specify the number of wait cycles to be inserted. • When the SRAM interface, byte control SRAM interface, burst ROM interface (first data cycle only), or PCMCIA interface is selected, the following cycles are inserted.
Section 11 Local Bus State Controller (LBSC) 11.4.5 CSn PCMCIA Control Register (CSnPCR) CSnPCR is a 32-bit readable/writable register that specifies the timing for the PCMCIA interface connected to area n (n = 5 or 6), the space property, and the assert/negate timing for the OE (RD) and WE signals.
Page 398
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description Reserved This bit is always read as 0. The write value should always be 0. 26 to 24 SAB Space Property B Specify the space property of PCMCIA connected to second half of area n (n = 5 and 6).
Page 399
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description 19 to 16 PCIW 0000 PCMCIA Insert Wait Cycle B Specify the number of wait cycles to be inserted. These bits are valid, when the access area of PCMCIA interface is second half of area n (n = 5 and 6).
Page 400
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description OE/WE Assert Delay A 14 to 12 TEDA These bits set the delay time from address output to OE/WE assertion for the access of first half area of PCMCIA interface (area n, n = 5 and 6).
Page 401
Section 11 Local Bus State Controller (LBSC) Initial Bit Name Value Description OE/WE Negation-Address Delay A 6 to 4 TEHA These bits set the delay time from OE/WE negation to address hold for the access of first half area of PCMCIA interface (area n, n = 5 and 6).
Section 11 Local Bus State Controller (LBSC) 11.5 Operation 11.5.1 Endian/Access Size and Data Alignment This LSI supports both big-endian mode, in which the upper byte in a string of byte data is at address 0, and little-endian mode, in which the lower byte in a string of byte data is at address 0. The mode is specified by the external pin (MODE5 pin) at a power-on reset through the RESET pin.
Section 11 Local Bus State Controller (LBSC) Table 11.9 32-Bit External Device/Big-Endian Access and Data Alignment Operation Data Bus Strobe Signals Access D31 to D23 to D15 to D7 to Size Address No. Byte Data Assert 7 to 0 ...
Section 11 Local Bus State Controller (LBSC) Table 11.11 8-Bit External Device/Big-Endian Access and Data Alignment Operation Data Bus Strobe Signals Access D31 to D23 to D15 to D7 to Size Address No. Byte Data Assert 7 to 0 ...
Section 11 Local Bus State Controller (LBSC) Table 11.12 32-Bit External Device/Little-Endian Access and Data Alignment Operation Data Bus Strobe Signals Access D31 to D23 to D15 to D7 to Size Address No. Byte Data Assert 7 to 0 ...
Section 11 Local Bus State Controller (LBSC) Table 11.14 8-Bit External Device/Little-Endian Access and Data Alignment Operation Data Bus Strobe Signals Access D31 to D23 to D15 to D7 to Size Address No. Byte Data Assert 7 to 0 ...
Section 11 Local Bus State Controller (LBSC) 11.5.2 Areas Area 0 For area 0, physical address bits 28 to 26 are 000. The interfaces that can be set for this area are the SRAM, burst ROM and MPX interfaces. A bus width of 8, 16, or 32 bits is selectable with external pins MODE4 and MODE3 at a power- on reset.
Page 408
Section 11 Local Bus State Controller (LBSC) In the case where the SRAM interface is set, the RD signal, which can be used as OE, and write control signals WE0 to WE3 are asserted. For the number of bus cycles, 0 to 25 wait cycles inserted by CS1WCR can be selected. When the burst ROM interface is used, a burst pitch number in the range of 0 to 7 is selectable with bits BW2 to BW0 in CS1BCR.
Page 409
Section 11 Local Bus State Controller (LBSC) Area 3 For area 3, physical address bits 28 to 26 are 011. This area is used only for the DDR-SDRAM interface. For details, see section 12, DDR-SDRAM Interface (DDRIF). Area 4 For area 4, physical address bits 28 to 26 are 100. The interfaces that can be set for this area are the SRAM, burst ROM, MPX , byte control SRAM, DDR-SDRAM and PCI local bus interfaces.
Page 410
Section 11 Local Bus State Controller (LBSC) When the SRAM or burst ROM interface is used, a bus width of 8, 16, or 32 bits is selectable with bits SZ in CS5BCR. When the MPX interface is used, a bus width of 32 bits should be selected through bits SZ in CS5BCR.
Section 11 Local Bus State Controller (LBSC) When area 6 is accessed, the CS6 signal is asserted. In addition, the RD signal, which can be used as OE, and write control signals WE0 to WE3 are asserted. While the PCMCIA interface is used, the CE1B and CE2B signals, the RD signal (which can be used as OE), and the WE0, WE1, WE2, and WE3 signals (which can be used as REG, WE, IORD, and IOWR, respectively) are asserted.
Section 11 Local Bus State Controller (LBSC) accesses are performed in wraparound method according to the set bus width. The bus is not released during this transfer. CLKOUT A25 to A0 D31 to D0 (read) D31 to D0 (write) DACK Figure 11.4 Basic Timing of SRAM Interface Rev.1.00 Dec.
Section 11 Local Bus State Controller (LBSC) Figures 11.5 to 11.7 show examples of the connection to SRAM with data width of 32, 16, and 8 bits. 128 K × 8-bit SH7780 SRAM I/O7 I/O0 I/O7 I/O0 I/O7 I/O0 I/O7 I/O0 Figure 11.5 Example of 32-Bit Data-Width SRAM Connection Rev.1.00 Dec.
Section 11 Local Bus State Controller (LBSC) 128 K × 8-bit SH7780 SRAM I/O7 I/O0 I/O7 I/O0 Figure 11.6 Example of 16-Bit Data-Width SRAM Connection Rev.1.00 Dec. 13, 2005 Page 364 of 1286 REJ09B0158-0100...
Section 11 Local Bus State Controller (LBSC) 128 K × 8-bit SH7780 SRAM I/O7 I/O0 Figure 11.7 Example of 8-Bit Data-Width SRAM Connection Rev.1.00 Dec. 13, 2005 Page 365 of 1286 REJ09B0158-0100...
Section 11 Local Bus State Controller (LBSC) Wait Cycle Control Wait cycle insertion for the SRAM interface can be controlled by CSnWCR. If the IW bits for each area in CSnWCR is not 0, a software wait is inserted in accordance with the wait-control bits. For details, see section 11.4.4, CSn Wait Control Register (CSnWCR).
Section 11 Local Bus State Controller (LBSC) When software wait insertion is specified by CSnWCR, the external wait input signal (RDY) is also sampled. The RDY signal sampling timing is shown in figure 11.9, where a single wait cycle is specified as a software wait. The RDY signal is sampled at the transition from the Tw state to the T2 state.
Page 418
Section 11 Local Bus State Controller (LBSC) Read-Strobe Negate Timing When the SRAM interface is used, the negation timing of the strobe signal during a read operation can be specified through the RDSPL bit in CSnBCR. For details of settings, see section 11.4.3, CSn Bus Control Register (CSnBCR).
Section 11 Local Bus State Controller (LBSC) 11.5.4 Burst ROM (Clock Asynchronous) Interface Setting the TYPE bit in CSnBCR (n = 0 to 2 and 4 to 6) to 010 allows a burst ROM (clock asynchronous memory) to be connected to areas 0 to 2 and 4 to 6. The burst ROM interface provides high-speed access to ROM that has a burst access function.
Section 11 Local Bus State Controller (LBSC) CLKOUT A25 to A5 A4 to A0 D31 to D0 (read) Figure 11.11 Burst ROM Basic Timing CLKOUT A25 to A5 A4 to A0 D31 to D0 (read) Figure 11.12 Burst ROM Wait Timing Rev.1.00 Dec.
Section 11 Local Bus State Controller (LBSC) CLKOUT A25 to A5 A4 to A0 D31 to D0 (read) DACKn Note: When CSnBCR RDSPL is set to 1. Figure 11.13 Burst ROM Wait Timing 11.5.5 PCMCIA Interface Areas 5 and 6 can be set to the IC memory card interface or I/O card interface, which is stipulated in JEIDA specification version 4.2 (PCMCIA 2.1), by setting the TYPE bits in CS5BCR and CS6BCR.
Page 423
Section 11 Local Bus State Controller (LBSC) Bits PCWA/B1 and PCWA/B0 can be used to set the number of wait cycles to be inserted in a low-speed bus cycle as 0, 15, 30, or 50. This value is added to the number of inserted wait cycles specified by IW bit in CSnWCR or PCIW bit in CSnPCR.
Section 11 Local Bus State Controller (LBSC) (a) IO Card Interface DACKBST Invalid CExx DACK (b) ATA Complement Mode DACKBST Valid CExx DACK Note: Number of DMA transfer times: 4, DMA transfer size: word (16-bit) xx = 1A, 1B, 2A, 2B Figure 11.14 CExx and DACK Output of ATA Complement Mode in DMA Transfer Figure 11.15 shows an example of PCMCIA card connection to this LSI.
Section 11 Local Bus State Controller (LBSC) Table 11.15 Relationship between Address and CE When Using PCMCIA Interface Read/ Access Odd/ IOIS16 Bus (Bits) Write (bits)* Even Access D15 to D8 D7 to D0 × Read Even Invalid Read data ×...
Page 426
Section 11 Local Bus State Controller (LBSC) Read/ Access Odd/ IOIS16 Bus (Bits) Write (bits)* Even Access D15 to D8 D7 to D0 Dynamic Write Even Invalid Write data First Invalid Write data Sizing* Second Invalid Write data Even First Upper write data Lower write data Even...
Section 11 Local Bus State Controller (LBSC) A25 to A0 A25 to A0 D15 to D0 D7 to D0 CE1B/(CS6) D15 to D0 CE1A/(CS5) CE2B PC card CE2A D15 to D8 (Memory, I/O) SH7780 WE/PGM IORD (IORD) (IOWR) IOWR WAIT IOIS16 (IOIS16) Card...
Section 11 Local Bus State Controller (LBSC) Memory Card Interface Basic Timing Figure 11.16 shows the basic timing for the PCMCIA memory card interface, and figure 11.17 shows the wait timing for the PCMCIA memory card interface. pcm1 pcm2 CLKOUT A25 to A0 CExx REG (WE0)
Section 11 Local Bus State Controller (LBSC) I/O Card Interface Timing Figures 11.18 and 11.19 show the timing for the PCMCIA I/O card interface. When accessing a PCMCIA card via the I/O card interface, it is possible to perform dynamic sizing of the I/O bus width using the IOIS16 pin.
Section 11 Local Bus State Controller (LBSC) 11.5.6 MPX Interface When both the MODE4 and MODE3 pins are set to 0 at a power-on reset by the PRESET pin, the MPX interface is selected for area 0. The MPX interface is selected for areas 1, 2, and 4 to 6 by the MPX bit in CS1BCR, CS2BCR, and CS4BCR to CS6BCR.
Section 11 Local Bus State Controller (LBSC) SH7780 MPX device CLKOUT RD/FRAME FRAME D31 to D0 I/O31 to I/O0 Figure 11.21 Example of 32-Bit Data Width MPX Connection The MPX interface timing is shown below. When the MPX interface is used for areas 1, 2, and 4 to 6, a bus size of 32 bits should be specified by CSnBCR.
Section 11 Local Bus State Controller (LBSC) md1w md1we CLKOUT RD/FRAME D31 to D0 DACK Figure 11.25 MPX Interface Timing 4 (Single Write Cycle, IW = 1, One External Wait Inserted) T m1 T md1w T md1 T md2 T md3 T md4 T md5 T md6...
Section 11 Local Bus State Controller (LBSC) T m1 T md1w T md1 T md2we T md2 T md3 T md7 T md8we T md8 CLKOUT FRAME D31 to D0 DACK Figure 11.27 MPX Interface Timing 6 (Burst Read Cycle, IW = 0, External Wait Control, 32-Byte Data Transfer) T m1 T md1 T md2...
Section 11 Local Bus State Controller (LBSC) T m1 T md1w T md1 T md2we T md2 T md3 T md7 T md8we T md8 CLKOUT FRAME D31 to D0 DACK Figure 11.29 MPX Interface Timing 8 (Burst Write Cycle, IW = 1, External Wait Control, 32-Byte Data Transfer) Rev.1.00 Dec.
Section 11 Local Bus State Controller (LBSC) 11.5.7 Byte Control SRAM Interface The byte control SRAM interface is a memory interface that outputs a byte-select strobe (WE) in both read and write bus cycles. This interface has 16-bit data pins and can be connected to SRAM having an upper byte select strobe and lower select strobe functions, such as UB and LB.
Section 11 Local Bus State Controller (LBSC) CLKOUT A25 to A0 D31 to D0 (read) DACK Figure 11.31 Byte-Control SRAM Basic Read Cycle (No Wait) Rev.1.00 Dec. 13, 2005 Page 390 of 1286 REJ09B0158-0100...
Section 11 Local Bus State Controller (LBSC) 11.5.8 Wait Cycles between Accesses A problem associated with higher operating frequencies for external memory buses is that the data buffer turn-off after completion of a read from a low-speed device may be too slow, causing a collision with the data in the next access, and resulting in lower reliability or malfunctions.
Section 11 Local Bus State Controller (LBSC) wait wait CLKOUT A25 to A0 D31 to D0 IWRRD IWRWS Area m space read Area n space read Area n space write Area m - n access wait specification Area n inter-access wait specification m ≠...
Section 11 Local Bus State Controller (LBSC) 11.5.9 Bus Arbitration The LBSC is provided with a bus arbitration function that grants the bus to an external device when it makes a bus request. In normal operation, the bus is held by the LBSC (bus master), and is released to another device in response to a bus request.
Section 11 Local Bus State Controller (LBSC) CLKOUT BREQ Asserted for Negated least 2 cycles within 2 cycles BACK A25 to A0 D31 to D0 (write) Master access Slave access Master access Figure 11.35 Arbitration Sequence Rev.1.00 Dec. 13, 2005 Page 396 of 1286 REJ09B0158-0100...
Section 11 Local Bus State Controller (LBSC) 11.5.10 Bus Release and Acquire Sequence The LBSC holds the bus itself unless it receives a bus request. On receiving an assertion (low level) of the bus request signal (BREQ) from off-chip, the LBSC releases the bus and asserts (drives low) the bus use permission signal (BACK) as soon as the currently executing bus cycle ends.
Section 11 Local Bus State Controller (LBSC) If a DMA transfer is executed for the space that the source address is in the LBSC space and the destination address is out of the LBSC space and the LCKN bit in CHCR is cleared to 0, the bus is not released after the DMA write access is ended even if the bus release signal (BREQ) is asserted.
Section 11 Local Bus State Controller (LBSC) 11.5.11 Cooperation between Master and Slave To enable system resources to be controlled in a harmonious fashion by master and slave, their respective roles must be clearly defined. When designing an application system that includes the SH7780, all control, including initialization, and low power consumption control, are supposed to be carried out by the SH7780.
Page 450
Section 11 Local Bus State Controller (LBSC) Rev.1.00 Dec. 13, 2005 Page 400 of 1286 REJ09B0158-0100...
Section 12 DDR-SDRAM Interface (DDRIF) Section 12 DDR-SDRAM Interface (DDRIF) The DDR-SDRAM interface (DDRIF) is an interface for the control of DDR-SDRAM. The DDRIF supports DDR320- and DDR266-SDRAM. 12.1 Features • The data bus width of the DDRIF is 32 bits •...
Section 12 DDR-SDRAM Interface (DDRIF) Figure 12.1 shows a block diagram of the DDRIF. DDRIF (DDR-SDRAM Interface) SuperHyway bus interface DDR controller DDR-VREF Synchronizing for BKPRST internal process Control register synchronizer SuperHyway SuperHyway Command/write data output request request and control register MRAS receiver buffer...
Section 12 DDR-SDRAM Interface (DDRIF) 12.2 Input/Output Pins Table 12.1 shows the DDRIF pin configuration. For details on connection with the DDR-SDRAM, see the DDR-SDRAM pin information. Table 12.1 Pin Configuration Pin Name Function Description MCLK DDR-SDRAM clock Output Clock output for DDR-SDRAM MCLK DDR-SDRAM clock Output...
Section 12 DDR-SDRAM Interface (DDRIF) 12.3 Address Space, Bus Width, and Data Alignment 12.3.1 Address Space of the DDRIF This LSI supports both 29-bit and 32-bit physical address spaces (29-bit address mode and 32-bit address extended mode), and the address space is selectable from among five kinds of map by setting Memory Address Map Select Register (MMSELR) of the LBSC.
Section 12 DDR-SDRAM Interface (DDRIF) 12.3.3 Data Alignment The DDRIF supports both big endian mode, where the address of the highest order byte is 0, and little endian mode, where the address of the lowest order byte is 0. These modes can be switched by changing the level on an external pin (MODE5) and then generating a power-on reset.
Page 457
Section 12 DDR-SDRAM Interface (DDRIF) MD31 to MD24 MD23 to MD16 MD15 to MD8 MD7 to MD0 32-byte access at address 0 Bit 31 to 24 Bit 23 to 16 Bit 15 to 8 Bit 7 to 0 (first round: from address 4) 32-byte access at address 0 Bit 31 to 24 Bit 23 to 16...
Section 12 DDR-SDRAM Interface (DDRIF) Table 12.3 Access and Data Alignment in Big Endian Mode MD31 to MD24 MD23 to MD16 MD15 to MD8 MD7 to MD0 Byte access at address 0 Bit 7 to 0 Byte access at address 1 Bit 7 to 0 Byte access at address 2 Bit 7 to 0...
Section 12 DDR-SDRAM Interface (DDRIF) MD31 to MD24 MD23 to MD16 MD15 to MD8 MD7 to MD0 32-byte access at address 0 Bit 31 to 24 Bit 23 to 16 Bit 15 to 8 Bit 7 to 0 (first round: from address 0) 32-byte access at address 0 Bit 31 to 24 Bit 23 to 16...
Section 12 DDR-SDRAM Interface (DDRIF) 12.4 Register Descriptions Table 12.4 shows the DDRIF register configuration. Table 12.5 shows the register states in each processing mode. These registers should only be set while access to the DDR-SDRAM from a module is not in progress.
Page 463
Section 12 DDR-SDRAM Interface (DDRIF) Initial Bit Name Value Description Reserved This bit is always read as 0. The write value should always be 0. PCKE Power Down This bit controls a low power consumption mode in which the CKE pin is set low to place the DDR-SDRAM in “power-down mode”...
Page 464
Section 12 DDR-SDRAM Interface (DDRIF) Initial Bit Name Value Description 28 to 16 DRI H'0C34 DRAM Refresh Interval When refreshing is valid (the DRE bit in MIM is set to 1), these bits specify the maximum refresh interval (auto-refresh). The unit for counting is the cycle of the MCLK.
Page 465
Section 12 DDR-SDRAM Interface (DDRIF) Initial Bit Name Value Description ENDIAN Undefined* R Endian Identifier Indicates whether big endian or little endian mode is selected for the external data bus. 0: Little endian mode 1: Big endian mode Bus Width Specifies the DDR-SDRAM bus width.
Page 467
Section 12 DDR-SDRAM Interface (DDRIF) Initial Bit Name Value Description 63 to 3 All 0 Reserved These bits are always read as 0. The write value should always be 0. 2 to 0 SDRAM Mode Select These bits initialize the DDR-SDRAM when power is supplied and after release of the reset signal.
Page 469
Section 12 DDR-SDRAM Interface (DDRIF) Initial Bit Name Value Description 17, 16 Minimum Number of Cycles from Read Command to Write Command These bits specify the minimum number of cycles required by the SRAM from the issuing of a READ command to the issuing of a subsequent WRITE command.
Page 470
Section 12 DDR-SDRAM Interface (DDRIF) Initial Bit Name Value Description 10 to 8 SRAS Minimum Number of Cycles between ACT and PRE Commands These bits specify the minimum number of cycles until a PRE command is issued after an ACT command has been issued (the corresponding time is tRAS) for the same bank.
Section 12 DDR-SDRAM Interface (DDRIF) Initial Bit Name Value Description SRCD Numbers of Cycles between RAS and CAS Commands Specifies the number of cycles from an RAS (ACT) command to a subsequent CAS (READ/READA, WRITE/WRITEA) command (the corresponding time is tRCD).
Section 12 DDR-SDRAM Interface (DDRIF) Initial Bit Name Value Description 63 to 12 All 0 Reserved These bits are always read as 0. The write value should always be 0. 11 to 8 SPLIT 0001 DDR-SDRAM Memory Configuration These bits specify the row/column configuration of the DDR-SDRAM.
Section 12 DDR-SDRAM Interface (DDRIF) Address Bit Correspondence BA1 and MA13 to MA9 to MA10 Bits 14 Bits 18 to Bits 12 to and 13 Figure 12.4 shows the relationship between write values in SDMR and output signals to the memory pins.
Section 12 DDR-SDRAM Interface (DDRIF) To output the above control signals, write access to address H'FEC0 0308 in SDMR is made in longwords. Then the above control signals are output to the SDRAM pins. Write data to SDMR is Don't care. 12.4.6 DDR-SDRAM Back-up Register (DBK) This register indicates the DDR-SDRAM back-up status.
Section 12 DDR-SDRAM Interface (DDRIF) 12.5 Operation 12.5.1 DDR-SDRAM Access The DDR-SDRAM is accessed with a burst length of 2. Read or write commands for the same page can be issued consecutively and the data is read or written continuously. 12.5.2 DDR-SDRAM Initialization Sequence Since the internal state of the SDRAM is undefined immediately after power is initially supplied,...
Section 12 DDR-SDRAM Interface (DDRIF) 12. Use SDMR to issue the MRS command, release the DLL reset (MA8 = low), and determine the operating mode. In this case, use the settings for burst length, etc. that were specified in step 10. 13.
Section 12 DDR-SDRAM Interface (DDRIF) Valid data The DESELECT command in table 12.6 is automatically issued whenever the SDRAM is not being accessed by any module. The DESELECT command therefore cannot be explicitly issued by the user. 12.5.4 SDRAM Access Mode The DDRIF supports the following two SDRAM access modes.
Page 478
Section 12 DDR-SDRAM Interface (DDRIF) 3. The STR settings do not establish a relationship between the timing of the PREALL and REFA commands that are issued by using SCR. A period of waiting that is suitable for the memory unit must be inserted. 4.
Section 12 DDR-SDRAM Interface (DDRIF) 12.5.6 Address Multiplexing Address multiplexing is performed in line with the settings of the SPLIT bits in SDR so that connecting the SDRAM does not require an external address-multiplexing circuit. Table 12.7 shows the relationship between the settings of SPLIT bits and address multiplexing. The number of ROW or COL line is the addresses (bit) that are output to the address pins according to the setting of the SPLIT bits.
Section 12 DDR-SDRAM Interface (DDRIF) 12.6 DDR-SDRAM Basic Timing Figures 12.5 to 12.14 show basic timing of the DDRIF. In each timing chart, the DDR-SRAM has been idle at T0. The settings in the SDRAM timing register (STR) must set up timing that is within the specifications of the DDR-SDRAM.
Section 12 DDR-SDRAM Interface (DDRIF) (MCLK) MCLK Command WRITE WRITE WRITE WRITE (SRCD = 1) MA9-0 Col 0 Col 2 Col 4 Col 6 MA13-11 MA10 Bank Bank Bank Bank Bank Bank BA1-0 MRAS MCAS Hi-Z MDQS Hi-Z D1 D2 D3 D4 D5 D6 D7 MDQM Figure 12.10 DDRIF Basic Timing (4 Burst Write: 32-byte without Auto Precharge)
Section 12 DDR-SDRAM Interface (DDRIF) (MCLK) MCLK Command REFS REFSX Command XSNR XSRD MA9-0 MA13-11 MA10 BA1-0 MRAS MCAS Self refresh Notes: 1. The time where the CKE signal rises should satisfy the refresh interval conditions of the SDRAM in use. 2.
Section 12 DDR-SDRAM Interface (DDRIF) 12.7 Usage Notes 12.7.1 Operating Frequency The DDRIF supports ratios of 5:4 (DDR320) and 1:1 (DDR266) between the frequencies of the SuperHyway clock (SHck) and DDR clock (DDRck). For details, see section 15, Clock Pulse Generator (CPG).
Section 12 DDR-SDRAM Interface (DDRIF) 12.7.5 Setting Auto-Refresh Interval The auto-refresh interval is specified by the DRI bits in MIM. If the DRE bit is set to 1 at the same time as the DRI bits are set, the time until the first auto-refresh is that selected by the value of the DRI bits before the new setting was made.
Section 13 PCI Controller (PCIC) Section 13 PCI Controller (PCIC) The PCI controller (PCIC) controls the PCI bus for data transfers between memory connected to an external bus and a PCI device connected to the PCI bus. The ability to connect PCI devices facilitates the design of systems using the PCI bus and enables more compact systems capable of faster data transfer.
Page 494
Section 13 PCI Controller (PCIC) • Exclusive access (target only) Once locked, only accessible from the device that accessed the LOCK signal The SuperHyway bus in not locked during lock transfer • Can support cache coherency between a device connected to the PCI bus and system memory (PCI target) although device performance may become suboptimal •...
Section 13 PCI Controller (PCIC) Figure 13.1 is a block diagram of the PCIC. PCIRESET PCICLK (PCI bus clock) PCI local bus PCI standard signal PCIC SuperHyway bus PCI bus Interface MODE6 Interface (PCI bus access control) Host/normal SuperHyway bus Data FIFO Target control 32-Byte ×...
Section 13 PCI Controller (PCIC) 13.2 Input/Output Pins Table 13.1 shows the pin configuration of the PCIC. Table 13.1 Input/Output Pins PCI standard Pin Name signal name Description AD31 to AD0* AD[31:0] PCI Address/Data Bus (TRI) Address and data buses are multiplexed. Each bus transaction consists of an address phase followed by one or more data phases.
Page 497
Section 13 PCI Controller (PCIC) PCI standard Pin Name signal name Description IDSEL IDSEL Input PCI Configuration Device Select This signal is input to the PCI device to select configuration cycles (only for normal mode). DEVSEL DEVSEL PCI Device Select (STRI) Indicates the device driving this signal has decoded its address as the target.
Page 498
Section 13 PCI Controller (PCIC) [Legend] TRI: Tri-state STRI: Sustained tri-state O/D: Open Drain Notes: 1. These pins are multiplexed with the GPIO pins (port A to D). 2. This pin is multiplexed with the SCIF channel 0 and GPIO pins. 3.
Section 13 PCI Controller (PCIC) 13.3 Register Descriptions Table 13.2 shows the PCIC register configuration. Table 13.3 shows the register states in each operating mode. The PCI configuration register address and its offset are used for little endian operation. Table 13.2 List of PCIC Registers PCI* Access Name...
Page 500
Section 13 PCI Controller (PCIC) PCI* Access Name Abbreviation P4 address Area 7 address Size* PCI minimum grant register PCIMINGNT H'FE04 003E H'1E04 003E PCI maximum latency register PCIMAXLAT H'FE04 003F H'1E04 003F PCI capability ID register PCICID H'FE04 0040 H'1E04 0040 PCI next item pointer register PCINIP...
Page 501
Section 13 PCI Controller (PCIC) PCI* Access Name Abbreviation P4 address Area 7 address Size* PCI memory bank register 0 PCIMBR0 — H'FE04 01E0 H'1E04 01E0 PCI memory bank mask register 0 PCIMBMR0 — H'FE04 01E4 H'1E04 01E4 PCI memory bank register 1 PCIMBR1 —...
Section 13 PCI Controller (PCIC) Table 13.3 Register States in Each Operating Mode Name Abbreviation Power-On Reset Manual Reset Sleep Mode Control register space PCIC enable control register PCIECR H'0000 0000 Retained Retained PCI configuration register space PCI vendor ID register PCIVID H'1912 Retained...
Page 503
Section 13 PCI Controller (PCIC) Name Abbreviation Power-On Reset Manual Reset Sleep Mode PCI power management capability PCIPMC H'000A Retained Retained register PCI power management PCIPMCSR H'0000 Retained Retained control/status register PCI PMCSR bridge support H'00 Retained Retained PCIPMCSR extension register PCI power consumption/dissipation PCIPCDD H'00...
Page 504
Section 13 PCI Controller (PCIC) Name Abbreviation Power-On Reset Manual Reset Sleep Mode PCI memory bank register 2 PCIMBR2 H'0000 0000 Retained Retained PCI memory bank mask register 2 PCIMBMR2 H'0000 0000 Retained Retained PCI I/O bank register PCIIOBR H'0000 0000 Retained Retained PCI I/O bank master register...
PCI Vender ID PCI: R Indicates the PCI device manufacture identifier (vender ID) that is allocated by PCI-SIG. Renesas Technology’s vendor ID is H'1912. PCI Device ID Register (PCIDID) This register uniquely identifies this LSI amongst PCI devices manufactured by the vendor.
Page 507
Section 13 PCI Controller (PCIC) PCI Command Register (PCICMD) The PCI command register provides coarse control over a device's ability to generate and respond to PCI cycles. When 0 is written to this register, the device is logically disconnected from the PCI bus for all accesses except configuration accesses.
Page 508
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description SH: R/W Parity Error PCI: R/W Controls the device's response when the PCIC detects a parity error or receives a parity error. When this bit is set to 1, the PERR signal is asserted. 0: No response parity error 1: Response parity error VGAPS...
Page 509
Section 13 PCI Controller (PCIC) PCI Status Register (PCISTATUS) This status register is used to record status information for PCI bus related events. The definition of each of the bits is given in the table below. A device may not need to implement all the bits, depending on device functionality.
Page 510
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description SH: R/WC Master Abort Receive Status PCI: R/WC Indicates that the PCIC has terminated a transaction with a master abort when the PCIC is a master. 0: PCIC has not terminated a transaction with a master abort 1: PCIC has terminated a transaction with a master abort...
Page 511
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description FBBC SH: R Fast Back-to-Back Status PCI: R Indicates whether or not the PCIC is capable of accepting fast back-to-back transactions when the transactions are not to the same agent if the PCIC functions as a target.
Page 512
Section 13 PCI Controller (PCIC) PCI Revision ID Register (PCIRID) This register specifies a device specific revision identifier. Bit: Initial value: SH R/W: PCI R/W: Initial Bit Name Value Description 7 to 0 H'00 SH: R Revision ID PCI: R Indicates the PCIC revision.The initial value is H'00.RID value varies according to the logic version of the PCIC and it may be changed in the future.
Page 513
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description 6 to 4 All 0 SH: R Reserved PCI: R These bits are always read as 0. The write value should always be 0. SH: R/W PCI Programmable Indicator (Secondary) PCI: R When the CFINIT bit in PCICR is 0, this bit is writable.
Page 514
Section 13 PCI Controller (PCIC) PCI Sub Class Code Register (PCISUB) This register identifies the sub class code. For details of the class code, refer to “PCI Local Bus Specification Revision 2.2 Appendix D.” Bit: Initial value: SH R/W: PCI R/W: Initial Bit Name Value...
Page 515
Section 13 PCI Controller (PCIC) PCI Cacheline Size Register (PCICLS) Bit: Initial value: SH R/W: PCI R/W: Initial Bit Name Value Description 7 to 0 H'20 SH: R Cache Line Size: Not supported PCI: R A memory target does not support a cache. SDON and SBO are ignored.
Page 516
Section 13 PCI Controller (PCIC) (11) PCI Header Type Register (PCIHDR) Bit: Initial value: SH R/W: PCI R/W: Initial Bit Name Value Description SH: R Multiple Function Enable PCI: R 0: Single function 1: Multiple (from two to eight) functions (not supported) 6 to 0 H'00...
Page 517
Section 13 PCI Controller (PCIC) (13) PCI I/O Base Address Register (PCIIBAR) This register packages the I/O space base address register of the PCI configuration register that is prescribed with PCI local bus specification. Refer to Section 13.4.4 (1), Accessing This LSI Address Space. Bit: IOB (upper) Initial value:...
Page 518
Section 13 PCI Controller (PCIC) (14) PCI Memory Base Address Register 0 (PCIMBAR0) This register packages the memory space base address register of the PCI configuration register that is prescribed with PCI local bus specification. Refer to Section 13.4.4 (1), Accessing This LSI Address Space. Bit: MBA (upper) MBA (lower)
Page 519
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description 2, 1 SH: R Memory Type PCI: R Indicates the memory type of local address space 0. 00: 32-bit base address and 32-bit space 01: 32-bit base address and 1-Mbyte space (Not supported) 10: 64-bit base address (Not supported) 11: Reserved...
Page 520
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description 31 to 20 MBA H'000 SH: R/W PCI Memory Space 1 Base Address (upper 12 bits) (upper) PCI: R/W Specifies the upper 12 bits of PCI memory base address that corresponds the base address of local address space 1 (SuperHyway bus address space of this LSI).
Page 521
Section 13 PCI Controller (PCIC) (16) PCI Subsystem vender ID Register (PCISVID) Refer to miscellaneous registers section of PCI local bus specification Revision 2.2. Bit: SVID Initial value: SH R/W: PCI R/W: Initial Bit Name Value Description 15 to 0 SVID H'0000 SH: R/W Subsystem Vendor ID...
Page 522
Section 13 PCI Controller (PCIC) (18) PCI Capability Pointer Register (PCICP) This register is the expansion function pointer register of the PCI configuration register that is prescribed in the PCI power management specification. Bit: Initial value: SH R/W: PCI R/W: Initial Bit Name Value...
Page 523
Section 13 PCI Controller (PCIC) (20) PCI Interrupt Pin Register (PCIINTPIN) Bit: INTPIN Initial value: SH R/W: PCI R/W: Initial Bit Name Value Description 7 to 0 INTPIN H'01 SH: R/W Interrupt Pin Select PCI: R Specifies which interrupt pin is used for connection when the PCIC outputs interrupt request.
Page 524
Section 13 PCI Controller (PCIC) (22) PCI Maximum Latency Register (PCIMAXLAT) This register is not programmable. Bit: MAXLAT Initial value: SH R/W: PCI R/W: Initial Bit Name Value Description 7 to 0 MAXLAT H'00 SH: R Maximum Latency PCI: R Specify the worst time from the bus request by the PCI master device to the bus acquisition (not supported).
Page 525
Section 13 PCI Controller (PCIC) (24) PCI Next Item Pointer Register (PCINIP) PCINIP gives the location of the next item in the function's capability list. Bit: Initial value: SH R/W: PCI R/W: Initial Bit Name Value Description 7 to 0 H'00 SH: R Next Item Pointer...
Page 526
Section 13 PCI Controller (PCIC) (25) PCI Power Management Capability Register (PCIPMC) PCIPMCS is a 16-bit register that provides information on the capabilities of the power management related functions. For details, refer to “PCI Bus Power Management Interface Specification Revision 1.1 Chapter 3 PCI Power Management Interface”. This register must be set during initializing the PCIC registers (PCICR.CFINIT = 0).
Page 527
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description 8 to 6 All 0 SH: R Reserved PCI: R These bits are always read as 0. The write value should always be 0. SH: R PCI: R Specifies whether or not the device requires the specific initialization.
Page 528
Section 13 PCI Controller (PCIC) (26) PCI Power Management Control/Status Register (PCIPMCSR) This 16-bit register is used to manage the PCI function's power management status as well as to enable/monitor PMEs. For details, refer to “PCI Bus Power Management Interface Specification Revision 1.1 Chapter 3 PCI Power Management Interface”.
Page 529
Section 13 PCI Controller (PCIC) (27) PCIPMCSR Bridge Support Extension Register (PCIPMCSRBSE) This register supports PCI bridge specific functionality and is required for all PCI-to-PCI bridges. Bit: — — — — — — B2B3N Initial value: SH R/W: PCI R/W: Initial Bit Name Value...
Page 530
Section 13 PCI Controller (PCIC) (28) PCI Power Consumption/Radiation Register (PCIPCDD) The data register is an 8-bit register that provides a mechanism for the function to report state dependent operating data such as power consumed or heat dissipation. For details, refer to “PCI Bus Power Management Interface Specification Revision 1.1 Chapter 3 PCI Power Management Interface”.
Section 13 PCI Controller (PCIC) 13.3.3 Local Register PCI Control Register (PCICR) PCICR is a 32-bit register which specifies the operation of the PCIC. The register is write protected; only writes in which the upper eight bits (that is, bits 31 to 24) have the value H'A5 are performed.
Page 532
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description SH: R/W Byte Swap PCI: R Specifies whether or not byte data is swapped when accessing to the PCI local bus. 0: No swap 1: Byte data is swapped For details, see section 13.4.3 (5), Endian or section 13.4.4 (6), Endian.
Page 533
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description PCIRESET Output RSTCTL SH: R/W Controls the PCIRESET output by software. This bit is PCI: R valid when the PCIC operates in host bus bridge mode. 0: Negates PCIRESET output (high level output) 1: Asserts PCIRESET output (low level output) Note: The PCIRESET is also asserted during power- on reset.
Page 534
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description 31 to 29 All 0 SH: R Reserved PCI: R These bits are always read as 0. The write value should always be 0. 28 to 20 LSR 0 0000 SH: R/W Size of Local Address Space 0 (9 bits) 0000...
Page 535
Section 13 PCI Controller (PCIC) PCI Local Space Register 1 (PCILSR1) Refer to Section 13.4.4 (1), Accessing This LSI Address Space. Bit: — — — — — — — Initial value: SH R/W: PCI R/W: Bit: — — — — —...
Page 536
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description MBARE SH: R/W PCI Memory Base Address Register 1 Enable PCI: R The local address space 1 can be accessed by setting this bit to 1. 0: PCIMBAR1 disabled 1: PCIMBAR1 enabled PCI Local Address Register 0 (PCILAR0) Refer to Section 13.4.4 (1), Accessing This LSI Address Space.
Page 538
Section 13 PCI Controller (PCIC) PCI Interrupt Register (PCIIR) PCIIR records the source of an interrupt. When multiple interrupts occur, only the first source is registered. When an interrupt is disabled, the source is registered in corresponding bit (set to 1) in this register, however, no interrupt occurs.
Page 539
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description 13 to 10 All 0 SH: R Reserved PCI: R These bits are always read as 0. The write value should always be 0. TMTOI SH: R/WC Target Memory Read Retry Timeout Interrupt PCI: R When the PCIC functions as a target, the master did not attempt a retry within the prescribed number of...
Page 540
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description APEDI SH: R/WC Address Parity Error Detection Interrupt PCI: R Indicates an address parity error has been detected. When both the PER and SERRE bits in the PCI command register are set to 1, an address parity error is detected.
Page 541
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description Data Parity Error Interrupt for Target PERR PEDITR SH: R/WC Indicates that the PERR signal has been received PCI: R during a target read access (only detected when PCICMD.PER is set to 1) when the PCIC functions as a target.
Page 542
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description Master Write PERR Detection Interrupt MWPDI SH: R/WC Indicates that the PERR signal has been received PCI: R during a master write access (only detected when PCICMD.PER is set to 1) when the PCIC functions as a master.
Page 543
Section 13 PCI Controller (PCIC) PCI Interrupt Mask Register (PCIIMR) This register is the mask register for PCIIR. Bit: — — — — — — — — — — — — — — — — Initial value: SH R/W: PCI R/W: Bit: DPEI DPEI...
Page 544
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description SERR Detection Interrupt Mask SEDIM SH: R/W PCI: R 0: PCIIR.SEDI disabled (masked) 1: PCIIR.SEDI enabled (not masked) DPEITWM 0 SH: R/W Data Parity Error Interrupt Mask for Target Write PCI: R 0: PCIIR.DPEITW disabled (masked) 1: PCIIR.DPEITW enabled (not masked)
Page 545
Section 13 PCI Controller (PCIC) PCI Error Address Information Register (PCIAIR) This register records PCI address information when an error is detected. Bit: Initial value: — — — — — — — — — — — — — — — —...
Page 546
Section 13 PCI Controller (PCIC) PCI Error Command Information Register (PCICIR) This register records the PCI command information when an error is detected. Bit: MTEM — — — — — — — — — — — — — — Initial value: —...
Page 547
Section 13 PCI Controller (PCIC) (10) PCI Arbiter Interrupt Register (PCIAINT) In host bus bridge mode, this register records source of an interrupt. When multiple interrupts occur, only the first source is registered. When an interrupt is disabled, source is registered in corresponding bit (set to 1) in this register, however, no interrupt occurs.
Page 548
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description TBTOI SH: R/WC Target Bus Time-Out Interrupt An interrupt is detected when the TRDY or STOP PCI: R signal is not asserted within 16 clock cycles on the first data transfer. An interrupt is detected when the TRDY or STOP signal is not asserted within eight clock cycles during the data transfer subsequent to the 2nd.
Page 549
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description SH: R/WC Target-Abort Interrupt PCI: R Indicates that a transaction is terminated with a target-abort when a device other than the PCIC functions as a bus master. 0: Target-abort interrupt does not occur [Clear condition] Write 1 to this bit (write clear).
Page 550
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description WDPEI SH: R/WC Write Parity Error Interrupt The PERR assertion is detected during a data write PCI: R when a device other than the PCIC functions as a bus master. 0: Write parity error interrupt does not occur [Clear condition] Write 1 to this bit (write clear).
Page 551
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description MBIM SH: R/WC Master-Broken Interrupt Mask PCI: R 0: PCIAINT.MBI disabled (masked) 1: PCIAINT.MBI enabled (not masked) TBTOIM SH: R/WC Target Bus Time-Out Interrupt Mask PCI: R 0: PCIAINT.TBTOI disabled (masked) 1: PCIAINT.TBTOI enabled (not masked) MBTOIM SH: R/WC...
Page 552
Section 13 PCI Controller (PCIC) (12) PCI Arbiter Bus Master Information Register (PCIBMIR) In host bridge mode, this register records when the interrupt is invoked by PCIAINT. When multiple interrupts occur, only the first source is registered. When an interrupt is masked, the source is registered in corresponding bit (set to 1), however, an interrupt occurs.
Page 553
Section 13 PCI Controller (PCIC) (13) PCI PIO Address Register (PCIPAR) This register is configuration address register. Refer to Section 13.4.5 (2), Configuration Space Access. Bit: CCIE — — — — — — — Initial value: — — — — —...
Page 554
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description 15 to 11 DN Undefined SH: R/W Device Number PCI: Specify the device number for a configuration access. Device numbers ranging from 0 to 31 are represented in five bits. A single bit of bits 31 to 16 of the AD signals is driven to high level instead of the IDSEL assertion.
Page 555
Section 13 PCI Controller (PCIC) (14) PCI Power Management Interrupt Register (PCIPINT) This register controls the power management interrupt. Bit: — — — — — — — — — — — — — — — — Initial value: SH R/W: PCI R/W: —...
Page 556
Section 13 PCI Controller (PCIC) (15) PCI Power Management Interrupt Mask Register (PCIPINTM) This is the mask register for PCIPINT. Bit: — — — — — — — — — — — — — — — — Initial value: SH R/W: PCI R/W: —...
Page 557
Section 13 PCI Controller (PCIC) (16) PCI Memory Bank Register 0 (PCIMBR0) This register specifies the upper 14-bit address of the PCI memory space 0 (address bits 31 to 18). Refer to Section 13.4.3 (2), Accessing PCI Memory Space. Bit: PMSBA0 —...
Page 558
Section 13 PCI Controller (PCIC) (17) PCI Memory Bank Mask Register 0 (PCIMBMR0) This register specifies the size of the PCI memory space 0. Refer to Section 13.4.3 (2), Accessing PCI Memory Space. Bit: — — — — — — —...
Page 559
Section 13 PCI Controller (PCIC) (18) PCI Memory Bank Register 1 (PCIMBR1) This register specifies the upper 14-bit address of the PCI memory space 1 (address bits 31 to 18). Refer to Section 13.4.3 (2), Accessing PCI Memory Space. Bit: PMSBA1 —...
Page 560
Section 13 PCI Controller (PCIC) (19) PCI Memory Bank Mask Register 1 (PCIMBMR1) This register specifies the size of the PCI memory space 1. Refer to Section 13.4.3 (2), Accessing PCI Memory Space. Bit: — — — — — — MSBAM1 —...
Page 561
Section 13 PCI Controller (PCIC) (20) PCI Memory Bank Register 2 (PCIMBR2) This register specifies the upper 14-bit address of the PCI memory space 2 (address bits 31 to 18). Refer to Section 13.4.3 (2), Accessing PCI Memory Space. Bit: PMSBA2 —...
Page 562
Section 13 PCI Controller (PCIC) (21) PCI Memory Bank Mask Register 2 (PCIMBMR2) This register specifies the size of the PCI memory space 2. Refer to Section 13.4.3 (2), Accessing PCI Memory Space. Bit: — — — MSBAM2 — — Initial value: SH R/W: PCI R/W:...
Page 563
Section 13 PCI Controller (PCIC) (22) PCI I/O Bank Register (PCIIOBR) This register specifies the upper 14-bit address of the PCI I/O space (address bits 31 to 18). Refer to Section 13.4.3 (3), Accessing PCI I/O Space. Bit: PIOSBA — —...
Page 564
Section 13 PCI Controller (PCIC) (23) PCI I/O Bank Mask Register (PCIIOBMR) This register specifies the size of the PCI I/O space. Refer to Section 13.4.3 (2), Accessing PCI Memory Space. Bit: — — — — — — — — —...
Page 565
Section 13 PCI Controller (PCIC) (24) PCI Cache Snoop Control Register 0 (PCICSCR0) An external device can access local memory of this LSI via the PCIC. When an external PCI device accesses cacheable areas of this LSI, the PCIC can support cache snoop function to the on- chip caches.
Page 566
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description 1, 0 SNPMD All 0 SH: R/W Snoop Mode for PCICSAR0 PCI: — Specify if PCICSAR0 is compared with address requested by an external device. Also, specify how snoop function is executed when PCICSAR0 is compared.
Page 567
Section 13 PCI Controller (PCIC) (25) PCI Cache Snoop Control Register 1 (PCICSCR1) An external device can access local memory of this LSI via the PCIC. When an external PCI device accesses cacheable areas of this LSI, the PCIC can support cache snoop function to the on- chip caches.
Page 568
Section 13 PCI Controller (PCIC) Initial Bit Name Value Description 1, 0 SNPMD All 0 SH: R/W Snoop Mode for PCICSAR1 PCI: — Specify if PCICSAR1 is compared with address requested by an external device. Also, specify how snoop function is executed when PCICSAR1 is compared.
Page 569
Section 13 PCI Controller (PCIC) (26) PCI Cache Snoop Address Register 0 (PCICSAR0) PCICSAR0 specifies the address to be compared with the PCI address requested by an external device. Refer to section 13.4.4 (7), Cache Coherency. Bit: CADR Initial value: SH R/W: PCI R/W: —...
Page 570
Section 13 PCI Controller (PCIC) (27) PCI Cache Snoop Address Register 1 (PCICSAR1) PCICSAR1 specifies the address to be compared with the PCI address requested by an external device. Refer to section 13.4.4 (7), Cache Coherency. Bit: CADR Initial value: SH R/W: PCI R/W: —...
Page 571
Section 13 PCI Controller (PCIC) (28) PCI PIO Data Register (PCIPDR) When accessed, this register will cause the generation of a configuration cycle on the PCI bus. Refer to section 13.4.5 (2), Configuration Space Access. Bit: Initial value: — — —...
Section 13 PCI Controller (PCIC) 13.4.2 PCIC Initialization After a power-on reset, the PCIC enable bit (ENBL) of the PCIC enable control register (PCIECR) and the internal register initialization bit (CFINIT) of the PCI control register (PCICR) is cleared. At this point, if the PCIC is operating as the PCI bus host (host bus bridge mode), the bus privileges are permanently granted to the PCIC, and no device arbitration is performed on the PCI bus.
Section 13 PCI Controller (PCIC) 13.4.3 Master Access This section describes how the PCIC is accessed by software in this LSI and the restrictions on usage, such as buffering and synchronization with other devices, when the PCIC is used in both the host bus bridge and normal modes.
Section 13 PCI Controller (PCIC) Accessing PCI Memory Space Figure 13.2 shows the method for accessing the PCI bus allocated to the PCI memory space from the SuperHyway bus. SuperHyway bus PCI local bus address space (4GB) address space (4GB) H'0000 0000 16 Mbytes H'1000 0000...
Section 13 PCI Controller (PCIC) For PCI memory space 0 accesses, bits 23 to 18 of a SuperHyway bus address are controlled by PCI memory bank mask register 0 (PCIMBMR0). Note: In the following items and figures, “SH” means the SuperHyway bus of this LSI and “PCI”...
Section 13 PCI Controller (PCIC) 26 25 18 17 26 25 18 17 SH address PCI address mask 26 25 18 17 26 25 18 17 PCIMBMR1 PCIMBR1 MSBAM1 PMSBA1 Figure 13.4 SuperHyway Bus to PCI Local Bus Address Translation (PCI Memory Space 1) For PCI memory space 2 accesses, bits 28 to 18 of a SuperHyway address are controlled by the PCI memory bank mask register 2 (PCIMBMR2).
Section 13 PCI Controller (PCIC) Accessing PCI I/O Space Access within the size of 4-byte. Burst I/O transfers are not supported. The PCI I/O address space is allocated from H'FD20 0000 to H'FE3F FFFF (2 Mbytes). Address translation from SuperHyway bus to PCI local bus The lower 15 bits ([17:3]) of a SuperHyway bus address are sent without translation.
Page 579
Section 13 PCI Controller (PCIC) Accessing Internal Registers of this LSI All internal registers, that is, PCIECR, PCI configuration registers, and PCI local registers are accessible from the CPU. 4-byte, 2-byte, and byte transmission are supported. Endian The PCIC of this LSI supports both the big endian and little endian formats. Since PCI local bus is inherently little endian, the PCIC supports both byte swapping and non-byte swapping.
Section 13 PCI Controller (PCIC) 1. Little Endian MSByte LSByte SH data C' D' A Buffer data C' D' A PCI Address[2] = 1 PCI Address[2] = 0 PCI data 2. Big Endian MSByte LSByte SH data C' D' Buffer data C' D' PCI Address[2] = 0 PCI Address[2] = 1...
Section 13 PCI Controller (PCIC) 1. Little Endian MSByte LSByte SH data C' D' A Buffer data C' D' A PCI Address[2] = 1 PCI Address[2] = 0 PCI data 2. Big Endian MSByte LSByte SH data D' C' B' Buffer data C' D' PCI Address[2] = 1...
Section 13 PCI Controller (PCIC) 13.4.4 Target Access This section describes how the PCIC of this LSI is accessed by an external PCI local bus master when the PCIC is used in both the host bus bridge and normal modes. Accessing This LSI Address Space Accesses to the address space of this LSI by an external PCI bus master are described here.
Page 583
Section 13 PCI Controller (PCIC) To access the address space of this LSI, use the PCI memory base address register (PCIMBAR0/1), PCI local space register (PCILSR0/1), and PCI local address register (PCILAR0/1). The address spaces are mapped by software. The PCIC includes two memory mapping registers.
Section 13 PCI Controller (PCIC) 2928 20 19 2928 2019 SH address PCI address compare 29 28 2019 2928 2019 PCIMBAR0/1 PCILAR0/1 MBA (upper) 2928 2019 PCILSR0/1 0 0 0 0 0 1 1 0 0 Figure 13.10 PCI Local Bus to SuperHyway Bus Address Translation (Local Address Space 0/1) When all the MBARE bits in PCILSR0/1 are 0, the PCI local bus address is sent to the SuperHyway bus without translation.
Section 13 PCI Controller (PCIC) SH address H'FE04 01 PCI Address compare IOB (upper) PCIIBAR Figure 13.11 PCI Local Bus to SuperHyway Bus Address Translation (PCIC I/O Space) Accessing PCIC Registers Configuration Registers: Access the configuration registers using an offset from the PCI configuration register space base address with the configuration read or write command.
Page 586
Section 13 PCI Controller (PCIC) Exclusive Access The lock access on the PCI bus is supported. When the PCI local bus is locked, the PCIC is accessible from the device that activates the LOCK signal. SuperHyway bus resource lock does not occur. (Another on-chip module can access the PCIC during a lock transfer.) Endian This LSI supports both the big and little endian formats.
Section 13 PCI Controller (PCIC) 1. Little Endian PCI data PCI Address[2] = 0 PCI Address[2] = 1 Buffer data C' D' A MSByte LSByte SH data C' D' A 2. Big Endian PCI data PCI Address[2] = 1 PCI Address[2] = 0 Buffer data C' D' MSByte...
Section 13 PCI Controller (PCIC) 1. Little Endian PCI data PCI Address[2] = 0 PCI Address[2] = 1 Buffer data C' D' D MSByte LSByte SH data C' D' A 2. Big Endian PCI data PCI Address[2] = 1 PCI Address[2] = 0 Buffer data D' C' B' MSByte...
Page 589
Section 13 PCI Controller (PCIC) Cache Coherency The PCIC supports cache snoop function. When the PCIC functions as a target device, cache coherency is guaranteed for accesses from a master device connected to a PCI bus in both the host bus bridge mode and normal mode. When accessing this LSI cacheable area, set the cache snoop registers: the PCI cache snoop control registers (PCICSCR0 and PCICSCR1) and PCI cache snoop address register (PCICSAR0 and PCICSAR1).
Section 13 PCI Controller (PCIC) PCI address Cache snoop control register SuperHyway address Cache snoop address register compare No hit issue the flush/purge Issue the read/write issue the read/write Figure 13.14 Cache Flush/Purge Execution Flow for PCI local Bus to SuperHyway Bus Rev.1.00 Dec.
Section 13 PCI Controller (PCIC) 13.4.5 Host Bus Bridge Mode PCI Host bus bridge Mode Operation The PCIC supports a subset of the PCI Local Bus Specification Revision 2.2 and can be connected to a device with a PCI bus interface. While the PCIC is set in host bus bridge mode, or while set in normal mode, operation differs according to whether or not bus parking is performed, and whether or not the PCI bus arbiter function is enabled or not.
Section 13 PCI Controller (PCIC) 31 30 24 23 16 15 11 10 Configuration Reserved address register (PCIPAR) CCIE PCI local bus Only one '1' 00000 address (AD31 to AD0) 16 15 11 10 Figure 13.15 Address Generation for Type 0 Configuration Access In configuration accesses, a PCI master abort (no device connected) will not cause an interrupt.
Section 13 PCI Controller (PCIC) After device 1 has claimed and granted the bus, and transferred data, the priority is as follows: PCIC > device 0 > device 2 > device 3 > device 1 Then, after the PCIC has claimed and granted the bus, and transferred data, the priority is changed Device 0 >...
Section 13 PCI Controller (PCIC) The PCIC can store the error information on the PCI bus. If an error occurs, the error address is stored in the PCI error address information register (PCIAIR), the types of transfer and command information are stored in the PCI error command information register. And then if the PCIC operates host bus bridge mode, the bus master information is stored in the PCI error bus master information register.
Section 13 PCI Controller (PCIC) (normal) (clock stop) (bus idle) (power down) Figure 13.16 PCI Local Bus Power Down State Transition The PCIC detects when the power state (PS) bit of the PCI power management control/status register changes (when it is written to from an external PCI device), and issues a power management interrupt.
Section 13 PCI Controller (PCIC) Master Read/Write Cycle Timing Figures13.17 is an example of a single-write cycle in host bus bridge mode. Figure 13.18 is an example of a single read cycle in host bus bridge mode. Figure 13.19 is an example of a burst write cycle in normal mode.
Section 13 PCI Controller (PCIC) PCICLK AD[31:0] Addr DPn-1 CBE[3:0] (C/BE[3:0]) PCIFRAME IRDY DEVSEL TRDY LOCK IDSEL [Legend] Addr: PCI space address nth data Address parity DPn: nth data parity Com: Command BEn: nth data byte enable Figure 13.20 Master Read Cycle in Normal Mode (Burst) Rev.1.00 Dec.
Page 600
Section 13 PCI Controller (PCIC) Target Read/Write Cycle Timing The PCIC responds to target memory burst read accesses from an external master by retries until 8 longword (32-bit) data are prepared in the PCIC's internal FIFO. That is, it always responds to the first target burst read with a retry.
Section 13 PCI Controller (PCIC) Address/Data Stepping Timing By writing 1 to the SC bit in PCICMD, a wait (stepping) of one clock can be inserted when the PCIC is driving the AD bus. As a result, the PCIC drives the AD bus over 2 clocks. This function can be used when there is a heavy load on the PCI bus and the AD bus does not achieve the stipulated logic level in one clock.
Section 14 Direct Memory Access Controller (DMAC) Section 14 Direct Memory Access Controller (DMAC) This LSI includes the direct memory access controller (DMAC). The DMAC can be used in place of the CPU to perform high-speed transfers between external devices that have DACK (DMA transfer end notification), external memory, on-chip memory, memory-mapped external devices, and peripheral modules.
Section 14 Direct Memory Access Controller (DMAC) Figure 14.1 shows the block diagram of the DMAC. DMAC channels 0 to 5 SARm On-chip memory Iteration control DARm Peripheral Peripheral bus bridge module Register TCRm Peripheral control CHCRm Start-up control DMAOR0 DMA transfer request signal DMARS0-2 DMA transfer acknowledge signal...
Section 14 Direct Memory Access Controller (DMAC) 14.2 Input/Output Pins The external pins for the DMAC are described below. Table 14.1 lists the configuration of the pins that are connected to external device. The DMAC has pins for four channels (channel 0 to 3) for external bus use.
Page 610
Section 14 Direct Memory Access Controller (DMAC) Channel Pin Name Function Description DREQ3* DMA transfer request Input DMA transfer request input from external device to channel 3 DRAK3* DREQ3 acceptance Output Notifies acceptance of DMA transfer confirmation request and start of execution from channel 3 to external device DACK3* DMA transfer end...
Section 14 Direct Memory Access Controller (DMAC) 14.3 Register Descriptions Table 14.2 shows the configuration of registers of the DMAC. Table 14.3 shows the register states in each processing mode. Table 14.2 Register Configuration of DMAC Access Channel Name Abbrev. P4 Address Area 7 Address Size*...
Section 14 Direct Memory Access Controller (DMAC) 14.3.2 DMA Source Address Registers B0 to B3, B6 to B9 (SARB0 to SARB3, SARB6 to SARB9) SARB are 32-bit readable/writable registers that specify the source address of a DMA transfer that is set in SAR again in repeat/reload mode. Data to be written from the CPU to SAR is also written to SARB.
Section 14 Direct Memory Access Controller (DMAC) 14.3.4 DMA Destination Address Registers B0 to B3, B6 to B9 (DARB0 to DARB3, DARB6 to DARB9) DARB are 32-bit readable/writable registers that specify the destination address of a DMA transfer that is set in DAR again in repeat/reload mode. Data to be written from the CPU to DAR is also written to DARB.
Section 14 Direct Memory Access Controller (DMAC) 14.3.5 DMA Transfer Count Registers 0 to 11 (TCR0 to TCR11) TCR are 32-bit readable/writable registers that specify the DMA transfer count. The number of transfers is 1 when the setting is H'00000001, 16,777,215 when H'00FFFFFF is set, and 16,777,216 (the maximum) when H'00000000 is set.
Section 14 Direct Memory Access Controller (DMAC) 14.3.6 DMA Transfer Count Registers B0 to B3, B6 to B9 (TCRB0 to TCRB3, TCRB6 to TCRB9) TCRB are 32-bit readable/writable registers. Data to be written from the CPU to TCR is also written to TCRB.
Section 14 Direct Memory Access Controller (DMAC) 14.3.7 DMA Channel Control Registers 0 to 11 (CHCR0 to CHCR11) CHCR are 32-bit readable/writable registers that control the DMA transfer mode. Bit: LCKN RPT[2:0] Initial value: R/W: R/W R/(W)* R/W Bit: DM[1:0] SM[1:0] RS[3:0] TS[1:0]...
Page 623
Section 14 Direct Memory Access Controller (DMAC) Initial Bit Name Value Descriptions 27 to 25 RPT[2:0] DMA Setting Renewal Specify These bits are enabled in CHCR0 to CHCR3 and CHCR6 to CHCR9. 000: Normal mode (DMAC operation) 001: Repeat mode SAR/DAR/TCR used as repeat area 010: Repeat mode DAR/TCR used as repeat area...
Page 624
Section 14 Direct Memory Access Controller (DMAC) Initial Bit Name Value Descriptions DMA Transfer Size Specify With TS1 and TS0 (bits 4 and 3), this bit specifies the DMA transfer size. When the transfer source or transfer destination is a register of an peripheral module that access size is designated, the transfer size for the register should be the same value of its access size.
Page 625
Section 14 Direct Memory Access Controller (DMAC) Initial Bit Name Value Descriptions R/(W)* Half End Flag After HIE (bit 18) is set to 1 and the number of transfers become half of TCR (1 bit shift to right) which is set before transfer starts, HE becomes 1.
Page 626
Section 14 Direct Memory Access Controller (DMAC) Initial Bit Name Value Descriptions Half End Interrupt Enable Specifies whether an interrupt request is generated to the CPU when the number of transfers is decreased to half of the TCR value (a read transfer cycle end) set preceding the transfer.
Page 627
Section 14 Direct Memory Access Controller (DMAC) Initial Bit Name Value Descriptions 15, 14 DM[1:0] Destination Address Mode 1, 0 Specify whether the DMA destination address is incremented, decremented, or left fixed. 00: Fixed destination address 01: Destination address is incremented +1 in byte units transfer +2 in word units transfer +4 in longword units transfer...
Page 628
Section 14 Direct Memory Access Controller (DMAC) Initial Bit Name Value Descriptions 11 to 8 RS[3:0] 0000 Resource Select 3 to 0 Specify which transfer requests will be sent to the DMAC. The changing of transfer request source should be done in the state that the DMA enable bit (DE) is cleared to 0.
Page 629
Section 14 Direct Memory Access Controller (DMAC) Initial Bit Name Value Descriptions Interrupt Enable Specifies whether or not an interrupt request is generated to the CPU at the end of the final DMA transfer. Setting this bit to 1 generates an interrupt request (DMINT) to the CPU when the TE bit is set to 1 and the final DMA transfer of read cycle ended.
Page 630
Section 14 Direct Memory Access Controller (DMAC) Initial Bit Name Value Descriptions DMA Enable Enables or disables the DMA transfer. In auto request mode, DMA transfer starts by setting the DE bit and DME bit in DMAOR to 1. In this time, all of the bits TE, NMIF, and AE in DMAOR must be 0.
Section 14 Direct Memory Access Controller (DMAC) 14.3.8 DMA Operation Register 0, 1 (DMAOR0 and DMAOR1) DMAOR is a 16-bit readable/writable register that specifies the priority level of channels at the DMA transfer. This register shows the DMA transfer status. DMAOR 0 is for channel 0 to 5, and DMAOR1 is for channel 6 to11.
Page 632
Section 14 Direct Memory Access Controller (DMAC) Initial Bit Name Value Descriptions 9, 8 PR[1:0] Priority Mode 1, 0 Select the priority level between channels when there are transfer requests for multiple channels simultaneously. 00: CH0 > CH1 > CH2 > CH3 > CH4 > CH5 (DMAOR0) CH6 >...
Page 633
Section 14 Direct Memory Access Controller (DMAC) Initial Bit Name Value Descriptions NMIF R/(W)* NMI Flag Indicates that an NMI interrupt occurred. If this bit is set, DMA transfer is disabled even if the DE bit in CHCR and the DME bit in DMAOR are set to 1. When the NMI is input, the DMA transfer in progress can be done in at least one transfer unit.
Section 14 Direct Memory Access Controller (DMAC) 14.3.9 DMA Extended Resource Selectors (DMARS0 to DMARS2) DMARS are 16-bit readable/writable registers that specify the DMA transfer sources from peripheral modules in each channel. DMARS0 specifies for channels 0 and 1, DMARS1 specifies for channels 2 and 3, and DMARS2 specifies for channels 4 and 5.
Page 635
Section 14 Direct Memory Access Controller (DMAC) • DMARS1 Bit: C3MID[5:0] C3RID[1:0] C2MID[5:0] C2RID[1:0] Initial value: R/W: Initial Bit Name Value Descriptions 15 to 10 C3MID[5:0] 000000 Transfer request module ID5 to ID0 for DMA channel 3 (MID) See table 14.4. 9, 8 C3RID[1:0] 00 Transfer request register ID1 and ID0 for DMA channel...
Page 636
Section 14 Direct Memory Access Controller (DMAC) • DMARS2 Bit: C5MID[5:0] C5RID[1:0] C4MID[5:0] C4RID[1:0] Initial value: R/W: Initial Bit Name Value Descriptions 15 to 10 C5MID[5:0] 000000 Transfer request module ID5 to ID0 for DMA channel 5 (MID) See table 14.4. 9, 8 C5RID[1:0] 00 Transfer request register ID1 and ID0 for DMA channel...
Section 14 Direct Memory Access Controller (DMAC) 14.4 Operation When there is a DMA transfer request, the DMAC starts the transfer according to the predetermined channel priority; when the transfer end conditions are satisfied, it ends the transfer. Transfers can be requested in three modes: auto request, external request, and peripheral module request.
Section 14 Direct Memory Access Controller (DMAC) Table 14.5 Selecting External Request Detection with DL, DS Bits CHCRn (n = 0 to 3) Detection of External Request Low level detection (initial value; DREQ) Falling edge detection High level detection Rising edge detection When DREQ is accepted, the DREQ pin becomes request accept disabled state.
Page 640
Section 14 Direct Memory Access Controller (DMAC) When a transmit data empty transfer request of the SCIF0 is set as the transfer request, the transfer destination must be the SCIF0's transmit data register. Likewise, when receive data full transfer request of the SCIF0 is set as the transfer request, the transfer source must be the SCIF0's receive data register.
Section 14 Direct Memory Access Controller (DMAC) 14.4.2 Channel Priority When the DMAC receives simultaneous transfer requests on two or more channels, it transfers data according to a predetermined priority. Two modes (fixed mode and round-robin mode) are selected by the bits PR[1:0] in DMAOR0 for channels 0 to 5 and DMAOR1 for channels 6 to 11. If the DMAC receives simultaneous transfer requests from both any channels 0 to 5 and 6 to 11 respectively, then executes each channels 0 to 5 or 6 to 11 request alternately (initial state: channel 0 to 5 is higher priority).
Section 14 Direct Memory Access Controller (DMAC) Figure 14.3 shows how the priority changes when channel 0 and channel 3 transfers are requested simultaneously and a channel 1 transfer is requested during the channel 0 transfer. The DMAC operates as follows: 1.
Section 14 Direct Memory Access Controller (DMAC) 14.4.3 DMA Transfer Types DMA transfer type is dual address mode transfer. A data transfer timing depends on the bus mode, which has cycle steal mode and burst mode. Dual Address Modes: In dual address mode, both the transfer source and destination are accessed by an address. The source and destination can be located externally or internally.
Section 14 Direct Memory Access Controller (DMAC) Auto request, external request, and peripheral module request are available for the transfer request. DACK can be output in read cycle or write cycle in dual address mode. CHCR can specify whether the DACK is output in read cycle or write cycle. Figure 14.5 shows an example of DMA transfer timing in dual address mode.
Section 14 Direct Memory Access Controller (DMAC) Bus Modes: There are two bus modes: cycle steal mode and burst mode. Select the mode in the TB and LCKN bits in CHCR. Moreover, cycle steal mode has normal and intermittent modes that are specified by the CMS bits in DMAOR.
Section 14 Direct Memory Access Controller (DMAC) DREQ Bus mastership retured to CPU once SuperHyway DMAC DMAC DMAC DMAC bus cycle Read Write Read Write Figure 14.7 DMA Transfer Timing Example in Cycle-Steal Normal Mode 2 (DREQ Low Level Detection) ...
Section 14 Direct Memory Access Controller (DMAC) • Burst Mode (LCKN = 0, TB = 1) In burst mode, once the DMAC obtains the SuperHyway bus mastership, the transfer is performed continuously without releasing the bus mastership until the transfer end condition is satisfied.
Section 14 Direct Memory Access Controller (DMAC) Table 14.9 DMA Transfer Matrix in External Request Mode (only channels 0 to 3) Transfer Destination L RAM, Peripheral SuperHyway Transfer Source LBSC space DDRIF space PCIC space module* LBSC space Yes* Yes* DDRIF space Yes* Yes*...
Section 14 Direct Memory Access Controller (DMAC) Table 14.10 DMA Transfer Matrix in Peripheral module Request Mode Transfer Destination L RAM, Peripheral SuperHyway Transfer Source LBSC space DDRIF space PCIC space module* LBSC space DDRIF space PCIC space Peripheral module* L RAM, SuperHyway RAM No [Legend] Yes:...
Section 14 Direct Memory Access Controller (DMAC) 14.4.5 Repeat Mode Transfer In a repeat mode transfer, a DMA transfer is repeated without specifying the transfer settings every time before executing a transfer. Using a repeat mode transfer with the half end function allows a double buffer transfer executed virtually.
Section 14 Direct Memory Access Controller (DMAC) not cleared in the procedure 4, then the transfer is stopped according to the condition of both the HE and the TE bits are set to 1. As explained above, a repeat mode transfer enables sequential voice compression by changing buffer for storing data received consequentially and a data buffer for processing signals alternately.
Section 14 Direct Memory Access Controller (DMAC) 14.4.7 DREQ Pin Sampling Timing Figures 14.13 to 14.16 show the sample timing of the DREQ input in each bus mode, respectively. CKOUT DMAC Bus cycle DREQ (Falling edge) 1st acceptance 2nd acceptance DRAK (Low-active) DACK...
Section 14 Direct Memory Access Controller (DMAC) 14.5 Usage Notes Pay attentions to the following notes when the DMAC is used. 14.5.1 Module Stop While the DMAC is in operation, modules should not be stopped by setting MSTPCR (transition to the module standby state) .When modules are stopped, transfer contents cannot be guaranteed. 14.5.2 Address Error When a DMA address error is occurred, after execute the following procedure, and then start a...
Section 14 Direct Memory Access Controller (DMAC) 14.5.4 DACK output division The DACK output is divided to align the data unit like the CSn output when a DMA transfer unit is divided with multiple bus cycles, for example when an 8-bit or 16-bit external device is accessed in longword units, or when an 8-bit external device is accessed in word units, and the CSn output is negated between these bus cycles.
Page 660
Section 14 Direct Memory Access Controller (DMAC) The transfer destination is the LBSC space and the DACK is output during the write cycle: (1) Set B'001 to B'111 (i.e., other than 000) to the IWW bits in CSnBCR Note: * The transfer source is the LBSC space and the DACK is output during the read cycle or the transfer destination is the LBSC space and the DACK is output during the write cycle.
Section 14 Direct Memory Access Controller (DMAC) Table14.11 Register Settings for SRAM, Burst ROM, Byte Control SRAM Interface Register Settings of CSn is not negated Bus Width DMA Transfer Bus Cycle CSnBCR.IWRRD, [bit] Access Size Number IWRRS or IWW CSnWCR.ADS and ADH Byte Word B'000...
Section 14 Direct Memory Access Controller (DMAC) Table14.12 Register Settings for PCMCIA Interface Register Settings of CSn is not negated Bus Width DMA Transfer Bus Cycle [bit] Access Size Number CSnBCR.IWRRD,IWRRS or IWW Byte Word Longword 16-Byte B'000 32-Byte Byte Word Longword 16-Byte...
Section 15 Clock Pulse Generator (CPG) Section 15 Clock Pulse Generator (CPG) The CPG generates clocks provided to both the inside and outside of the SH7780, and controls the power-down mode function. The CPG comprises a crystal oscillator circuit, PLLs, and a divider. 15.1 Features The CPG has the following features.
Section 15 Clock Pulse Generator (CPG) Figure 15.1 is a block diagram of the CPG. PLL circuit 2 CLKOUT (× 1) Divider Bus clock (Bck) (× 1/2) CPU clock Oscillator (× 1/4) (Ick) XTAL (× 1/5) PLL circuit 1 (× 1/6) SuperHyway (×...
Page 665
Section 15 Clock Pulse Generator (CPG) The function of each block is described below. • PLL circuit 1 PLL circuit 1 multiplies the frequency of the external crystal oscillator and the clock input on the EXTAL pin by 24. • PLL circuit 2 PLL circuit 2 coordinates the phases of the bus clock (Bck) and the clock signal output from the CLKOUT pin that is used as the external peripheral interface clock.
Section 15 Clock Pulse Generator (CPG) 15.3 Clock Operating Modes The correspondence between settings of the mode control pins (MODE7 and MODE2 to MODE0) and clock operating modes after power-on reset is shown in table 15.2. Table 15.2 Clock Operating Modes Frequency Multiplication Ratio Clock Mode Control Pin Setting...
Section 15 Clock Pulse Generator (CPG) 15.4.1 Frequency Control Register (FRQCR) FRQCR is a 32-bit readable/writable register that selects the frequency division ratio of the SuperHyway clock (SHck), the peripheral clock (Pck), the DDR clock (DDRck) and the bus clock (Bck).
Page 670
Section 15 Clock Pulse Generator (CPG) Initial Bit Name Value R/W Description BFC3 Bus Clock (B ) Frequency Division Ratio Setting 0011: ×3 BFC2 Undefined 0100: ×2 BFC1 Undefined 0101: ×3/2 BFC0 Undefined 0110: ×1 Other than above: Setting prohibited The initial value of this field after power-on reset depends on the mode pin setting (see table 15.2).
Section 15 Clock Pulse Generator (CPG) 15.4.2 PLL Control Register (PLLCR) PLLCR is a 32-bit readable/writable register that controls the clock output on the CLKOUT pin. This register can only be accessed in longwords. BIt: ...
Section 15 Clock Pulse Generator (CPG) 15.5 Notes on Board Design When Using Crystal Resonator: Place the crystal resonator and capacitors close to the EXTAL and XTAL pins. To prevent induction from interfering with correct oscillation, ensure that no other signal lines cross the signal lines for these pins. Crystal Resonator Recommended values CL1 = CL2 = 0 to 33 pF...
Section 16 Watchdog Timer and Reset Section 16 Watchdog Timer and Reset The reset and watchdog timer (WDT) control circuit comprises the reset control unit and WDT control unit which control the power-on reset sequence and a reset for on-chip peripheral modules and external devices.
Section 16 Watchdog Timer and Reset 16.2 Input/Output Pins Table 16.1 shows the pin configuration of the reset control unit. Table 16.1 Pin Configuration Pin name Function Description PRESET Reset Input Power-on reset MRESETOUT* Manual reset output Output Low level output during manual reset execution STATUS1* Processing state 1...
Section 16 Watchdog Timer and Reset 16.3 Register Descriptions Table 16.2 shows the registers of the reset and watchdog timer. Table 16.3 shows the register states in each processing mode. Table 16.2 Register Configuration Area 7 Access Sync Register Name Abbreviation R/W P4 Address Address...
Section 16 Watchdog Timer and Reset 16.3.1 Watchdog Timer Stop Time Register (WDTST) WDTST is a readable/writable 32-bit register that specifies the time until a watchdog timer overflows. The time until WDTCNT overflows becomes the minimum value when set H'001 to the bits 11 to 0, and the maximum value when set H'000 to the bits 11 to 0.
Section 16 Watchdog Timer and Reset 16.3.2 Watchdog Timer Control/Status Register (WDTCSR) WDTCSR is a readable/writable 32-bit register that comprises the timer mode-selecting bit and overflow flags. Use a longword access to write to the WDTCSR, with H'A5 in the bits 31 to 24. The reading value of bits 31 to 24 is always H'00.
Section 16 Watchdog Timer and Reset Initial Bit Name Value Description RSTS Reset Select Specifies the kind of reset to be performed when WDTCNT overflows in watchdog timer mode. This setting is ignored in interval timer mode. 0: Power-on reset 1: Manual reset WOVF Watchdog Timer Overflow Flag...
Section 16 Watchdog Timer and Reset 16.3.4 Watchdog Timer Counter (WDTCNT) WDTCNT is a 32-bit read-only register that comprises 12-bit watchdog timer counter and counts up on the WDTBCNT overflow signal. When WDTCNT overflows, a reset is generated in watchdog timer mode, or an interrupt is generated in interval timer mode. Writing to WDTCNT is invalid.
Section 16 Watchdog Timer and Reset 16.4 Operation 16.4.1 Reset request Power-on reset and manual reset are available. These sources are follows. Power-on reset • Input low level via PRESET pin. • The WDTCNT overflows when the WT/IT bit in the WTCSR is 1, and the RSTS bit is 0. •...
Section 16 Watchdog Timer and Reset Figure 16.2 shows a WDT counting up operation. WDT mode: Interval timer mode: Clear counter after WDTCNT Clear counter when overflowed value reset operation Setting value of WDTST Counting up with overflow signal of WDTBCNT H'0000 0000 Time WDTBCNT...
Section 16 Watchdog Timer and Reset And the time until WDTCNT overflows becomes the minimum value when H'001 is set to × WDTST. The minimum overflow time is approximately 5.243 ms (= 2^1 [bit] 5.243 [ms]). 16.4.5 Clearing WDT Counter Writing H'55 to WDTBST with longword access clears WDTBCNT and writing the overflow setting value to WDTST clears WDTCNT.
Section 16 Watchdog Timer and Reset XTAL (oscillator) CLKOUT output PRESET input TRST input STATUS[1:0] HH (reset) LL (normal) output XTAL (oscillator) Reset holding stabilization time synchronization time settling time Figure 16.3 STATUS Output during Power-on PRESET input during normal operation It is necessary to ensure the PLL synchronization settling time when the PRESET input during normal operation.
Section 16 Watchdog Timer and Reset PRESET input during Sleep Mode It is necessary to ensure the PLL oscillation time when power-on reset generates by the PRESET pin low revel input during sleep mode. XTAL (oscillator) CLKOUT output PRESET input STATUS[1:0] HL (sleep) HH (reset)
Section 16 Watchdog Timer and Reset Power-On Reset by Watchdog timer Overflowed in Normal Operation XTAL (oscillator) CLKOUT output WDT overflow signal STATUS[1:0] LL (normal) HH (reset) LL (normal) output WDT reset WDT reset setup time holding time Figure 16.6 STATUS Output by Watchdog timer overflow Power-On Reset during Normal Operation Power-On Reset by Watchdog timer Overflowed in Sleep Mode XTAL...
Section 16 Watchdog Timer and Reset 16.5.3 Manual Reset by Watchdog Timer Overflow The transition time from watchdog timer overflowed to manual reset state (watchdog timer reset setup time) is 1 clock cycle of the XTAL clock and thereafter equal to or more than 5 clock cycles of the peripheral clock (Pck).
Section 17 Power-Down Mode Section 17 Power-Down Mode In power-down modes, some of the on-chip peripheral modules and the CPU functions are halted, enabling power consumption to be reduced. 17.1 Features The SH7780 power-down mode has the following features. • Supports sleep mode and module standby mode •...
Section 17 Power-Down Mode 17.2 Input/Output Pins Table 17.2 shows the pin configuration of the Power-Down Modes. Table 17.2 Pin Configuration Pin name Function Description STATUS1 Processing state 1 Output Indicate the processor's operating status STATUS0 Processing state 2 STATUS1 STATUS0 Operating Status High...
Section 17 Power-Down Mode 17.3.1 Standby Control Register (MSTPCR) MSTPCR is a 32-bit readable/writable register that can individually start or stop the module assigned to each bit. MSTPCR can be accessed only in longwords. Bit: ...
Page 697
Section 17 Power-Down Mode Initial Bit Name Value Description 13 to 8 MSTP[13:8] All 0 Module Stop Bit [13:8] 0: Supplies the clock to the corresponding module 1: Stops the clock supply to the corresponding module [13]: MMCIF, [12]: FLCTL, [11]: RTC, [10]: TMU channels 0 to 2, [9]: TMU channels 3 to 5, [8]: CMT ...
Section 17 Power-Down Mode 17.4 Sleep Mode 17.4.1 Transition to Sleep mode A transition to the sleep mode is made by executing the SLEEP instruction in the program execution state. Although the CPU stops operating after execution of the SLEEP instruction, the contents of the CPU registers are held.
Section 17 Power-Down Mode 17.5 Module Standby State This LSI supports the module standby state, where the clock supplied to on-chip modules is stopped. 17.5.1 Transition to Module Standby Mode Setting a corresponding bit in the standby control register (MSTPCR) to 1 will stop the clock supply.
Section 17 Power-Down Mode 17.6 DDR-SDRAM Power Supply Backup 17.6.1 Self-Refresh and Initialization To preserve the contents of the DDR-SDRAM with battery backup, make sure that the DDR- SDRAM is in the self-refresh mode before turning off the system power supply. When the system power supply is turned on, whether initialization of the DDR-SDRAM and cancellation of the self- refresh mode is needed will depend on whether the DDR-SDRAM has been in self-refresh mode or has not been initialized.
Section 17 Power-Down Mode 17.6.2 DDR-SDRAM Backup Sequence when Turning Off System Power Supply The sequence when the system power supply is turned off is shown below. Figure 17.1 shows the sequence of a transition to the self-refresh mode to turn off the system power supply.
Section 17 Power-Down Mode Time Processing Command SDRAM State Performs auto-refresh at regular intervals High Confirm that traffic to DDRIF by on-chip peripheral modules is completed (REFA/NOP) Set SCR to issue PREALL and REFA commands Enters idle state after refreshing once PREALL REFA...
Section 17 Power-Down Mode 17.7 RTC Power Supply Backup 17.7.1 Transition to RTC Power Supply Backup To turn on the RTC battery backup with the system power supply turned off, assert the XRTCSTBI signal before the voltage of the VDD (1.25V) power supply starts to drop. This function can be used to reduce the VDD current.
Section 17 Power-Down Mode System power supply System power supply turned off turned on VDD-RTC RTC power supply backup canceled XRTCSTBI min 1 ms min 1 ms Power-on reset canceled PRESET (1) Power-on oscillation settling time (2) Internal reset delay time to the RTC Figure 17.3 Sequence for Turning System Power Supply On/Off Rev.1.00 Dec.
Section 17 Power-Down Mode 17.9 STATUS Pin Change Timing 17.9.1 In Reset Refer to section 16.5, Status Pin Change Timing during Reset. 17.9.2 In Sleep Figure 17.5 shows the state of output pins in sleep mode. Interrupt request CLKOUT IRQOUT STATUS[1:0] LL (Normal) HL (Sleep)
Section 18 Timer Unit (TMU) Section 18 Timer Unit (TMU) This LSI includes an on-chip 32-bit timer unit (TMU), which has six channels (channels 0 to 5). 18.1 Features The TMU has the following features. • Auto-reload type 32-bit down-counter provided for each channel •...
Section 18 Timer Unit (TMU) 18.2 Input/Output Pins Table 18.1 shows the TMU pin configuration. Table 18.1 Pin Configuration Pin Name Function Description TCLK* Clock input/output Channel 0, 1 and 2 external clock input pin/channel 2 input capture control input pin/RTC output pin (shared with RTC) Note: This pin is multiplexed with the LBSC and GPIO pins.
Section 18 Timer Unit (TMU) 18.3.1 Timer Output Control Register (TOCR) TOCR is an 8-bit readable/writable register that specifies whether external pin TCLK is used as the external clock or input capture control input pin, or as the on-chip RTC output clock output pin.
Section 18 Timer Unit (TMU) 18.3.2 Timer Start Register (TSTR0, TSTR1) TSTR is an 8-bit readable/writable register that specifies whether TCNT in each channel is operated or stopped. • TSTR0 BIt: — — — — — STR2 STR1 STR0 Initial value: R/W: Initial Bit Name...
Page 714
Section 18 Timer Unit (TMU) • TSTR1 BIt: — — — — — STR5 STR4 STR3 Initial value: R/W: Initial Bit Name Value Description 7 to 3 — All 0 Reserved These bits are always read as 0. The write value should always be 0.
Section 18 Timer Unit (TMU) 18.3.3 Timer Constant Register (TCORn) (n = 0 to 5) The TCOR registers are 32-bit readable/writable registers. When a TCNT counter underflows while counting down, the TCOR value is set in that TCNT, which continues counting down from the set value.
Section 18 Timer Unit (TMU) 18.3.5 Timer Control Registers (TCRn) (n = 0 to 5) The TCR registers are 16-bit readable/writable registers. Each TCR selects the count clock, specifies the edge when an external clock is selected, and controls interrupt generation when the flag indicating TCNT underflow is set to 1.
Page 717
Section 18 Timer Unit (TMU) Initial Bit Name Value Description ICPE1* Input Capture Control ICPE0* These bits, provided in channel 2 only, specify whether the input capture function is used, and control enabling or disabling of interrupt generation when the function is used.
Section 18 Timer Unit (TMU) Initial Bit Name Value Description TPSC2 Timer Prescaler 2 to 0 TPSC1 These bits select the TCNT count clock. TPSC0 000: Counts on Pck/4 001: Counts on Pck/16 010: Counts on Pck/64 011: Counts on Pck/256 100: Counts on Pck/1024 101: Setting prohibited 110: Counts on on-chip RTC output clock...
Section 18 Timer Unit (TMU) 18.4 Operation Each channel has a 32-bit timer counter (TCNT) and a 32-bit timer constant register (TCOR). Each TCNT performs count-down operation. The channels have an auto-reload function that allows cyclic count operations, and can also perform external event counting. Channel 2 also has an input capture function.
Section 18 Timer Unit (TMU) Select operation Select the count clock with the TPSC2 to TPSC0 bits Select count clock in TCR. When the external clock (TCLK) is selected, specify the external clock edge with the CKEG1 and CKEG0 bits in TCR. Underflow interrupt Specify whether an interrupt is to be generated on generation setting...
Section 18 Timer Unit (TMU) Auto-Reload Count Operation Figure 18.3 shows the TCNT auto-reload operation. TCNT value TCOR value set in TCNT on underflow TCOR H'0000 0000 Time STR0 to STR5 Figure 18.3 TCNT Auto-Reload Operation TCNT Count Timing • Operating on internal clock Any of five count clocks (Pck/4, Pck/16, Pck/64, Pck/256, or Pck/1024) scaled from the peripheral clock can be selected as the count clock by means of the TPSC2 to TPSC0 bits in TCR.
Section 18 Timer Unit (TMU) • Operating on external clock In channels 0, 1, and 2, the external clock pin (TCLK) input can be selected as the timer clock by means of the TPSC2 to TPSC0 bits in TCR. The detected edge (rising, falling, or both edges) can be selected with the CKEG1 and CKEG0 bits in TCR.
Section 18 Timer Unit (TMU) 18.4.2 Input Capture Function Channel 2 has an input capture function. The procedure for using the input capture function is as follows: 1. Use bits TPSC2 to TPSC0 in TCR to set an internal clock as the timer operating clock. 2.
Section 18 Timer Unit (TMU) 18.5 Interrupts There are seven TMU interrupt sources: underflow interrupts and the input capture interrupt when the input capture function is used. Underflow interrupts are generated on each of the channels, and input capture interrupts on channel 2 only. An underflow interrupt request is generated (for each channel) when both the UNF bit and the interrupt enable bit (UNIE) for that channel are set to 1.
Section 18 Timer Unit (TMU) 18.6 Usage Notes 18.6.1 Register Writes When writing to a TMU register, timer count operation must be stopped by clearing the start bit (STR5 to STR0) for the relevant channel in TSTR. Note that TSTR can be written to, and the UNF and ICPF bits in TCR can be cleared while the count is in progress.
Page 726
Section 18 Timer Unit (TMU) Rev.1.00 Dec. 13, 2005 Page 676 of 1286 REJ09B0158-0100...
Section 19 Compare Match Timer (CMT) Section 19 Compare Match Timer (CMT) This LSI includes the 32-bit compare match timer, which has four channels (channel 0 to 3). There are two mode of operation: one is four channels 32-bit free running timer mode that has common 32-bit free running time base and the other is four channels 16-bit timer/counter mode that operates as four channels timer or counter individually.
Section 19 Compare Match Timer (CMT) Table 19.3 Register States of CMT in Each Processing Mode Power-on Manual Reset by Reset by PRESET WDT/ Sleep Pin/WDT/ Multiple by SLEEP Module Register Name Abbreviation H-UDI Exception Instruction Standby Common Configuration register CMTCFG H'0000 0000 H'0000 0000...
Section 19 Compare Match Timer (CMT) 19.3.1 Configuration Register (CMTCFG) CMTCFG is a 32-bit readable/writable register. The possible operations for a pin are timer compare, timer input capture, up or down count, and capture input, where one pin is used for capture while the second is used to enable the count.
Page 732
Section 19 Compare Match Timer (CMT) Initial Bit Name Value Description 11, 10 All 0 Channel 1 Pin Active Control [Input capture mode] 00: Setting prohibited* 01: Edge detection on rising edge of CMT_CTR1 pin input 10: Edge detection on falling edge of CMT_CTR1 pin input 11: Edge detection on either edge of CMT_CTR1 pin input...
Page 733
Section 19 Compare Match Timer (CMT) Initial Bit Name Value Description 7, 6 — All 0 Reserved These bits are always read as 0. The write value should always be 0. FRTM Free-Running Timer Mode Determines whether the timer works as a common 32- bit free-running timer or four independent 16-bit timers/counters.
Section 19 Compare Match Timer (CMT) 19.3.2 Free-Running Timer (CMTFRT) CMTFRT is a 32-bit read only register that is the common time base of the capture/compare register (channel 0, 1) and compare register (channel 2, 3) in 32-bit free-running timer (FRT) mode.
Page 735
Section 19 Compare Match Timer (CMT) Initial Bit Name Value Description Channel 3 to 0 timer enable Enables the counting of each of the 16-bit counters. If these bits are inactive when operating in timer mode or in counter mode, the counters are reset to 0. In updown-counter mode, channel 1 needs to be disabled (TE1 = 0).
Page 736
Section 19 Compare Match Timer (CMT) Initial Bit Name Value Description 15, 14 All 0 Timer Clock Control Channel 3 These bits specify the clock input for the 16-bit timer in channel 3.* 00: Clock for timer 3 is 1/32 of peripheral clock (Pck) 01: Clock for timer 3 is 1/128 of peripheral clock (Pck) 10: Clock for timer 3 is 1/512 of peripheral clock (Pck) 11: Clock for timer 3 is 1/1024 of peripheral clock (Pck)
Page 737
Section 19 Compare Match Timer (CMT) Initial Bit Name Value Description 9, 8 All 0 Free-Running Timer Clock Control This clock is used for the 32-bit free-running timer (FRT) and also for the 16-bit timer/counter in channel 0.* 00: Clock for FRT and timer 0 is 1/32 of peripheral clock (Pck) 01: Clock for FRT and timer 0 is 1/128 of peripheral clock (Pck)
Section 19 Compare Match Timer (CMT) 19.3.4 Interrupt Status Register (CMTIRQS) CMTIRQS, once set, can only be cleared by a write. Writing 0 to these bits clears the interrupt status bits. These conditions only create an interrupt if the relevant interrupt enable bit is set. Bit: —...
Section 19 Compare Match Timer (CMT) 19.3.5 Channels 0 to 3 Time Registers (CMTCH0T to CMTCH3T) In output compare mode, these registers specify the value to be compared with the free-running timer. In input capture mode, this register stores the free-running timer values or the 16-bit timer values on the active edge of the input.
Section 19 Compare Match Timer (CMT) 19.3.7 Channels 0 to 3 Counters (CMTCH0C to CMTCH3C) Each channel register indicates the current value of the timer/counter. Writing to this register, it can be set the timer counter. When reading this register, the timer/counter value is not affected. Bit: —...
Section 19 Compare Match Timer (CMT) 19.4 Operation The CMT has two operation modes: one is four channels free-running timer that operates with the common time base of 32-bit free-running timer operating between approximately 1.5MHz (Pck/32 selected at Pck = 50MHz) to 30kHz (Pck/1024 selected at Pck = 33MHz). The other is 16-bit timer/counter that operating as two channels 16-bit timer/counter and two channels 16-bit timer.
Section 19 Compare Match Timer (CMT) 19.4.2 32-Bit Timer: Input Capture When rising edge or falling edge is detected while the timer CMTFRT is operating, the value of CMTFRT is captured in the corresponding CMTCHnT (n = 1, 0). Then the IEn flag in CMTIRQS is set to 1 and the interrupt is generated when the IEEn bit in CMTCTL is set to 1.
Section 19 Compare Match Timer (CMT) Table 19.4 32-bit Timer Mode: Example of Input Capture Setting Register Settings CMTCFG 31 t o 12 All 0 11 to 8 Arbitrary value (pin setting of each channel) 7, 6 All 0 1 (32-bit free-running timer) 4 to 0 All 0 CMTCTL...
Section 19 Compare Match Timer (CMT) CMTFRT value H'FFFF FFFF CMTCHnST + H'8000 0000 CMTCHnST CMTCHnT H'0000 0000 Time Start count-up FRTM bit CMT_CTRn output ICn flag STCn bit Output remains active until the Output remains active for half channel n stop time value the total time of the FRT is reached Figure 19.5 CMT_CTRn Assert Timing (channel 0 and 1)
Section 19 Compare Match Timer (CMT) operation clock N + 1 N + 2 CMTFRT CMT_CTRn output CMTCHnT N + 1 CMTCHnST ICn flag Figure 19.7 32-bit Timer Mode: Output Compare Operation Timing (Example of High output in Active and Not Active by CMTCHnST) operation clock N + H'8000 0000 N + H'8000 0001...
Section 19 Compare Match Timer (CMT) Table 19.5 32-bit Timer Mode: Example of Output Compare Setting Register Settings CMTCFG 31 t o 12 All 0 11 to 8 Arbitrary value (pin setting of each channel) 7, 6 All 0 1 (32-bit free-running timer) 4 to 0 All 0 CMTCTL...
Section 19 Compare Match Timer (CMT) 19.4.4 16-Bit Timer: Input Capture When rising edge or falling edge is detected while the timer CMTCH0C is operating, the value of CMTCHnC (n = 0, 1) is captured in the corresponding CMTCHnT (n = 1, 0). Then the IEn flag in CMTIRQS is set to 1 and the interrupt is generated when the IEEn bit in CMTCTL is set to 1.
Section 19 Compare Match Timer (CMT) 19.4.5 16-Bit Timer: Output Compare When the value of CMTCHnC (n = 1, 0) matches the lower 16-bit of CMTCHnT while the timer CMTCH0C is operating, the output is inverted. Then the ICn flag in CMTIRQS is set to 1 and the interrupt is generated when the ICEn bit in CMTCTL is set to 1.
Section 19 Compare Match Timer (CMT) 19.4.6 Counter: Up-counter When rising edge or falling edge of the CMT_CTR input signal is detected at the rising edge of each channel operation clock, the channel counter CMTCHnC value is captured in the corresponding CMTCHnT (n = 1, 0) and that counter is counted up.
Section 19 Compare Match Timer (CMT) Table 19.8 Setting Example of Up-counter Mode Register Settings CMTCFG 31 t o 12 All 0 11 to 8 Arbitrary value (pin setting of each channel) 7, 6 All 0 0 (16-bit timer/counter) 4 to 2 All 0 1, 0 10 (Up-counter mode setting of all channels)
Section 19 Compare Match Timer (CMT) 19.4.7 Counter: Updown-counter Channel 0 can be used as an updown-counter. However, the CMT_CRT1 pin is to connect to the channel 0, the channel 1 timer/counter needs to be disabled. When rising edge or falling edge of the CMT_CTR input signal is detected at the rising edge of the channel 0 operation clock, the channel counter CMTCH0C is counted up or down.
Section 19 Compare Match Timer (CMT) Table 19.9 Setting Example of Updown-counter Mode Register Settings CMTCFG 31 t o 12 All 0 11 to 8 Arbitrary value (pin setting of each channel) 7, 6 All 0 0 (16-bit timer/counter) 4 to 2 All 0 1, 0 11 (Updown-counter mode setting of channel 0)
Section 19 Compare Match Timer (CMT) 19.4.8 Counter: Rotary Switch Operation of Updown-counter The Updown-counter can operate as a rotary switch. When the falling edge of the control pin is detected and then the data pin input level is low, the counter is counted up, or the data pin input level is high, the counter is counted down.
Section 19 Compare Match Timer (CMT) Table 19.10 Setting Example of Updown-counter Mode Register Settings CMTCFG 31 t o 17 All 0 All 1 (rotary switch operation setting of channel 0) 15 to 6 All 0 0 (16-bit timer/counter) 4 to 2 All 0 1, 0 11 (Updown-counter mode setting of channel 0)
Section 20 Realtime Clock (RTC) Section 20 Realtime Clock (RTC) The SH7780 includes an on-chip realtime clock (RTC) and a 32.768 kHz crystal oscillator for use by the RTC. 20.1 Features The RTC has the following features. • Clock and calendar functions (BCD display) Counts seconds, minutes, hours, day-of-week, days, months, and years.
Section 20 Realtime Clock (RTC) 20.3.1 64 Hz Counter (R64CNT) R64CNT is an 8-bit read-only register that indicates a state of 64 Hz to 1 Hz within the RTC frequency divider. If this register is read when a carry is generated from the 128 Hz frequency division stage, bit 7 (CF) in RTC control register 1 (RCR1) is set to 1, indicating the simultaneous occurrence of the carry and the 64 Hz counter read.
Section 20 Realtime Clock (RTC) 20.3.3 Minute Counter (RMINCNT) RMINCNT is an 8-bit readable/writable register used as a counter for setting and counting the BCD-coded minute value in the RTC. It counts on the carry generated once per minute by the second counter.
Section 20 Realtime Clock (RTC) 20.3.5 Day-of-Week Counter (RWKCNT) RWKCNT is an 8-bit readable/writable register used as a counter for setting and counting the BCD-coded day-of-week value in the RTC. It counts on the carry generated once per day by the hour counter.
Section 20 Realtime Clock (RTC) 20.3.6 Day Counter (RDAYCNT) RDAYCNT is an 8-bit readable/writable register used as a counter for setting and counting the BCD-coded day value in the RTC. It counts on the carry generated once per day by the hour counter.
Section 20 Realtime Clock (RTC) 20.3.7 Month Counter (RMONCNT) RMONCNT is an 8-bit readable/writable register used as a counter for setting and counting the BCD-coded month value in the RTC. It counts on the carry generated once per month by the day counter.
Section 20 Realtime Clock (RTC) 20.3.9 Second Alarm Register (RSECAR) RSECAR is an 8-bit readable/writable register used as an alarm register for the RTC's BCD-coded second value counter, RSECCNT. When the ENB bit is set to 1, the RSECAR value is compared with the RSECCNT value.
Section 20 Realtime Clock (RTC) 20.3.11 Hour Alarm Register (RHRAR) RHRAR is an 8-bit readable/writable register used as an alarm register for the RTC's BCD-coded hour value counter, RHRCNT. When the ENB bit is set to 1, the RHRAR value is compared with the RHRCNT value.
Section 20 Realtime Clock (RTC) Bits 6 to 3 are always read as 0. A write to these bits is invalid, but the write value should always be 0. BIt: — — — — Day-of-week code Initial value: — — —...
Section 20 Realtime Clock (RTC) 20.3.14 Month Alarm Register (RMONAR) RMONAR is an 8-bit readable/writable register used as an alarm register for the RTC's BCD- coded month value counter, RMONCNT. When the ENB bit is set to 1, the RMONAR value is compared with the RMONCNT value.
Section 20 Realtime Clock (RTC) 20.3.16 RTC Control Register 1 (RCR1) RCR1 is an 8-bit readable/writable register containing a carry flag and alarm flag, plus flags to enable or disable interrupts for these flags. The CIE and AIE bits are initialized to 0 by a power-on or manual reset; the value of bits other than CIE and AIE is undefined.
Page 772
Section 20 Realtime Clock (RTC) Initial Bit Name Value Description Carry Interrupt Enable Flag Enables or disables interrupt generation when the carry flag (CF) is set to 1. 0: Carry interrupt is not generated when CF flag is set to 1 1: Carry interrupt is generated when CF flag is set to 1 Alarm Interrupt Enable Flag Enables or disables interrupt generation when the...
Section 20 Realtime Clock (RTC) Initial Bit Name Value Description Undefined R/W Alarm Flag Set to 1 when the alarm time set in those registers among RSECAR, RMINAR, RHRAR, RWKAR, RDAYAR, and RMONAR in which the ENB bit is set to 1 matches the respective counter values 0: Alarm registers and counter values do not match (Initial value)
Page 774
Section 20 Realtime Clock (RTC) Initial Bit Name Value Description Undefined R/W Periodic Interrupt Flag Indicates interrupt generation at the interval specified by bits PES2–PES0. When this flag is set to 1, a periodic interrupt is generated. 0: Interrupt is not generated at interval specified by bits PES2–PES0 [Clearing condition] When 0 is written to PEF...
Page 775
Section 20 Realtime Clock (RTC) Initial Bit Name Value Description 30-Second Adjustment Used for 30-second adjustment. When 1 is written to this bit, a value up to 29 seconds is rounded down to 00 seconds, and a value of 30 seconds or more is rounded up to 1 minute.
Section 20 Realtime Clock (RTC) 20.3.18 RTC Control Register (RCR3) RCR3 is readable/writable register that specifies enable or disable the alarm function of RYRCNT that is the RTC's BCD-coded year-value counter. When the YENB bit of RCR3 is set to 1, the RYRCNT value is compared with the RYRAR value.
Section 20 Realtime Clock (RTC) 20.4 Operation Examples of the use of the RTC are shown below. 20.4.1 Time Setting Procedures Figure 20.2 shows examples of the time setting procedures. Set RCR2.RESET to 1. Stop clock Clear RCR2.START to 0. Reset frequency divider Set second/minute/hour/day/ In any order.
Section 20 Realtime Clock (RTC) 20.4.2 Time Reading Procedures Figure 20.3 shows examples of the time reading procedures. Clear RCR1.CIE to 0. Disable carry interrupts Clear RCR1.CF to 0 Clear carry flag (Write 1 to RCR1.AF so that alarm flag is not cleared).
Section 20 Realtime Clock (RTC) If a carry occurs or being the carry ready period (RCR1.CRF = 1) while the time is being read, the correct time will not be obtained and the read must be repeated. The procedure for reading the time without using interrupts is shown in figure 20.3 (a), and the procedure using carry interrupts in figure 20.3 (b).
Section 20 Realtime Clock (RTC) 20.5 Interrupts There are three kinds of RTC interrupt: alarm interrupts, periodic interrupts, and carry interrupts. An alarm interrupt request (ATI) is generated when the alarm flag (AF) in RCR1 is set to 1 while the alarm interrupt enable bit (AIE) is also set to 1.
Section 20 Realtime Clock (RTC) SH7780 EXTAL2 XTAL2 VDD-RTC VSS-RTC XTAL Noise filter 3.3 V Notes: 1. Select either the C or C side for the frequency adjustment variable capacitor according to requirements such as the adjustment range, degree of stability, etc. 2.
Section 20 Realtime Clock (RTC) 20.6.3 Interrupt source and request generating order If it occurs complex interrupt source of alarm interrupts (ATI), periodic interrupts (PFI), and carry interrupts (CUI) at the same time, the RTC generates interrupt request as shown in figure 20.6. (50MHz) carry, periodical, and alarm interrupt EXTAL2...
Section 21 Serial Communication Interface with FIFO (SCIF) Section 21 Serial Communication Interface with FIFO (SCIF) This LSI is equipped with a 2-channel serial communication interface with built-in FIFO buffers (Serial Communication Interface with FIFO: SCIF). The SCIF can perform both asynchronous and clocked synchronous serial communications.
Page 784
Section 21 Serial Communication Interface with FIFO (SCIF) • Full-duplex communication capability The transmitter and receiver are independent units, enabling transmission and reception to be performed simultaneously. The transmitter and receiver both have a 64-stage FIFO buffer structure, enabling continuous serial data transmission and reception.
Section 21 Serial Communication Interface with FIFO (SCIF) Figures 21.2 to 21.6 show block diagrams of the I/O ports in SCIF. Reset RTSIO Peripheral bus SPTRW Reset SCIF0_RTS RTSDT Modem control SPTRW enable signal* SCIF_RTS signal SPTRR SPTRW: Write to SCSPTR SPTRR: Read from SCSPTR Note: * The SCIF0_RTS pin function is designated as modem control by the MCE bit in SCFCR.
Section 21 Serial Communication Interface with FIFO (SCIF) Reset SCKIO Peripheral bus SPTRW Reset SCIFn_CLK SCKDT SPTRW Clock output enable signal * Serial clock output signal * Serial clock input signal * Serial input enable signal * SPTRR SPTRW: Write to SCSPTR SPTRR: Read from SCSPTR Note: * The SCIFn_CLK pin function is designated as internal clock output or external clock input by the C/A bit in SCSMR and the CKE1 and CKE0 bits in SCSCR.
Section 21 Serial Communication Interface with FIFO (SCIF) SCIFn_RXD Serial receive data Peripheral bus SPTRR SPTRR: Read from SCSPTR Figure 21.6 SCIFn_RXD Pin (n = 0, 1) Rev.1.00 Dec. 13, 2005 Page 738 of 1286 REJ09B0158-0100...
Section 21 Serial Communication Interface with FIFO (SCIF) 21.2 Input/Output Pins Table 21.1 shows the SCIF pin configuration. Table 21.1 Pin Configuration Pin Name Function Description SCIF0_SCK Channel 0 serial clock pin Clock input/output SCIF0_RXD Channel 0 receive data pin Input Receive data input SCIF0_TXD...
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3 Register Descriptions Table 21.2 shows the register configuration. Table 21.3 shows the register states in each processing mode. Table 21.2 Register Configuration Sync Register Name Abbrev. P4 Address Area 7 Address Size Clock Serial mode register 0...
Section 21 Serial Communication Interface with FIFO (SCIF) Table 21.3 Register States of SCIF in Each Processing Mode Power-on Reset Manual Reset by Sleep by by PRESET Pin/ WDT/Multiple SLEEP Module Register Name Abbrev. WDT/H-UDI Exception Instruction Standby Serial mode register 0 SCSMR0 H'0000 H'0000...
Section 21 Serial Communication Interface with FIFO (SCIF) Since the register functions, pin functions, and interrupt requests are the same in each channel except for the modem control, the channel number n (n = 0, 1) is omitted in the description below. 21.3.1 Receive Shift Register (SCRSR) SCRSR is the register used to receive serial data.
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3.3 Transmit Shift Register (SCTSR) SCTSR is the register used to transmit serial data. To perform serial data transmission, the SCIF first transfers transmit data from SCFTDR to SCTSR, then sends the data to the SCIF_TXD pin starting with the LSB (bit 0). When transmission of one byte is completed, the next transmit data is transferred from SCFTDR to SCTSR, and transmission started, automatically.
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3.5 Serial Mode Register (SCSMR) SCSMR is a 16-bit register used to set the SCIF's serial transfer format and select the baud rate generator clock source. SCSMR can always be read from and written to by the CPU. Bit: ...
Page 795
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description Parity Enable In asynchronous mode, selects whether or not parity bit addition is performed in transmission, and parity bit checking is performed in reception. In clocked synchronous mode, parity bit addition and checking is disabled regardless of the PE bit setting.
Page 796
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description STOP Stop Bit Length In asynchronous mode, selects 1 or 2 bits as the stop bit length. The stop bit setting is valid only in asynchronous mode. Since the stop bit is not added in clocked synchronous mode, the STOP bit setting is invalid.
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3.6 Serial Control Register (SCSCR) SCSCR is a register used to enable/disable transmission/reception by SCIF, serial clock output, interrupt requests, and to select transmission/reception clock source for the SCIF. SCSCR can always be read from and written to by the CPU. Bit: ...
Page 798
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description Receive Interrupt Enable Enables or disables generation of a receive-data-full interrupt (RXI) request when the RDF flag or DR flag in SCFSR is set to 1, a receive-error interrupt (ERI) request when the ER flag in SCFSR is set to 1, and a break interrupt (BRI) request when the BRK flag in SCFSR or the ORER flag in SCLSR is set to 1.
Page 799
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description Receive Enable Enables or disables the start of serial reception by the SCIF. Serial reception is started when a start bit is detected in this state in asynchronous mode or a synchronization clock is input while the RE bit is set to 1.
Page 800
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description CKE1 Clock Enable 1, 0 CKE0 These bits select the SCIF clock source and whether to enable or disable the clock output from the SCIF_SCK pin. The CKE1 and CKE0 bits are used together to specify whether the SCIF_SCK pin functions as a serial clock output pin or a serial clock input pin.
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3.7 Serial Status Register n (SCFSR) SCFSR is a 16-bit register that consists of status flags that indicate the operating status of the SCIF. SCFSR can be read from or written to by the CPU at all times. However, 1 cannot be written to flags ER, TEND, TDFE, BRK, RDF, and DR.
Page 802
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description R/W* Receive Error Indicates that a framing error or parity error occurred during reception. The ER flag is not affected and retains its previous state when the RE bit in SCSCR is cleared to 0.
Page 803
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description TDFE R/W* Transmit FIFO Data Empty Indicates that data has been transferred from SCFTDR to SCTSR, the number of data bytes in SCFTDR has fallen to or below the transmit trigger data number set by bits TTRG1 and TTRG0 in SCFCR, and new transmit data can be written to SCFTDR.
Page 804
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description R/W* Break Detect Indicates that a receive data break signal has been detected. 0: A break signal has not been received [Clearing conditions] • Power-on reset or manual reset •...
Page 805
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description Parity Error In asynchronous mode, indicates whether or not a parity error has been found in the data that is to be read next from SCFRDR. 0: There is no parity error that is to be read from SCFRDR [Clearing conditions] •...
Page 806
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description R/W* Receive FIFO Data Full Indicates that the received data has been transferred from SCRSR to SCFRDR, and the number of receive data bytes in SCFRDR is equal to or greater than the receive trigger number set by bits RTRG1 and RTRG0 in SCFCR.
Page 807
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description R/W* Receive Data Ready In asynchronous mode, indicates that there are fewer than the receive trigger set number of data bytes in SCFRDR, and no further data has arrived for at least 15 etu after the stop bit of the last data received.
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3.8 Bit Rate Register n (SCBRR) SCBRR is an 8-bit register that set the serial transmission/reception bit rate in accordance with the baud rate generator operating clock selected by bits CKS1 and CKS0 in SCSMR. SCBRR can always be read from and written to by the CPU.
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3.9 FIFO Control Register n (SCFCR) SCFCR performs data count resetting and trigger data number setting for transmit and receive FIFO registers, and also contains a loopback test enable bit. SCFCR can always be read from and written to by the CPU. Bit: ...
Page 810
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description RTRG1 Receive FIFO Data Number Trigger RTRG0 These bits are used to set the number of receive data bytes that sets the RDF flag in SCFSR. The RDF flag is set when the number of receive data bytes in SCFRDR is equal to or greater than the trigger set number shown below.
Page 811
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description TFCL Transmit FIFO Data Count Register Clear Clears the transmit FIFO data count register to 0. 0: Clear operation disabled 1: Clear operation enabled Note: A reset operation is performed in the event of a power-on reset or manual reset.
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3.10 Transmit FIFO Data Count Register n (SCTFDR) SCTFDR is a 16-bit register that indicates the number of transmit data bytes stored in SCFTDR. SCTFDR can always be read from the CPU. Bit: ...
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3.11 Receive FIFO Data Count Register n (SCRFDR) SCRFDR is a 16-bit register that indicates the number of receive data bytes stored in SCFRDR. SCRFDR can always be read from the CPU. Bit: ...
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3.12 Serial Port Register n (SCSPTR) SCSPTR is a 16-bit readable/writable register that controls input/output and data for the port pins multiplexed with the serial communication interface (SCIF) pins at all times. Input data can be read from the SCIF_RXD pin, output data written to the SCIF_TXD pin, and breaks in serial transmission/reception controlled, by means of bits 1 and 0.
Page 815
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description Serial Port SCIF0_RTS Port Data RTSDT* — Specifies the serial port SCIF0_RTS pin input/output data. Input or output is specified by the RTSIO bit. In output mode, the RTSDT bit value is output to the SCIF0_RTS pin.
Page 816
Section 21 Serial Communication Interface with FIFO (SCIF) Initial Bit Name Value Description SCKDT — Serial Port Clock Port Data Specifies the serial port SCIF_SCK pin input/output data. Input or output is specified by the SCKIO bit. In output mode, the SCKDT bit value is output to the SCIF_SCK pin.
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3.13 Line Status Register n (SCLSR) Bit: ORER Initial value: R/W: R/W* Note: * Only 0 can be written, to clear the flag. Initial Bit Name Value...
Section 21 Serial Communication Interface with FIFO (SCIF) 21.3.14 Serial Error Register n (SCRER) SCRER is a 16-bit register that indicates the number of receive errors in the data in SCFRDR. SCRER can always be read from the CPU. Bit: ...
Section 21 Serial Communication Interface with FIFO (SCIF) 21.4 Operation 21.4.1 Overview The SCIF can carry out serial communication in asynchronous mode, in which synchronization is achieved character by character and in synchronous mode, in which synchronization is achieved with clock pulses. For details on asynchronous mode, see section 21.4.2, Operation in Asynchronous Mode.
Section 21 Serial Communication Interface with FIFO (SCIF) Clocked Synchronous Mode: • Data length: Fixed at 8 bits • LSB first for data transmission/reception • Detection of overrun errors during reception • Choice of internal or external clock input from SCIF_SCK pin as SCIF clock source When internal clock (peripheral clock: Pck) is selected: The SCIF operates on the baud rate generator clock and a serial clock is output to external devices.
Section 21 Serial Communication Interface with FIFO (SCIF) Table 21.6 SCSMR and SCSCR Settings for SCIF Clock Source Selection SCSMR SCSCR Settings Bit 7: Bit 1: Bit 0: Clock CKE1 CKE0 Mode Source SCK Pin Function Asynchronous Internal SCIF does not use SCIF_SCK pin mode Outputs clock with frequency of 16 times the bit rate...
Section 21 Serial Communication Interface with FIFO (SCIF) 21.4.2 Operation in Asynchronous Mode In asynchronous mode, a character that consists of data with a start bit indicating the start of communication and a stop bit indicating the end of communication is transmitted or received. In this mode, serial communication is performed with synchronization achieved character by character.
Section 21 Serial Communication Interface with FIFO (SCIF) Data Transfer Format Table 21.7 shows the data transfer formats that can be used. Any of 8 transfer formats can be selected according to the SCSMR settings. Table 21.7 Serial Transfer Formats (Asynchronous Mode) SCSMR Settings Serial Transfer Format and Frame Length CHR PE...
Page 824
Section 21 Serial Communication Interface with FIFO (SCIF) Clock Either an internal clock generated by the on-chip baud rate generator or an external clock input at the SCIF_SCK pin can be selected as the SCIF's serial clock, according to the settings of the C/A bit in SCSMR and the CKE1 and CKE0 bits in SCSCR.
Section 21 Serial Communication Interface with FIFO (SCIF) Figure 21.8 shows a sample SCIF initialization flowchart. Start of initialization Set the clock selection in SCSCR. Be sure to clear bits TIE, RIE, TE, and RE to 0. Clear TE and RE bits in SCSCR to 0 Set the data transfer format in SCSMR.
Section 21 Serial Communication Interface with FIFO (SCIF) Serial Data Transmission (Asynchronous Mode): Figure 21.9 shows a sample flowchart for serial transmission. Use the following procedure for serial data transmission after enabling the SCIF for transmission. Start of transmission [1] SCIF status check and transmit data write: write: Read TDFE flag in SCFSR...
Page 827
Section 21 Serial Communication Interface with FIFO (SCIF) In serial transmission, the SCIF operates as described below. 1. When data is written into SCFTDR, the SCIF transfers the data from SCFTDR to SCTSR and starts transmitting. Confirm that the TDFE flag in SCFSR is set to 1 before writing transmit data to SCFTDR.
Section 21 Serial Communication Interface with FIFO (SCIF) Figure 21.10 shows an example of the operation for transmission in asynchronous mode. Start Data Parity Stop Start Data Parity Stop Serial Idle state data (mark state) TDFE TEND TXI interrupt TXI interrupt request request Data written to SCFTDR...
Section 21 Serial Communication Interface with FIFO (SCIF) Serial Data Reception (Asynchronous Mode) Figure 21.12 shows a sample flowchart for serial reception. Use the following procedure for serial data reception after enabling the SCIF for reception. [1] Receive error handling and Start of reception break detection: Read the DR, ER, and BRK...
Section 21 Serial Communication Interface with FIFO (SCIF) [1] Whether a framing error or parity error Error handling has occurred in the receive data that is to be read from SCFRDR can be ascertained from the FER and PER ORER = 1? bits in SCFSR.
Page 831
Section 21 Serial Communication Interface with FIFO (SCIF) In serial reception, the SCIF operates as described below. 1. The SCIF monitors the transmission line, and if a 0-start bit is detected, performs internal synchronization and starts reception. 2. The received data is stored in SCRSR in LSB-to-MSB order. 3.
Section 21 Serial Communication Interface with FIFO (SCIF) Start Data Parity Stop Start Data Parity Stop Serial data Detect flaming error RXI interrupt Data read and RDF flag ERI interrupt request request read as 1 then cleared to generated by receive One frame 0 by RXI interrupt handler error...
Section 21 Serial Communication Interface with FIFO (SCIF) 21.4.3 Operation in Clocked Synchronous Mode Clocked synchronous mode, in which data is transmitted or received in synchronization with clock pulses, is suitable for fast serial communication. Since the transmitter and receiver are independent units in the SCIF, full-duplex communication can be achieved by sharing the clock.
Page 834
Section 21 Serial Communication Interface with FIFO (SCIF) Clock Either an internal clock generated by the on-chip baud rate generator or an external synchronization clock input at the SCIF_SCK pin can be selected as the SCIF's serial clock, according to the settings of the C/A bit in SCSMR and the CKE1 and CKE0 bits in SCSCR. For details of SCIF clock source selection, see table 17.5.
Section 21 Serial Communication Interface with FIFO (SCIF) Start of initialization Leave the TE and RE bits cleared to 0 until the initialization almost ends. Be sure to clear the TIE, Clear TE and RE bits RIE, TE, and RE bits to 0. in SCSCR to 0 Set the CKE1 and CKE0 bits.
Section 21 Serial Communication Interface with FIFO (SCIF) Serial Data Transmission (Clocked Synchronous Mode) Figure 21.17 shows a sample flowchart for serial transmission. Use the following procedure for serial data transmission after enabling the SCIF for transmission. Start of transmission [1] SCIF status check and transmit data write: Read SCFSR and check that the...
Section 21 Serial Communication Interface with FIFO (SCIF) 2. When data is transferred from SCFTDR to SCTSR and transmission is started, consecutive transmit operations are performed until there is no transmit data left in SCFTDR. When the number of transmit data bytes in SCFTDR falls to or below the transmit trigger number set in SCFCR, the TDFE flag is set.
Section 21 Serial Communication Interface with FIFO (SCIF) Serial Data Reception (Clocked Synchronous Mode) Figure 21.19 shows a sample flowchart for serial reception. Use the following procedure for serial data reception after enabling the SCIF for reception. When switching the operating mode from asynchronous mode to clocked synchronous mode without initializing the SCIF, make sure that the ORER, PER7 to PER0, and FER7 to FER0 flags are cleared to 0.
Section 21 Serial Communication Interface with FIFO (SCIF) Error handling ORER = 1? Overrun error handling Clear ORER flag in SCLSR to 0 Figure 21.19 Sample Serial Reception Flowchart (2) In serial reception, the SCIF operates as described below. 1. The SCIF is initialized internally in synchronization with the input or output of the synchronization clock.
Section 21 Serial Communication Interface with FIFO (SCIF) Synchronization clock Serial data Bit 7 Bit 0 Bit 7 Bit 0 Bit 1 Bit 6 Bit 7 ORER RXI interr u pt Data read from BRI interrupt request interrupt SCFRDR and RDF by overrun error flag cleared to 0 by request...
Section 21 Serial Communication Interface with FIFO (SCIF) Simultaneous Serial Data Transmission and Reception (Clocked Synchronous Mode) Figure 21.21 shows a sample flowchart for simultaneous serial data transmission and reception. Use the following procedure for simultaneous serial transmission and reception after enabling the SCIF for both transmission and reception.
Section 21 Serial Communication Interface with FIFO (SCIF) 21.5 SCIF Interrupt Sources and the DMAC The SCIF has four interrupt sources in each channel: transmit-FIFO-data-empty interrupt (TXI) request, receive-error interrupt (ERI) request, receive-FIFO-data-full interrupt (RXI) request, and break interrupt (BRI) request. Table 21.7 shows the interrupt sources and their order of priority.
Section 21 Serial Communication Interface with FIFO (SCIF) Table 21.8 SCIF Interrupt Sources Interrupt DMAC Priority on Source Activation Reset Release Description Interrupt initiated by receive error flag (ER) Not possible High Interrupt initiated by receive FIFO data full flag Possible (RDF) or receive data ready flag (DR)* Interrupt initiated by break flag (BRK) or overrun...
Section 21 Serial Communication Interface with FIFO (SCIF) 21.6 Usage Notes Note the following when using the SCIF. SCFTDR Writing and the TDFE Flag The TDFE flag in SCFSR is set when the number of transmit data bytes written in SCFTDR has fallen to or below the transmit trigger number set by bits TTRG1 and TTRG0 in SCFCR.
Section 21 Serial Communication Interface with FIFO (SCIF) Sending a Break Signal The input/output condition and level of the SCIF_TXD pin are determined by bits SPB2IO and SPB2DT in SCSPTR. This feature can be used to send a break signal. After the serial transmitter is initialized and until the TE bit is set to 1 (enabling transmission), the SCIF_TXD pin function is not selected and the value of the SPB2DT bit substitutes for the mark state.
Section 21 Serial Communication Interface with FIFO (SCIF) Thus, the reception margin in asynchronous mode is given by formula (1). | D - 0.5 | (1 + F) × 100 % ....(1) M= (0.5 - ) - (L - 0.5) F - M: Receive margin (%) N: Ratio of bit rate to clock (N = 16) D: Clock duty (D = 0 to 1.0)
Section 22 Serial I/O with FIFO (SIOF) Section 22 Serial I/O with FIFO (SIOF) This LSI includes a clock-synchronized serial I/O module with FIFO (SIOF). 22.1 Features • Serial transfer 16-stage 32-bit FIFOs (transmission and reception are independent of each other) Supports 8-bit data/16-bit data/16-bit stereo audio input/output MSB first for data transmission Supports a maximum of 48-kHz sampling rate...
Section 22 Serial I/O with FIFO (SIOF) Figure 22.1 shows a block diagram of the SIOF. SIOF interrupt transfer request request Peripheral bus (SIOFI) Bus interface Transmit Receive Control FIFO FIFO registers (32 bits ×16 (32 bits ×16 stages) stages) Receive control Transmit control data...
Section 22 Serial I/O with FIFO (SIOF) 22.2 Input/Output Pins The pin configuration in this module is shown in table 22.1. Table 22.1 Pin Configuration Pin Name Function Description SIOF_MCLK Master clock Input Master clock input pin SIOF_SCK Serial clock Serial clock pin (common to transmission/reception) SIOF_SYNC...
Section 22 Serial I/O with FIFO (SIOF) 22.3 Register Descriptions Table 22.2 shows the SIOF register configuration. Table 22.3 shows the register states in each processing mode. Table 22.2 Register Configuration of SIOF Access Sync Name Abbreviation R/W P4 Address Area7 Address Size Clock...
Section 22 Serial I/O with FIFO (SIOF) Table 22.3 Register States of SIOF in Each Processing Mode Power-on Reset by Manual PRESET Reset by Sleep by Pin/WDT/ WDT/Multiple SLEEP Module Name Abbreviation H-UDI Exceptions Instruction Standby Mode register SIMDR H'8000 H'8000 Retained Retained...
Section 22 Serial I/O with FIFO (SIOF) 22.3.1 Mode Register (SIMDR) SIMDR is a 16-bit readable/writable register that sets the SIOF operating mode. Bit: TRMD[1:0] FL[3:0] — — — — REDG TXDIZ RCIM Initial value: R/W: Initial Bit Name Value Description 15, 14 TRMD[1:0]...
Page 853
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description TXDIZ SIOF_TXD Pin Output when Transmission is Invalid* 0: High output (1 output) when invalid 1: High-impedance state when invalid Note: Invalid means when disabled, and when a slot that is not assigned as transmit data or control data is being transmitted.
Section 22 Serial I/O with FIFO (SIOF) Table 22.4 shows the operation in each transfer mode. Table 22.4 Operation in Each Transfer Mode Transfer Mode Master/Slave SIOF_SYNC Bit Delay Control Data Method* Slave mode 1 Slave Synchronous pulse SYNCDL bit Slot position Slave mode 2 Slave...
Page 855
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description 12 to 8 BRPS[4:0] 00000 Prescalar Setting Set the master clock division ratio according to the count value of the prescalar of the baud rate generator. The range of settings is from 00000 (× 1/1) to 11111 (×...
Section 22 Serial I/O with FIFO (SIOF) 22.3.3 Control Register (SICTR) SICTR is a 16-bit readable/writable register that sets the SIOF operating state. Bit: SCKE FSE — — — — — — — — — — TXRST RXRST Initial value: R/W: Initial Bit Name...
Page 857
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description Transmit Enable 0: Disables data transmission from the SIOF_TXD pin 1: Enables data transmission from the SIOF_TXD pin • This bit setting becomes valid at the start of the next frame (at the rising edge of the SIOF_SYNC signal).
Page 858
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description TXRST Transmit Reset 0: Does not reset transmit operation 1: Resets transmit operation • This bit setting becomes valid immediately. For details of transmit reset, refer to table 22.13. •...
Section 22 Serial I/O with FIFO (SIOF) 22.3.5 Receive Data Register (SIRDR) SIRDR is a 32-bit read-only register that reads receive data of the SIOF. SIRDR stores data in the receive FIFO. Bit: SIRDL[15:0] Initial value: — — — — —...
Section 22 Serial I/O with FIFO (SIOF) 22.3.6 Transmit Control Data Register (SITCR) SITCR is a 32-bit readable/writable register that specifies transmit control data of the SIOF. SITCR can be specified only when the FL bits in SIMDR are specified as B'1xxx (x: don't care). SITCR is initialized by the conditions specified in table 22.3, Register State of SIOF in Each Processing Mode, or by a transmit reset caused by the TXRST bit in SICTR.
Section 22 Serial I/O with FIFO (SIOF) 22.3.7 Receive Control Data Register (SIRCR) SIRCR is a 32-bit readable/writable register that stores receive control data of the SIOF. SIRCR can be specified only when the FL bits in SIMDR are specified as B'1xxx (x: don't care). Bit: SIRC0[15:0] Initial value:...
Section 22 Serial I/O with FIFO (SIOF) 22.3.8 Status Register (SISTR) SISTR is a 16-bit readable/writable register that shows the SIOF state. Each bit in this register becomes an SIOF interrupt source when the corresponding bit in SIIER is set to 1. Bit: —...
Page 864
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description TDREQ Transmit Data Transfer Request 0: Indicates that the size of empty space in the transmit FIFO does not exceed the size specified by the TFWM bit in SIFCTR. 1: Indicates that the size of empty space in the transmit FIFO exceeds the size specified by the TFWM bit in SIFCTR.
Page 865
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description RFFUL Receive FIFO Full 0: Receive FIFO not full 1: Receive FIFO full • This bit is valid when the RXE bit in SICTR is 1. • This bit indicates a state; if SIRDR is read, the SIOF clears this bit.
Page 866
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description SAERR Slot Assign Error 0: Indicates that no slot assign error occurs 1: Indicates that a slot assign error occurs A slot assign error occurs when the specifications in SITDAR, SIRDAR, and SICDAR overlap.
Page 867
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description TFOVF Transmit FIFO Overflow 0: No transmit FIFO overflow 1: Transmit FIFO overflow A transmit FIFO overflow means that there has been an attempt to write to SITDR when the transmit FIFO is full. When a transmit FIFO overflow occurs, the SIOF indicates overflow, and writing is invalid.
Page 868
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description RFUDF Receive FIFO Underflow 0: No receive FIFO underflow 1: Receive FIFO underflow A receive FIFO underflow means that reading of SIRDR has occurred when the receive FIFO is empty. When a receive FIFO underflow occurs, the value of data read from SIRDR is not guaranteed.
Section 22 Serial I/O with FIFO (SIOF) 22.3.9 Interrupt Enable Register (SIIER) SIIER is a 16-bit readable/writable register that enables the issue of SIOF interrupts. When each interrupt enable bit in this register is set to 1 and the corresponding bit in SISTR is set to 1, the SIOF issues an interrupt.
Page 870
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description RCRDYE Receive Control Data Ready Enable 0: Disables interrupts due to receive control data ready 1: Enables interrupts due to receive control data ready RFFULE Receive FIFO Full Enable 0: Disables interrupts due to receive FIFO full 1: Enables interrupts due to receive FIFO full RDREQE...
Section 22 Serial I/O with FIFO (SIOF) 22.3.10 FIFO Control Register (SIFCTR) SIFCTR is a 16-bit readable/writable register that indicates the area available for the transmit/receive FIFO transfer. Bit: TFWM[2:0] TFUA[4:0] RFWM[2:0] RFUA[4:0] Initial value: R/W: Initial Bit Name Value Description 15 to 13 TFWM[2:0] Transmit FIFO Watermark...
Page 872
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description 7 to 5 RFWM[2:0] 000 Receive FIFO Watermark 000: Issue a transfer request when 1 stage or more of the receive FIFO are valid. 001: Setting prohibited 010: Setting prohibited 011: Setting prohibited 100: Issue a transfer request when 4 or more stages of the receive FIFO are valid.
Section 22 Serial I/O with FIFO (SIOF) 22.3.11 Transmit Data Assign Register (SITDAR) SITDAR is a 16-bit readable/writable register that specifies the position of the transmit data in a frame. Bit: — — — TDLA[3:0] — — TDRA[3:0] TDLE TDRE TLREP Initial value: R/W:...
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description 5, 4 — All 0 Reserved These bits are always read as 0. The write value should always be 0. 3 to 0 TDRA[3:0] 0000 Transmit Right-Channel Data Assigns 3 to 0 Specify the position of right-channel data in a transmit frame as 0000 (0) to 1110 (14).
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description RDRE Receive Right-Channel Data Enable 0: Disables right-channel data reception 1: Enables right-channel data reception 6 to 4 — All 0 Reserved These bits are always read as 0. The write value should always be 0.
Page 876
Section 22 Serial I/O with FIFO (SIOF) Initial Bit Name Value Description 11 to 8 CD0A[3:0] 0000 Control Channel 0 Data Assigns 3 to 0 Specify the position of control channel 0 data in a receive or transmit frame as 0000 (0) to 1110 (14). 1111: Setting prohibited •...
Section 22 Serial I/O with FIFO (SIOF) 22.4 Operation 22.4.1 Serial Clocks Master/Slave Modes: The following modes are available as the SIOF clock mode. • Slave mode: SIOF_SCK, SIOF_SYNC input • Master mode: SIOF_SCK, SIOF_SYNC output Baud Rate Generator: In SIOF master mode, the baud rate generator (BRG) is used to generate the serial clock.
Section 22 Serial I/O with FIFO (SIOF) 22.4.2 Serial Timing SIOF_SYNC: The SIOF_SYNC is a frame synchronous signal. Depending on the transfer mode, it has the following two functions. • Synchronous pulse: 1-bit-width pulse indicating the start of the frame •...
Section 22 Serial I/O with FIFO (SIOF) Transmit/Receive Timing: The SIOF_TXD transmit timing and SIOF_RXD receive timing relative to the SIOF_SCK can be set as the sampling timing in the following two ways. The transmit/receive timing is set using the REDG bit in SIMDR. •...
Section 22 Serial I/O with FIFO (SIOF) Frame Length: The length of the frame to be transferred by the SIOF is specified by the bits FL[3:0] in SIMDR. Table 22.7 shows the relationship between the bits FL[3:0] settings and frame length.
Section 22 Serial I/O with FIFO (SIOF) 22.4.4 Register Allocation of Transfer Data Transmit/Receive Data: Writing and reading of transmit/receive data is performed for the following registers. • Transmit data writing: SITDR (32-bit access) • Receive data reading: SIRDR (32-bit access) Figure 22.5 shows the transmit/receive data and the SITDR and SIRDR bit alignment.
Section 22 Serial I/O with FIFO (SIOF) Table 22.8 Audio Mode Specification for Transmit Data Mode TDLE TDRE TLREP Monaural Stereo Left and right same audio output Note: x: Don't care Table 22.9 Audio Mode Specification for Receive Data Mode RDLE RDRE Monaural...
Section 22 Serial I/O with FIFO (SIOF) The number of channels in control data is specified by the CD0E and CD1E bits in SICDAR. Table 22.10 shows the relationship between the number of channels in control data and bit settings. Table 22.10 Setting Number of Channels in Control Data Number of Channels CD0E...
Section 22 Serial I/O with FIFO (SIOF) Control by Secondary FS (Slave Mode 2): The CODEC normally outputs the SIOF_SYNC signal as synchronization pulse (FS). In this method, the CODEC outputs the secondary FS specific to the control data transfer after 1/2 frame time has been passed (not the normal FS output timing) to transmit or receive control data.
Section 22 Serial I/O with FIFO (SIOF) 22.4.6 FIFO Overview: The transmit and receive FIFOs of the SIOF have the following features. • 16-stage 32-bit FIFOs for transmission and reception • The FIFO pointer can be updated in one read or write cycle regardless of access size of the CPU and DMAC.
Page 887
Section 22 Serial I/O with FIFO (SIOF) The number of stages of the FIFO is always sixteen even if the data area or empty area exceeds the FIFO size (the number of FIFOs). Accordingly, an overflow error or underflow error occurs if data area or empty area exceeds sixteen FIFO stages.
Section 22 Serial I/O with FIFO (SIOF) 22.4.7 Transmit and Receive Procedures Transmission in Master Mode: Figure 22.9 shows an example of settings and operation for master mode transmission. Flow Chart SIOF Settings SIOF Operation Start Set operating mode, serial clock, slot positions for transmit data, Set SIMDR, SISCR, SITDAR, slot position for control data,...
Section 22 Serial I/O with FIFO (SIOF) Reception in Master Mode: Figure 22.10 shows an example of settings and operation for master mode reception. Flow Chart SIOF Settings SIOF Operation Start Set operating mode, serial clock, slot positions for receive data, Set SIMDR, SISCR, slot position for control data, and SIRDAR, SICDAR, and SIFCTR...
Section 22 Serial I/O with FIFO (SIOF) Transmission in Slave Mode: Figure 22.11 shows an example of settings and operation for slave mode transmission. Flow Chart SIOF Operation SIOF Settings Start Set operating mode, serial clock, slot positions for transmit data, slot position for control data, Set SIMDR, SISCR, SITDAR, control data, and FIFO request...
Section 22 Serial I/O with FIFO (SIOF) Reception in Slave Mode: Figure 22.12 shows an example of settings and operation for slave mode reception. Flow Chart SIOF Settings SIOF Operation Start Set operating mode, serial clock, Set SIMDR, SISCR, SIRDAR, slot positions for receive data, SICDAR, and SIFCTR slot position for control data, and...
Section 22 Serial I/O with FIFO (SIOF) Transmit/Receive Reset: The SIOF can separately reset the transmit and receive units by setting the following bits to 1. • Transmit reset: TXRST bit in SICTR • Receive reset: RXRST bit in SICTR Table 22.13 shows the details of initialization upon transmit or receive reset.
Section 22 Serial I/O with FIFO (SIOF) 22.4.8 Interrupts The SIOF has one type of interrupt. Interrupt Sources: Interrupts can be issued by several sources. Each source is shown as an SIOF status in SISTR. Table 22.14 lists the SIOF interrupt sources. Table 22.14 SIOF Interrupt Sources No.
Page 894
Section 22 Serial I/O with FIFO (SIOF) Regarding Interrupt Source: The transmit sources and receive sources are signals indicating the SIOF state; after being set, if the state changes, they are automatically cleared by the SIOF. When the DMA transfer is used, a DMA transfer request of the FIFO is disabled for one cycle at the end of that DMA transfer.
Section 22 Serial I/O with FIFO (SIOF) 22.4.9 Transmit and Receive Timing Examples of the SIOF serial transmission and reception are shown in figure 22.13 to figure 22.19. 8-bit Monaural Data (1): Synchronous pulse method, falling edge sampling, slot No.0 used for transmit and receive data, an frame length = 8 bits 1 frame SIOF_SCK...
Section 22 Serial I/O with FIFO (SIOF) 16-bit Stereo Data (2): L/R method, rising edge sampling, slot No.0 used for left-channel transmit data, slot No.1 used for left-channel receive data, slot No.2 used for right-channel transmit data, slot No.3 used for right-channel receive data, and frame length = 64 bits 1 frame SIOF_SCK SIOF_SYNC...
Section 22 Serial I/O with FIFO (SIOF) 16-bit Stereo Data (4): Synchronous pulse method, falling edge sampling, slot No.0 used for left- channel data, slot No.2 used for right-channel data, slot No.1 used for control data for channel 0 , slot No.3 used for control data for channel 1, and frame length = 128 bits 1 frame SIOF_SCK...
Section 23 Serial Protocol Interface (HSPI) Section 23 Serial Protocol Interface (HSPI) This LSI incorporates one channel of the Serial Protocol Interface (HSPI). 23.1 Features The HSPI has the following features. • Operating mode: Master mode or Slave mode. • The transmit and receive sections within the module are double buffered to allow duplex communication.
Section 23 Serial Protocol Interface (HSPI) 23.2 Input/Output Pins The input/output pins of the HSPI is shown in table 23.1. Table 23.1 Pin Configuration Pin Name Function Description HSPI_CLK Serial bit clock pin Input/Output Clock input/output HSPI_TX Transmit data pin Output Transmit data output HSPI_RX...
Section 23 Serial Protocol Interface (HSPI) 23.3.1 Control Register (SPCR) SPCR is a 32-bit readable/writable register that controls the transfer data of shift timing and specifies the clock polarity and frequency. Bit: — — — — — — — — —...
Page 903
Section 23 Serial Protocol Interface (HSPI) Initial Bit Name Value Description IDIV Initial Clock Division Ratio 0: The peripheral clock is divided by a factor of 4 initially to create an intermediate frequency, which is further divided to create the serial bit clock when master mode.
Section 23 Serial Protocol Interface (HSPI) 23.3.2 Status Register (SPSR) SPSR is a 32-bit readable/writable register. The status flag in SPSR can confirm whether the HSPI correctly operates or not. If the ROIE bit in SPSCR is set to 1, an interrupt request is generated due to the occurrence of the receive buffer overrun error or the warning of the receive buffer overrun error.
Page 905
Section 23 Serial Protocol Interface (HSPI) Initial Bit Name Value Description TXEM Transmit FIFO Empty Flag This status flag is enabled only to operation in FIFO mode. The flag is set to 1 when the transmit FIFO is empty of data to transmit. It is cleared to 0 when more data is written to the transmit FIFO.
Page 906
Section 23 Serial Protocol Interface (HSPI) Initial Bit Name Value Description RXOW R/W* Receive Buffer Overrun Warning Flag This status flag is set to 1 when a new serial data transfer starts and the previous received data has not been read from SPRBR. The RXOW remain set to 1 until writing a 0 to its bit position.
Section 23 Serial Protocol Interface (HSPI) 23.3.3 System Control Register (SPSCR) SPSCR is a 32-bit readable/writable register that enables or disables interrupts or FIFO mode, selects either LSB first or MSB first in transmitting/receiving date, and master or slave mode. If any of the FFEN, LMSB, CSA or MASL bit values are changed, then the module will undergo the HSPI software reset.
Page 908
Section 23 Serial Protocol Interface (HSPI) Initial Bit Name Value Description FFEN FIFO Mode Enable Enables or disables the FIFO mode. When FIFO mode is enabled two 8-entry deep FIFOs are made available, one for transmit data and one for receive data. These FIFOs are read and written via SPTBR and SPRBR.
Section 23 Serial Protocol Interface (HSPI) Initial Bit Name Value Description RXDE Receive DMA Enable 0: Receive DMA transfer request disabled 1: Receive DMA transfer request enabled TXDE Transmit DMA Enable 0: Transmit DMA transfer request disabled 1: Transmit DMA transfer request enabled MASL Master/Slave Select Bit 0: HSPI module configured as a slave...
Section 23 Serial Protocol Interface (HSPI) 23.4 Operation 23.4.1 Operation Overview without DMA (FIFO Mode Disabled) Figure 23.2 shows the flow of a transmit/receive operation procedure. Start Reset the system Select master or slave operation by setting the MASL bit in SPSCR Select required interrupts by setting TFIE and ROIE bits in...
Section 23 Serial Protocol Interface (HSPI) During the transmit function the slave responds by sending data to the master synchronized with the HSPI_CLK from the master transmitted. Data from the slave is sampled and transferred to the shift register in the module and on completion of the transmit function, is transferred to SPRBR. The HSPI_CS pin is used to select the HSPI module when the HSPI is configured as a slave, and prepare it to receive data from an external master.
Section 23 Serial Protocol Interface (HSPI) 6. Disable the module until it is required again. In some applications, an undefined amount of data will received from an external HSPI device. If this is the case, follow the following procedure: 1. Set up the module for the required HSPI transfer characteristics (master/slave, clock polarity etc.) and enable FIFO mode.
Section 23 Serial Protocol Interface (HSPI) sck_cycle HSPI_CLK (CLKP = 0) HSPI_CLK (CLKP = 1) HSPI_TX HSPI_RX HSPI_RX Figure 23.4 Timing Conditions when FBS = 1 23.4.5 HSPI Software Reset If any of the FBS, CLKP, IDIV or CLKC bit values are changed, then the HSPI software reset is generated.
Section 24 Multimedia Card Interface (MMCIF) Section 24 Multimedia Card Interface (MMCIF) This LSI supports a multimedia card interface (MMCIF). The MMC mode interface can be utilized. The MMCIF is a clock-synchronous serial interface that transmits/receives data that is distinguished in terms of command and response. A number of commands/responses are predefined in the multimedia card.
Section 24 Multimedia Card Interface (MMCIF) Figure 24.1 shows a block diagram of the MMCIF. MMCIF MCDAT Data transmission/ FIFO reception control Peripheral bus Command transmission/ MCCMD response reception control Interrupt control FSTAT TRAN MMC mode control FRDY Card clock MCCLK generator Figure 24.1 Block Diagram of MMCIF...
Section 24 Multimedia Card Interface (MMCIF) 24.3.1 Command Registers 0 to 5 (CMDR0 to CMDR5) The CMDR registers are six 8-bit registers. A command is written to CMDR as shown in table 24.4, and the command is transmitted when the START bit in CMDSTRT is set to 1. Each command is transmitted in order form the MSB (bit 7) in CMDR0 to the LSB (bit 0) in CMDR5.
Section 24 Multimedia Card Interface (MMCIF) 24.3.2 Command Start Register (CMDSTRT) CMDSTRT is an 8-bit readable/writable register that triggers the start of command transmission, representing the start of a command sequence. The following operations should have been completed before the command sequence starts. •...
Section 24 Multimedia Card Interface (MMCIF) 24.3.3 Operation Control Register (OPCR) OPCR is an 8-bit readable/writable register that aborts command operation, and suspends or continues data transfer. Bit: DATAEN CONTI Initial value: R/W: Initial Bit Name Value Description CMDOFF...
Page 924
Section 24 Multimedia Card Interface (MMCIF) Initial Bit Name Value Description DATAEN Data Enable Starts a write data transmission by a command with write data. This bit is cleared automatically when 1 is written and the MMCIF received the DATAEN command.
Section 24 Multimedia Card Interface (MMCIF) 24.3.4 Card Status Register (CSTR) CSTR indicates the MMCIF status during command sequence execution. Bit: FIFO_ FIFO_ DTBUSY — BUSY CWRE DTBUSY FULL EMPTY Initial value: — R/W: Initial Bit Name Value Description BUSY Command Busy Indicates command execution status.
Page 926
Section 24 Multimedia Card Interface (MMCIF) Initial Bit Name Value Description CWRE Command Register Write Enable Indicates whether the CMDR command is being transmitted or has been transmitted. 0: The CMDR command has been transmitted, or the START bit in CMDSTRT has not been set yet, so the new command can be written.
Section 24 Multimedia Card Interface (MMCIF) 24.3.5 Interrupt Control Registers 0 to 2 (INTCR0 to INTCR2) The INTCR registers enable or disable interrupts. • INTCR0 Bit: BTIE FEIE FFIE DRPIE DTIE CRPIE CMDIE Initial value: R/W: Initial Bit Name Value Description FEIE FIFO Empty Interrupt Flag Setting Enable...
Page 928
Section 24 Multimedia Card Interface (MMCIF) Initial Bit Name Value Description CMDIE Command Transmit End Interrupt Flag Setting Enable 0: Disables command transmit end interrupt (disables CMDI flag setting). 1: Enables command transmit end interrupt (enables CMDI flag setting). DBSYIE Data Busy End Interrupt Flag Setting Enable 0: Disables data busy end interrupt (disables DBSYI flag setting).
Page 929
Section 24 Multimedia Card Interface (MMCIF) Initial Bit Name Value Description CRCERIE CRC Error Interrupt Flag Setting Enable 0: Disables CRC error interrupt (disables CRCERI flag setting). 1: Enables CRC error interrupt (enables CRCERI flag setting). DTERIE Data Timeout Error Interrupt Flag Setting Enable 0: Disables data timeout error interrupt (disables DTERI flag setting).
Section 24 Multimedia Card Interface (MMCIF) 24.3.6 Interrupt Status Registers 0 to 2 (INTSTR0 to INTSTR2) The INTSTR registers enable or disable MMCIF interrupts FSTAT, TRAN, ERR and FRDY. • INTSTR0 Bit: DRPI CRPI CMDI DBSYI Initial value: R/W: Initial Interrupt Bit Name Value...
Page 931
Section 24 Multimedia Card Interface (MMCIF) Initial Interrupt Bit Name Value Description output DRPI Data Response Interrupt Flag TRAN 0: No interrupt [Clearing condition] Write 0 after reading DRPI = 1. (Writing 1 is invalid) 1: Interrupt requested [Setting condition] When the CRC status is received while DRPIE = 1.
Page 932
Section 24 Multimedia Card Interface (MMCIF) Initial Interrupt Bit Name Value Description output DBSYI Data Busy End Interrupt Flag TRAN 0: No interrupt [Clearing condition] Write 0 after reading DBSYI = 1. (Writing 1 is invalid) 1: Interrupt requested [Setting condition] When data busy state is canceled while DBSYIE = 1.
Page 933
Section 24 Multimedia Card Interface (MMCIF) • INTSTR1 Bit: DTERI CTERI Initial value: R/W: Initial Interrupt Bit Name Value Description output 7 to 3 — All 0 Reserved — These bits are always read as 0. The write value should always be 0.
Page 934
Section 24 Multimedia Card Interface (MMCIF) • INTSTR2 Bit: FRDY — — — — — — FRDYI Initial value: — R/W: Initial Interrupt Bit Name Value Description output 7 to 2 All 0 Reserved These bits are always read as 0. The write value should always be 0.
Section 24 Multimedia Card Interface (MMCIF) 24.3.7 Transfer Clock Control Register (CLKON) CLKON controls the transfer clock frequency and clock ON/OFF. At this time, use a sufficiently slow clock for transfer through open-drain type output in MMC mode. In a command sequence, do not perform clock ON/OFF or frequency modification. Bit: ...
Section 24 Multimedia Card Interface (MMCIF) 24.3.8 Command Timeout Control Register (CTOCR) CTOCR specifies the period to generate a timeout for the command response. The counter (CTOUTC), to which the peripheral bus does not have access, counts the transfer clock to monitor the command timeout. The initial value of CTOUTC is 0, and CTOUTC starts counting the transfer clock from the start of command transmission.
Section 24 Multimedia Card Interface (MMCIF) 24.3.9 Transfer Byte Number Count Register (TBCR) TBCR is an 8-bit readable/writable register that specifies the number of bytes to be transferred (block size) for each single block transfer command. TBCR specifies the number of data block bytes not including the start bit, end bit, and CRC.
Section 24 Multimedia Card Interface (MMCIF) 24.3.10 Mode Register (MODER) MODER is an 8-bit readable/writable register that specifies the MMCIF operating mode. The following sequence should be repeated when the MMCIF uses the multimedia card: Send a command, wait for the end of the command sequence and the end of the data busy state, and send a next command.
Section 24 Multimedia Card Interface (MMCIF) 24.3.11 Command Type Register (CMDTYR) CMDTYR is an 8-bit readable/writable register that specifies the command format in conjunction with RSPTYR. Bits TY1 and TY0 specify the existence and direction of transfer data, and bits TY6 to TY2 specify the additional settings.
Section 24 Multimedia Card Interface (MMCIF) Initial Bit Name Value Description Type 3 Set this bit to 1 when specifying stream transfer. Bits TY1 and TY0 should be set to 01 or 10. The command sequence of the stream transfer specified by this bit ends when it is aborted by the CMD12 command.
Page 941
Section 24 Multimedia Card Interface (MMCIF) Initial Bit Name Value Description 7, 6 All 0 Reserved This bit is always read as 0. The write value should always be 0. RTY5 Response Type 5 Sets data busy status from the MMC card. 0: A command without data busy 1: A command with data busy RTY4...
Section 24 Multimedia Card Interface (MMCIF) Table 24.5 summarizes the correspondence between the commands described in the MultiMediaCard System Specification Version 3.1 and the settings of the CMDTYR and RSPTYR registers. Table 24.5 Correspondence between Commands and Settings of CMDTYR and RSPTYR CMDTYR RSPTYR INDEX...
Section 24 Multimedia Card Interface (MMCIF) 24.3.13 Transfer Block Number Counter (TBNCR) A value other than 0 must be written to the TBNCR register if a multiple block transfer is selected through the TY5 and TY6 bits in the CMDTYR. Set the transfer block number in the TBNCR. The value of TBNCR is decremented by one as each block transfer is executed and the command sequence ends when the TBNCR value equals 0.
Section 24 Multimedia Card Interface (MMCIF) 24.3.14 Response Registers 0 to 16, D (RSPR0 to RSPR16, RSPRD) RSPR0 to RSPR16 are command response registers, which are seventeen 8-bit registers. RSPRD is an 8-bit CRC status register. The number of command response bytes differs according to the command. The number of command response bytes can be specified by RSPTYR in the MMCIF.
Page 946
Section 24 Multimedia Card Interface (MMCIF) Clearing an RSPR is completed two transfer clock cycles after an arbitrary value is written to the RSPR. • RSPR0 to RSPR16 Bit: RSPR Initial value: R/W: Initial Bit Name Value Description 7 to 0 RSPR H'00 These bits are cleared to H'00 by writing an arbitrary...
Section 24 Multimedia Card Interface (MMCIF) 24.3.15 Data Timeout Register (DTOUTR) DTOUTR specifies the period to generate a data timeout. The 16-bit counter (DTOUTC) and a prescaler, to which the peripheral bus does not have access, count the peripheral clock to monitor the data timeout.
Section 24 Multimedia Card Interface (MMCIF) 24.3.16 Data Register (DR) DR is a register for reading/writing FIFO data. Word/byte access is enabled to addresses of this register. Bit: Initial value: — — — — — — — — — — —...
Section 24 Multimedia Card Interface (MMCIF) 1 word (2 bytes) H'01 H'23 H'45 H'67 64 words H'89 H'AB FIFO Figure 24.2 DR Access Example 24.3.17 FIFO Pointer Clear Register (FIFOCLR) The FIFO write/read pointer is cleared by writing an arbitrary value to FIFOCLR. Bit: FIFOCLR Initial value:...
Section 24 Multimedia Card Interface (MMCIF) 24.3.18 DMA Control Register (DMACR) DMACR sets DMA request signal output. DMAEN enables or disables a DMA request signal. The DMA request signal is output based on a value that has been set to SET2 to SET0. Bit: ...
Section 24 Multimedia Card Interface (MMCIF) 24.4 Operation The multimedia card is an external storage media that can be easily connected or disconnected. The MMCIF operates in MMC mode. Insert a card and supply power to it. Then operate the MMCIF by applying the transfer clock after setting an appropriate transfer clock frequency.
Page 952
Section 24 Multimedia Card Interface (MMCIF) • All cards are initialized to the idle state by CMD0. • The operation condition registers (OCR) of all cards are read via wired-OR and cards that cannot operate are deactivated by CMD1. The cards that are not deactivated enter the ready state. •...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Set command data to CMDR0 to CMDR4 Set command type to CMDTYR Set command response type to RSPTYR Set the START bit in CMDSTRT to 1 (CMDI) interrupt detected? End of command sequence Figure 24.4 Example of Operational Flow for Commands Not Requiring Command Response Operation of Commands without Data Transfer...
Section 24 Multimedia Card Interface (MMCIF) • The command response is received from the card. If the card returns no command response, the command response is detected by the command timeout error (CTERI). • The end of the command sequence is detected by poling the BUSY flag in CSTR or by the command response receive end interrupt (CRPI).
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Set command data to CMDR0 to CMDR4 Set command type to CMDTYR Set command response type to RSPTYR Set the START bit in CMDSTRT to 1 (CRCERI) interrupt detected? (CRPI) interrupt detected? response? DTBUSY...
Page 958
Section 24 Multimedia Card Interface (MMCIF) Commands with Read Data Flash memory operation commands include a number of commands involving read data. Such commands confirm the card status by the command argument and command response, and receive card information and flash memory data from the MCDAT pin. In multiple block transfer, two transfer methods can be used;...
Section 24 Multimedia Card Interface (MMCIF) • The end of the command sequence is detected by poling the BUSY flag in CSTR, by the data transfer end interrupt (DTI) or pre-defined multiple block transfer end (BTI). • Write the CMDOFF bit to 1 if a CRC error (CRCERI) or a command timeout error (CTERI) occurs in the command response reception.
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set the number of transfer block size to (TBCR) Execute CMD16 CMD16 normal end? Execute CMD17 (CMDR to CMDSTRT) (CRCERI) interrupt detected? (CRPI) inte rrupt detected? Read response register (CTERI) interrupt detected? Response status...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set the number of transfer block size to (TBCR) Execute CMD16 CMD16 normal end? Execute CMD18 (CMDR to CMDSTRT) (CRCERI) interrupt detected? (CRPI) interrupt detected? Read response register (CTERI) interrupt detected? Response status...
Section 24 Multimedia Card Interface (MMCIF) (DTERI) interrupt detected? Cap ≥ Len (1 + n (DTI)) - Cap × n (FFI) (CRCERI) interrupt detected? (DTERI) interrupt detected? (DTI) interrupt detected? Next block read? (FFI) interrupt detected? Read data from FIFO Set the RD_CONTI to 1 Read data from FIFO Set the CMDOFF to 1...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set the number of transfer block size to (TBCR) Execute CMD16 CMD16 normal end? Set the number of transfer block (TBNCR) Execute CMD23 CMD23 normal end? Execute CMD18 (CMDR to CMDSTRT) (CRCERI) interrupt detected?
Section 24 Multimedia Card Interface (MMCIF) (DTERI) interrupt detected? Cap ≥ Len (1 + n (DTI)) - Cap × n (FFI) (CRCERI) interrupt detected? (DTERI) interrupt detected? (DTI) interrupt detected? (FFI) interrupt detected? TBNCR value = n (DTI) ? (BTI) interrupt detected? Read data from FIFO Read data from FIFO...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Execute CMD11 (CMDR to CMDSTRT) (CRCERI) inte rrupt detected? (CRPI) inte rrupt detected? Read response register (CTERI) interrupt detected? Response status normal ended? (DTERI) inte rrupt detected? (FFI) interrupt detected? Data read completed?
Page 969
Section 24 Multimedia Card Interface (MMCIF) Commands with Write Data Flash memory operation commands include a number of commands involving write data. Such commands confirm the card status by the command argument and command response, and transmit card information and flash memory data via the MCDAT pin. For a command that is related to time-consuming processing such as flash memory write, the card indicates the data busy state via the MCDAT pin.
Page 970
Section 24 Multimedia Card Interface (MMCIF) • The end of the command sequence is detected by poling the BUSY flag in CSTR, data transfer end interrupt (DTI), data response interrupt (DRPI), or pre-defined multiple block transfer end (BTI). • The data busy state is checked through DTBUSY in CSTR. If the card is in data busy state, the end of the data busy state is detected by the data busy end interrupt (DBSYI).
Section 24 Multimedia Card Interface (MMCIF) Input/output pins MCCLK CMD25 WRITE_MULTIPE_BLOCK CMD12(STOP_TRANSMISSION) MCCMD Command Command Command Write data Write data Write data Command response response Status Status MCDAT Command CMDSTRT transmission started (START) Next block data Block data Block data transmission transmission reception...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set the number of transfer block size to TBCR Execute CMD16 CMD16 normal end? Execute CMD24 (CMDR to CMDSTRT) (CRCERI) interrupt detected? (CRPI) interrupt detected? Read response register (CTERI) interrupt detected? Response status...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set the number of transfer block size to TBCR Execute CMD16 CMD16 normal end? Execute CMD25 (CMDR to CMDSTRT) (CRCERI) interrupt detected? (CRPI) interrupt detected? (CTERI) interrupt Read response register detected? Response status normal ended?
Section 24 Multimedia Card Interface (MMCIF) Writing data to FIFO Set the DATAEN to 1 (FEI) interrupt detected? Cap × n (FEI) - Len (1 + n (DTI)) ≥ Len (DTI) interrupt detected? (CRCERI) interrupt detected? (DTERI) interrupt detected? (DRPI) interrupt detected? (DTBUSY) detected? (DBSYI) interrupt...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set the number of transfer block size to TBCR Execute CMD16 CMD16 normal end? Set the number of block to TBNCR Execute CMD 23 CMD 23 normal end? Execute CMD25 (CMDR to CMDSTRT) (CRCERI) interrupt...
Section 24 Multimedia Card Interface (MMCIF) Writing data to FIFO Set the DATAEN to 1 (FEI) interrupt detected? Cap × n (FEI) - Len (1 + n (DRPI)) ≥ Len (DTI) interrupt detected? (CRCERI) interrupt detected? (DTERI) interrupt detected? (DRPI) interrupt detected? (DTBUSY) detected? (DBSYI) interrupt...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Execute CMD20 (CMDR to CMDSTRT) (CRCERI) interrupt detected? (CRPI) interrupt detected? (CTERI) interrupt Read response register detected? Response status normal ended? Writing data to FIFO Set the DATAEN to 1 (FEI) interrupt detected? All data write to...
Section 24 Multimedia Card Interface (MMCIF) 24.5 MMCIF Interrupt Sources Table 24.7 lists the MMCIF interrupt sources. The interrupt sources are classified into four groups, and four interrupt vectors are assigned. Each interrupt source can be individually enabled by the enable bits in INTCR0 to INTCR2.
Section 24 Multimedia Card Interface (MMCIF) 24.6 Operations when Using DMA 24.6.1 Operation in Read Sequence In order to transfer data in FIFO with the DMAC, set MMCIF (DMACR) after setting the DMAC*. Transmit the read command after setting DMACR. Figure 24.22 to 24.24 shows the operational flow for a read sequence.
Page 983
Section 24 Multimedia Card Interface (MMCIF) • An error in a command sequence (during data reception) is detected through the CRC error flag or data timeout flag. When these flags are detected, set the CMDOFF bit in OPCR to 1, issue CMD12 and suspend the command sequence.
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set the number of transfer block size to TBCR Execute CMD16 CMD16 normal end? Set DMAC-related condition Set DMACR Execute CMD17 (CMDR to CMDSTRT) (CRCERI) interrupt detected? (CRPI) interrupt detected? (CTERI) interrupt Read response register...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set the number of transfer block size to TBCR Execute CMD16 CMD16 normal end? Set DMAC-related condition Set DMACR Execute CMD 18 (CMDR to CMDSTRT) (CRCERI) interrupt detected? (CRPI) interrupt detected? (CTERI) interrupt...
Section 24 Multimedia Card Interface (MMCIF) (CRCERI) interrupt detected? (DTERI) interrupt detected? (DTI) interrupt detected? Next block read? Set RD_CONTI to 1 Set the DMACR to H'84 DMA transfer end? Set the CMDOFF to 1 Set the CMDOFF to 1 Set the CMDOFF to 1 Execute CMD12 Execute CMD12...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set the number of transfer block size to TBCR Execute CMD16 CMD16 normal end? Set the number of block to TBNCR Execute CMD 23 CMD 23 normal end? Set DMAC-related condition Set DMACR Execute CMD 18...
Section 24 Multimedia Card Interface (MMCIF) (CRCERI) interrupt detected? (DTERI) interrupt detected? (DTI) interrupt detected? TBNCR = n (DTI)? Set RD_CONTI to 1 (BTI) interrupt detected? Set the DMACR to H'84 DMA transfer end? Set the CMDOFF to 1 Set the CMDOFF to 1 Set the CMDOFF to 1 Execute CMD12 Clear the DMACR to H'00...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set DMAC-related condition Set DMACR Execute CMD11 (CMDR to CMDSTRT) (CRCERI) interrupt detected? (CRPI) interrupt detected? (CTERI) interrupt Read response register detected? Response status normal ended? (DTERI) interrupt detected? DMA transfer end? Set the CMDOFF to 1...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set the number of transfer block size to TBCR Execute CMD16 CMD16 normal end? Set the number of transfer block to TBNCR Execute CMD 23 CMD 23 normal end? Set DMAC-related condition Set DMACR Execute CMD 18...
Section 24 Multimedia Card Interface (MMCIF) (CRCERI) interrupt detected? (DTERI) interrupt detected? (BTI) interrupt detected? Set the DMACR to H'84 DMA transfer end? Set the CMDOFF to 1 Set the CMDOFF to 1 Set the CMDOFF to 1 Execute CMD12 Clear the DMACR to H'00 Clear the DMACR to H'00 Clear the DMACR to H'00...
Section 24 Multimedia Card Interface (MMCIF) 24.6.2 Operation in Write Sequence To transfer data to FIFO with the DMAC, set MMCIF (DMACR) after setting the DMAC. Then, start transfer to the card after a FIFO ready interrupt. Figure 24.26 to 24.28 shows the operational flow for a write sequence.
Page 993
Section 24 Multimedia Card Interface (MMCIF) • An error in a command sequence (during data transmission) is detected through the CRC error flag (CRCERI) or data timeout error flag (DTERI). When these flags are detected, set the CMDOFF bit in OPCR to 1, issue CMD12 (Stop Tran in SPI mode), and suspend the command sequence.
Section 24 Multimedia Card Interface (MMCIF) (FRDYI) interrupt detected or DMA transfer end? Set the DATAEN bit to 1 DMA transfer end? Clear the DMACR to H'00 (DTI) interrupt detected? (CRCERI) interrupt detected? (DTERI) interrupt detected? (DRPI) interrupt detected? Set the CMDOFF to 1 (DTBUSY) detected? (DBSYI) interrupt detected?
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Set the number of transfer block size to TBCR Execute CMD16 CMD16 normal end? Set the number of block to TBNCR Execute CMD 23 CMD 23 normal end? Execute CMD 25 (CMDR to CMDSTRT) (CRCERI) interrupt...
Section 24 Multimedia Card Interface (MMCIF) Start of command sequence Clear FIFO Execute CMD 20 (CMDR to CMDSTRT) (CRCERI) interrupt detected? (CRPI) interrupt detected? (CTERI) interrupt Read response register detected? Response status normal ended? Set DMAC-related condition Set DMACR (FRDYI) interrupt detected or DMA transfer end? Set the DATAEN to 1...