Hitachi SH7751 Hardware Manual

Superh risc engine
Table of Contents

Quick Links

To all our customers
Regarding the change of names mentioned in the document, such as
Hitachi Electric and Hitachi XX, to Renesas Technology Corp.
The semiconductor operations of Mitsubishi Electric and Hitachi were
transferred to Renesas Technology Corporation on April 1st 2003.
These operations include microcomputer, logic, analog and discrete devices,
and memory chips other than DRAMs (flash memory, SRAMs etc.)
Accordingly, although Hitachi, Hitachi, Ltd., Hitachi Semiconductors,
and other Hitachi brand names are mentioned in the document, these names
have in fact all been changed to Renesas Technology Corp.
Thank you for your understanding. Except for our corporate trademark,
logo and corporate statement, no changes whatsoever have been made to the
contents of the document, and these changes do not constitute any alteration
to the contents of the document itself.
Renesas Technology Corp.
Renesas Technology Home Page: www.renesas.com
Renesas Technology Corp.
Customer Support Dept.
April 1, 2003
Table of Contents
loading

Summary of Contents for Hitachi SH7751

  • Page 1 DRAMs (flash memory, SRAMs etc.) Accordingly, although Hitachi, Hitachi, Ltd., Hitachi Semiconductors, and other Hitachi brand names are mentioned in the document, these names have in fact all been changed to Renesas Technology Corp. Thank you for your understanding. Except for our corporate trademark,...
  • Page 2 Hitachi SuperH RISC engine SH7751 Series SH7751, SH7751R Hardware Manual ADE-602-201B Rev. 3.0 4/11/2002 Hitachi, Ltd.
  • Page 3 Cautions 1. Hitachi neither warrants nor grants licenses of any rights of Hitachi’s or any third party’s patent, copyright, trademark, or other intellectual property rights for information contained in this document. Hitachi bears no responsibility for problems that may arise with third party’s rights, including intellectual property rights, in connection with use of the information contained in this document.
  • Page 4 CPU and is also equipped with peripheral functions necessary for configuring a user system. The SH7751 Series is built in with a variety of peripheral functions such as cache memory, memory management unit (MMU), interrupt controller, floating-point unit (FPU), timers, two serial communication interfaces (SCI, SCIF), real-time clock (RTC), user break controller (UBC), bus state controller (BSC) and PCI controller (PCIC).
  • Page 5 User manuals for SH7751 and SH7751R Name of Document Document No. SH7751 Series Hardware Manual This manual SH-4 Programming Manual ADE-602-156 User manuals for development tools Name of Document Document No. C/C++ Compiler, Assembler, Optimizing Linkage Editor User’s Manual ADE-702-246 Simulator/Debugger User’s Manual...
  • Page 6: Table Of Contents

    Contents Section 1 Overview ......................SH7751 Series Features..................... Block Diagram ........................10 Pin Arrangement ....................... 11 Pin Functions........................13 1.4.1 Pin Functions (256-Pin QFP) ................13 1.4.2 Pin Functions (256-Pin BGA) ................24 Section 2 Programming Model ..................35 Data Formats ........................35 Register Configuration ......................
  • Page 7 3.4.2 Instruction TLB (ITLB) Configuration ..............69 3.4.3 Address Translation Method ................69 MMU Functions ........................ 72 3.5.1 MMU Hardware Management ................72 3.5.2 MMU Software Management................72 3.5.3 MMU Instruction (LDTLB) ................. 72 3.5.4 Hardware ITLB Miss Handling................73 3.5.5 Avoiding Synonym Problems ................
  • Page 8 Memory-Mapped Cache Configuration (SH7751) ............103 4.5.1 IC Address Array ....................103 4.5.2 IC Data Array ....................... 104 4.5.3 OC Address Array ....................105 4.5.4 OC Data Array ..................... 106 Memory-Mapped Cache Configuration (SH7751R) ............107 4.6.1 IC Address Array ....................108 4.6.2...
  • Page 9 Data Formats ........................155 6.2.1 Floating-Point Format ..................155 6.2.2 Non-Numbers (NaN).................... 157 6.2.3 Denormalized Numbers..................158 Registers ..........................159 6.3.1 Floating-Point Registers ..................159 6.3.2 Floating-Point Status/Control Register (FPSCR) ..........161 6.3.3 Floating-Point Communication Register (FPUL)..........162 Rounding ........................... 162 Floating-Point Exceptions ....................
  • Page 10 9.5.1 Transition to Pin Sleep Mode................225 9.5.2 Exit from Pin Sleep Mode ..................225 Standby Mode ........................225 9.6.1 Transition to Standby Mode ................. 225 9.6.2 Exit from Standby Mode ..................226 9.6.3 Clock Pause Function................... 227 Module Standby Function ....................227 9.7.1 Transition to Module Standby Function...............
  • Page 11 10.8.3 Notes on Register Access ..................257 10.9 Using the WDT ......................... 258 10.9.1 Standby Clearing Procedure................. 258 10.9.2 Frequency Changing Procedure ................258 10.9.3 Using Watchdog Timer Mode................259 10.9.4 Using Interval Timer Mode.................. 259 10.10 Notes on Board Design...................... 260 Section 11 Realtime Clock (RTC) ..................
  • Page 12 Section 12 Timer Unit (TMU) ..................287 12.1 Overview ........................... 287 12.1.1 Features ........................ 287 12.1.2 Block Diagram ..................... 288 12.1.3 Pin Configuration ....................288 12.1.4 Register Configuration ..................289 12.2 Register Descriptions......................290 12.2.1 Timer Output Control Register (TOCR) .............. 290 12.2.2 Timer Start Register (TSTR) ................
  • Page 13 .......... 463 14.1 Overview ........................... 463 14.1.1 Features ........................ 463 14.1.2 Block Diagram (SH7751)..................466 14.1.3 Pin Configuration (SH7751) ................467 14.1.4 Register Configuration (SH7751) ................ 468 14.2 Register Descriptions......................470 14.2.1 DMA Source Address Registers 0–3 (SAR0–SAR3)........... 470 14.2.2 DMA Destination Address Registers 0–3 (DAR0–DAR3) ........471 14.2.3 DMA Transfer Count Registers 0–3 (DMATCR0–DMATCR3) ......
  • Page 14 14.4.1 Examples of Transfer between External Memory and an External Device with DACK ......................519 14.5 On-Demand Data Transfer Mode (DDT Mode) ..............520 14.5.1 Operation......................520 14.5.2 Pins in DDT Mode ....................522 14.5.3 Transfer Request Acceptance on Each Channel........... 525 14.5.4 Notes on Use of DDT Module ................
  • Page 15 15.3.2 Operation in Asynchronous Mode................ 599 15.3.3 Multiprocessor Communication Function ............609 15.3.4 Operation in Synchronous Mode................618 15.4 SCI Interrupt Sources and DMAC..................627 15.5 Usage Notes........................628 Section 16 Serial Communication Interface with FIFO (SCIF) ......633 16.1 Overview ........................... 633 16.1.1 Features ........................
  • Page 16 17.3.1 Overview ......................686 17.3.2 Pin Connections....................687 17.3.3 Data Format......................688 17.3.4 Register Settings....................689 17.3.5 Clock ........................691 17.3.6 Data Transfer Operations ..................694 17.4 Usage Notes........................701 Section 18 I/O Ports ......................707 18.1 Overview ........................... 707 18.1.1 Features ........................
  • Page 17 20.6.1 Transition to User Break Controller Stopped State ..........775 20.6.2 Cancelling the User Break Controller Stopped State ........... 775 20.6.3 Examples of Stopping and Restarting the User Break Controller ......776 Section 21 Hitachi User Debug Interface (H-UDI) ............ 777 21.1 Overview ........................... 777 21.1.1 Features ........................
  • Page 18 21.1.3 Pin Configuration ....................779 21.1.4 Register Configuration ..................780 21.2 Register Descriptions......................781 21.2.1 Instruction Register (SDIR).................. 781 21.2.2 Data Register (SDDR)..................782 21.2.3 Bypass Register (SDBPR)..................782 21.2.4 Interrupt Factor Register (SDINT) ............... 783 21.2.5 Boundary Scan Register (SDBSR) ............... 783 21.3 Operation...........................
  • Page 19 22.2.21 PCI Interrupt Mask Register (PCIINTM)............. 848 22.2.22 PCI Address Data Register at Error (PCIALR)............ 850 22.2.23 PCI Command Data Register at Error (PCICLR)..........851 22.2.24 PCI Arbiter Interrupt Register (PCIAINT)............853 22.2.25 PCI Arbiter Interrupt Mask Register (PCIAINTM) ..........855 22.2.26 PCI Error Bus Master Data Register (PCIBMLR) ..........
  • Page 20 22.6.2 Interrupts from External PCI Devices ..............921 22.6.3 ........................921 22.7 Error Detection ........................922 22.8 PCIC Clock ........................922 22.9 Power Management......................923 22.9.1 Power Management Overview ................923 22.9.2 Stopping the Clock ....................924 22.9.3 Compatibility with Standby and Sleep ..............927 22.10 Port Functions ........................
  • Page 21 Figures Figure 1.1 Block Diagram of SH7751 Series Functions ........... Figure 1.2 Pin Arrangement (256-Pin QFP)..............Figure 1.3 Pin Arrangement (256-Pin BGA) ..............Figure 2.1 Data Formats....................Figure 2.2 CPU Register Configuration in Each Processor Mode ........Figure 2.3 General Registers .....................
  • Page 22 Timing When Power Other than VDD-RTC is Off ......... 239 Figure 9.15 Timing When VDD-RTC Power is Off On ..........240 Figure 10.1(1) Block Diagram of CPG (SH7751) ..............243 Figure 10.1(2) Block Diagram of CPG (SH7751R)..............244 Figure 10.2 Block Diagram of WDT................... 253 Figure 10.3...
  • Page 23 Figure 12.7 Operation Timing when Using Input Capture Function........302 Figure 13.1 Block Diagram of BSC ..................307 Figure 13.2 Correspondence between Virtual Address Space and External Memory Space 311 Figure 13.3 External Memory Space Allocation ..............313 Figure 13.4 Example of Sampling Timing at which BCR4 is Set (Two Wait Cycles are Inserted by WCR2) ............
  • Page 24 Figure 13.34 Burst Read Cycle for Different Bank and Row Address Following Preceding Burst Read Cycle ..................... 410 Figure 13.35 Auto-Refresh Operation................... 411 Figure 13.36 Synchronous DRAM Auto-Refresh Timing ............ 412 Figure 13.37 Synchronous DRAM Self-Refresh Timing ............413 Figure 13.38(1) Synchronous DRAM Mode Write Timing (PALL) ......... 415 Figure 13.38(2) Synchronous DRAM Mode Write Timing (Mode Register Setting) ....
  • Page 25 Figure 13.62 MPX Interface Timing 3 (Burst Write Cycle, AnW = 0, No External Wait, Bus Width: 32 Bits, Transfer Data Size: 64 Bits)................445 Figure 13.63 MPX Interface Timing 4 (Burst Write Cycle, AnW = 1, One External Wait Inserted, Bus Width: 32 Bits, Transfer Data Size: 64 Bits)................
  • Page 26 Figure 14.15 Dual Address Mode/Burst Mode External Bus External Bus/ (Edge Detection), DACK (Read Cycle) ..........508 Figure 14.16 Dual Address Mode/Cycle Steal Mode On-Chip SCI (Level Detection) External Bus..................... 509 Figure 14.17 Dual Address Mode/Cycle Steal Mode External Bus On-Chip SCI (Level Detection) .....................
  • Page 27 Figure 14.40 Write to Synchronous DRAM (Row Hit) ............536 Figure 14.41 Single Address Mode/Burst Mode/External Bus External Device 32-Byte Block Transfer/Channel 0 On-Demand Data Transfer ........537 Figure 14.42 DDT Mode Setting................... 538 Figure 14.43 Single Address Mode/Burst Mode/Edge Detection/ External Device External Bus Data Transfer................
  • Page 28 Figure 15.10 Sample Serial Reception Flowchart (1) ............606 Figure 15.11 Example of SCI Receive Operation (Example with 8-Bit Data, Parity, One Stop Bit) ....................609 Figure 15.12 Example of Inter-Processor Communication Using Multiprocessor Format (Transmission of Data H'AA to Receiving Station A)........610 Figure 15.13 Sample Multiprocessor Serial Transmission Flowchart........
  • Page 29 Figure 17.7 Sample Initialization Flowchart ............... 695 Figure 17.8 Sample Transmission Processing Flowchart............ 697 Figure 17.9 Sample Reception Processing Flowchart ............699 Figure 17.10 Receive Data Sampling Timing in Smart Card Mode........701 Figure 17.11 Retransfer Operation in SCI Receive Mode............. 702 Figure 17.12 Retransfer Operation in SCI Transmit Mode ...........
  • Page 30 Figure 22.19 Endian Control for Local Bus ................912 Figure 22.20 Data Alignment at DMA Transfer ..............913 Figure 22.21(1) Data Alignment at Target Memory Transfer (Big-Endian Local Bus) .... 915 Figure 22.21(2) Data Alignment at Target Memory Transfer (Little-Endian Local Bus)..916 Figure 22.22 Data Alignment at Target I/O Transfer (Both Big Endian and Little Endian) .
  • Page 31 Figure 23.26 Synchronous DRAM Auto-Precharge Write Bus Cycle: Single (RCD [1:0] = 01, TPC [2:0] = 001, TRWL [2:0] = 010) ...... 981 Figure 23.27 Synchronous DRAM Auto-Precharge Write Bus Cycle: Burst (RCD [1:0] = 01, TPC [2:0] = 001, TRWL [2:0] = 010)......982 Figure 23.28 Synchronous DRAM Normal Write Bus Cycle: ACT + WRITE Commands, Burst (RCD [1:0] = 01, TRWL [2:0] = 010)............
  • Page 32 Figure 23.48 DRAM Bus Cycle: DRAM CAS-Before-RAS Refresh (TRAS [2:0] = 001, TRC [2:0] = 001) ............. 1004 Figure 23.49 DRAM Bus Cycle: DRAM Self-Refresh (TRC [2:0] = 001)......1005 Figure 23.50 PCMCIA Memory Bus Cycle (1) TED [2:0] = 000, TEH [2:0] = 000, No Wait (2) TED [2:0] = 001, TEH [2:0] = 001, One Internal Wait + One External Wait........................
  • Page 33 Figure 23.67 H-UDI Data Transfer Timing ................1021 Figure 23.68 Pin Break Timing..................... 1021 Figure 23.69 NMI Input Timing ................... 1022 Figure 23.70 PCI Clock Input Timing................... 1025 Figure 23.71 Output Signal Timing ..................1025 Figure 23.72 Output Signal Timing ..................1026 Figure 23.73 I/O Port Input/Output Timing ................
  • Page 34 State of Registers in Standby Mode ..............226 Table 10.1 CPG Pins ......................246 Table 10.2 CPG Register...................... 246 Table 10.3(1) Clock Operating Modes (SH7751)..............247 Table 10.3(2) Clock Operating Modes (SH7751R) ..............247 Table 10.4 FRQCR Settings and Internal Clock Frequencies ..........248 Table 10.5 WDT Registers....................
  • Page 35 Table 13.14 Relationship between AMXEXT and AMX2–0 Bits and Address Multiplexing 379 Table 13.15 Example of Correspondence between SH7751 Series and Synchronous DRAM Address Pins (32-Bit Bus Width, AMX2–AMX0 = 000, AMXEXT = 0) ..395 Table 13.16 Cycles in Which Pipelined Access Can Be Used ..........409 Table 13.17...
  • Page 36 Table 15.2 SCI Registers...................... 572 Table 15.3 Examples of Bit Rates and SCBRR1 Settings in Asynchronous Mode ..... 591 Table 15.4 Examples of Bit Rates and SCBRR1 Settings in Synchronous Mode....594 Table 15.5 Maximum Bit Rate for Various Frequencies with Baud Rate Generator (Asynchronous Mode)..................
  • Page 37 Table 21.3 Structure of Boundary Scan Register ..............784 Table 22.1 Pin Configuration ....................804 Table 22.2 List of PCI Configuration Registers ..............806 Table 22.3 PCI Configuration Register Configuration............807 Table 22.4 List of PCIC Local Registers................808 Table 22.5 List of CLASS23 to 16 Base Class Codes (CLASS23 to 16)......
  • Page 38 PCIC Signal Timing (With PCIREQ/PCIGNT Port Settings in Non-Host Mode) ................... 1027 Table A.1 Address List......................1031 Table C.1 Clock Operating Modes (SH7751)..............1041 Table C.2 Clock Operating Modes (SH7751R) ..............1041 Table C.3 Area 0 Memory Map and Bus Width ..............1042 Table C.4...
  • Page 39 Rev. 3.0, 04/02, page xxxviii of xxxviii...
  • Page 40: Section 1 Overview

    50% reduction in program size over a 32-bit instruction set. The SH7751 Series feature the SH-4 CPU, which at the object code level is upwardly compatible with the SH-1, SH-2, and SH-3 microcomputers. The SH7751 Series have an instruction cache, an...
  • Page 41: Figure 13.61 Mpx Interface Timing

    Table 1.1 SH7751 Series Features Item Features Operating frequency: 240 MHz* /200 MHz* /167 MHz* /133 MHz* Performance: 430 MIPS (240 MHz), 360 MIPS (200 MHz) 300 MIPS (167 MHz), 240 MIPS (133 MHz) 1.2 GFLOPS (167 MHz), 0.93 GFLOPS (133 MHz) 1.7 GFLOPS (240 MHz), 1.4 GFLOPS (200 MHz)
  • Page 42 Table 1.1 SH7751 Series Features (cont) Item Features Original Hitachi SuperH architecture 32-bit internal data bus General register file: Sixteen 32-bit general registers (and eight 32-bit shadow registers) Seven 32-bit control registers Four 32-bit system registers RISC-type instruction set (upward-compatible with SuperH Series)
  • Page 43 Table 1.1 SH7751 Series Features (cont) 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...
  • Page 44 Clock pulse Choice of main clock generator (CPG) SH7751: 1/2, 1, 3, or 6 times EXTAL SH7751R: 1, 6, or 12 times EXTAL Clock modes: (Maximum frequency: Varies with models) CPU frequency: 1, 1/2, 1/3, 1/4, 1/6, or 1/8 times main clock...
  • Page 45 [SH7751R] 16 kbytes, 2-way set associative 256 entries/way, 32-byte block length Cache-double-mode (16-kbyte cache) Index mode SH7751-compatible mode (8 kbytes, direct mapping) Operand cache (OC) 32 kbytes, 2-way set associative 512 entries/way, 32-byte block length Cache-double-mode (32-kbyte cache) Index mode...
  • Page 46 Table 1.1 SH7751 Series Features (cont) Item Features Interrupt controller Five independent external interrupts (NMI, IRL3 to IRL0) (INTC) 15-level signed external interrupts: IRL3 to IRL0 On-chip peripheral module interrupts: Priority level can be set for each module User break...
  • Page 47 Table 1.1 SH7751 Series Features (cont) Item Features Direct memory Physical address DMA controller access controller SH7751: 4-channel (DMAC) SH7751R: 8-channel Transfer data size: 8, 16, 32, or 64 bits, or 32 bytes Address modes: 1-bus-cycle single address mode 2-bus-cycle dual address mode...
  • Page 48 Table 1.1 SH7751 Series Features (cont) Item Features PCI bus controller PCI bus controller (Rev.2.1-compatible)* (PCIC) 32-bit bus 33 MHz/66 MHz support PCI master/slave support PCI host function support Built-in bus arbiter 4 built-in PCI-dedicated DMAC (direct memory access controller)
  • Page 49: Block Diagram

    Block Diagram Figure 1.1 shows an internal block diagram of the SH7751 Series. Lower 32-bit data Cache and I cache ITLB UTLB O cache controller INTC DMAC (SCIF) PCIC (PCI)DMAC BSC: Bus state controller CPG: Clock pulse generator DMAC: Direct memory access controller...
  • Page 50: Pin Arrangement

    Pin Arrangement XTAL2 EXTAL2 VDD-RTC VSS-RTC PCICLK IDSEL /MD9 /MD10 MD6/ MD2/RXD2 QFP256 TCLK MD8/ MD1/TXD2 MD0/SCK2 MD7/ (Top view) AUDSYNC AUDCK AUDATA0 AUDATA1 AUDATA2 AUDATA3 Reserved MD3/ MD4/ VDD (internal) DACK0 VSS (internal) DACK1 DRAK0 DRAK1 VDDQ (IO) STATUS0 VSSQ (IO) STATUS1 /BRKACK...
  • Page 51: Figure 1.3 Pin Arrangement (256-Pin Bga)

    BGA256 (Top view) VDDQ(IO) VSS (internal) VDD-CPG/RTC VSSQ(IO) VSS-CPG/RTC VDD-PLL1/2 VDD (internal) VSS-PLL1/2 Note: Power must be supplied to the on-chip PLL power supply pins (VDD-PLL1, VDD-PLL2, VSS-PLL1, VSS-PLL2, VDD-CPG, VSS-CPG, VDD-RTC, and VSS-RTC) regardless of whether or not the PLL circuits, crystal resonator, and RTC are used. * May be connected to V Figure 1.3 Pin Arrangement (256-Pin BGA) Rev.
  • Page 52: Pin Functions

    Pin Functions 1.4.1 Pin Functions (256-Pin QFP) Table 1.2 Pin Functions Memory Interface No. Pin Name Function Reset SRAM DRAM SDRAM PCMCIA MPX Mode (H-UDI) Clock (H-UDI) VDDQ Power IO VDD VSSQ Power IO GND Data in (H-UDI) Chip select 0 Chip select 1 Chip select 4 ...
  • Page 53 Table 1.2 Pin Functions (cont) Memory Interface No. Pin Name Function Reset SRAM DRAM SDRAM PCMCIA MPX Data Data Data VDDQ Power IO VDD VSSQ Power IO GND Data Data Data Data Data D7–D0 DQM0 DQM0 select signal D15–D8...
  • Page 54 Table 1.2 Pin Functions (cont) Memory Interface No. Pin Name Function Reset SRAM DRAM SDRAM PCMCIA MPX VSSQ Power IO GND Address Address Address Address Address Address Address Address Address Address VDDQ Power IO VDD VSSQ Power IO GND Address Address Address Address...
  • Page 55 Table 1.2 Pin Functions (cont) Memory Interface No. Pin Name Function Reset SRAM DRAM SDRAM PCMCIA MPX Data Data Data Data Data Data ACCSIZE0 VDDQ Power IO VDD VSSQ Power IO GND Data ACCSIZE1 Data ACCSIZE2 Power Internal VDD Power Internal GND Address 100 A19 Address...
  • Page 56 Table 1.2 Pin Functions (cont) Memory Interface No. Pin Name Function Reset SRAM DRAM SDRAM PCMCIA MPX Bus grant (host function) Bus request (host function) Bus request MD10 MD10 (host function)/ mode 119 VDDQ Power IO VDD 120 VSSQ Power IO GND ...
  • Page 57 Table 1.2 Pin Functions (cont) Memory Interface No. Pin Name Function Reset SRAM DRAM SDRAM PCMCIA MPX 134 AD28 PCI address/ (Port) (Port) (Port) (Port) (Port) data/port 135 AD27 PCI address/ (Port) (Port) (Port) (Port) (Port) data/port 136 AD26 PCI address/ (Port) (Port) (Port)
  • Page 58 Table 1.2 Pin Functions (cont) Memory Interface No. Pin Name Function Reset SRAM DRAM SDRAM PCMCIA MPX Device select 157 VDDQ Power IO VDD 158 VSSQ Power IO GND Transaction stop Exclusive access Parity error 162 PAR Parity 163 C/ Command/...
  • Page 59 Table 1.2 Pin Functions (cont) Memory Interface No. Pin Name Function Reset SRAM DRAM SDRAM PCMCIA MPX 179 AD5 PCI address/ (Port) (Port) (Port) (Port) (Port) data/port 180 AD4 PCI address/ (Port) (Port) (Port) (Port) (Port) data/port 181 AD3 PCI address/ (Port) (Port) (Port)
  • Page 60 Table 1.2 Pin Functions (cont) Memory Interface No. Pin Name Function Reset SRAM DRAM SDRAM PCMCIA MPX acknowledge/ bus request request/bus acknowledge 204 MD6/ Mode/ (PCMCIA) Bus ready 206 TXD SCI data output 207 VDDQ Power IO VDD 208 VSSQ...
  • Page 61 Table 1.2 Pin Functions (cont) Memory Interface No. Pin Name Function Reset SRAM DRAM SDRAM PCMCIA MPX 225 VDD Power Internal VDD 226 VSS Power Internal GND 227 AUDATA2 AUD data 228 AUDATA3 AUD data 229 Reserved Do not connect 230 MD3/...
  • Page 62 Table 1.2 Pin Functions (cont) Memory Interface No. Pin Name Function Reset SRAM DRAM SDRAM PCMCIA MPX 247 VDDQ Power IO VDD 248 VSSQ Power IO GND 249 VDD-PLL2 Power PLL2 VDD 250 VSS-PLL2 Power PLL2 GND 251 VDD-PLL1 Power PLL1 VDD 252 VSS-PLL1 Power PLL1 GND 253 VDD-CPG...
  • Page 63: Pin Functions (256-Pin Bga)

    1.4.2 Pin Functions (256-Pin BGA) Table 1.3 Pin Functions Memory Interface Number Pin Name Function Reset SRAM DRAM SDRAM PCMCIA Mode (H-UDI) Clock (H-UDI) VDDQ Power IO VDD VSSQ Power IO GND Data in (H-UDI) Chip select 0 Chip select 1 Chip select 4 Chip select 5...
  • Page 64 Table 1.3 Pin Functions (cont) Memory Interface Number Pin Name Function Reset SRAM DRAM SDRAM PCMCIA Data VDDQ Power IO VDD VSSQ Power IO GND Data Data Data Data Data D7–D0 DQM0 DQM0 select signal D15–D8 DQM1 DQM1 select signal...
  • Page 65 Table 1.3 Pin Functions (cont) Memory Interface Number Pin Name Function Reset SRAM DRAM SDRAM PCMCIA VSSQ Power IO GND Address Address Address Address Address Address Address Address Address Address VDDQ Power IO VDD VSSQ Power IO GND Address Address Address Address ...
  • Page 66 Table 1.3 Pin Functions (cont) Memory Interface Number Pin Name Function Reset SRAM DRAM SDRAM PCMCIA Data Data Data Data Data Data ACCSIZE0 VDDQ Power IO VDD VSSQ Power IO GND Data ACCSIZE1 Data ACCSIZE2 Power Internal VDD Power Internal GND Address Address Address...
  • Page 67 Table 1.3 Pin Functions (cont) Memory Interface Number Pin Name Function Reset SRAM DRAM SDRAM PCMCIA Bus grant (host function) Bus request (host function) Bus request MD10 MD10 (host function)/ mode VDDQ Power IO VDD VSSQ Power IO GND Bus request...
  • Page 68 Table 1.3 Pin Functions (cont) Memory Interface Number Pin Name Function Reset SRAM DRAM SDRAM PCMCIA AD26 PCI address/ (Port) (Port) (Port) (Port) (Port) data/port AD25 PCI address/ (Port) (Port) (Port) (Port) (Port) data/port AD24 PCI address/ (Port) (Port) (Port) (Port) (Port) data/port...
  • Page 69 Table 1.3 Pin Functions (cont) Memory Interface Number Pin Name Function Reset SRAM DRAM SDRAM PCMCIA VSSQ Power IO GND Transaction stop Exclusive access Parity error Parity Command/ byte enable AD15 PCI address/ (Port) (Port) (Port) (Port) (Port) data/port AD14...
  • Page 70 Table 1.3 Pin Functions (cont) Memory Interface Number Pin Name Function Reset SRAM DRAM SDRAM PCMCIA PCI address/ (Port) (Port) (Port) (Port) (Port) data/port PCI address/ (Port) (Port) (Port) (Port) (Port) data/port PCI address/ (Port) (Port) (Port) (Port) (Port) data/port VDDQ Power I/O VDD...
  • Page 71 Table 1.3 Pin Functions (cont) Memory Interface Number Pin Name Function Reset SRAM DRAM SDRAM PCMCIA request/bus acknowledge MD6/ Mode/ (PCMCIA) Bus ready SCI data output VDDQ Power IO VDD VSSQ Power IO GND Power Internal VDD Power Internal GND...
  • Page 72 Table 1.3 Pin Functions (cont) Memory Interface Number Pin Name Function Reset SRAM DRAM SDRAM PCMCIA AUDATA2 AUD data AUDATA3 AUD data Do not connect MD3/ Mode/ PCMCIA-CE MD4/ Mode/ PCMCIA-CE Mode VDDQ Power IO VDD VSSQ Power IO GND...
  • Page 73 Table 1.3 Pin Functions (cont) Memory Interface Number Pin Name Function Reset SRAM DRAM SDRAM PCMCIA VSS-PLL2 Power PLL2 GND VDD-PLL1 Power PLL1 VDD VSS-PLL1 Power PLL1 GND VDD-CPG Power CPG VDD VSS-CPG Power CPG GND XTAL Crystal resonator EXTAL External input clock/crystal resonator...
  • Page 74: Section 2 Programming Model

    Section 2 Programming Model Data Formats The data formats handled by the SH7751 Series are shown in figure 2.1. Byte (8 bits) Word (16 bits) Longword (32 bits) 31 30 Single-precision floating-point (32 bits) fraction 63 62 Double-precision floating-point (64 bits) fraction Figure 2.1 Data Formats...
  • Page 75: Register Configuration

    Processor Modes: The SH7751 Series has two processor modes, user mode and privileged mode. The SH7751 Series normally operates in user mode, and switches to privileged mode when an exception occurs or an interrupt is accepted. There are four kinds of registers—general registers, system registers, control registers, and floating-point registers—and the registers that can be...
  • Page 76: Table 2.1 Initial Register Values

    Floating-Point Registers: 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– XF15 can be used as the eight registers XD0/2/4/6/8/10/12/14 (register pairs) or register matrix XMTRX.
  • Page 77: Figure 2.2 Cpu Register Configuration In Each Processor Mode

    R0 _ BANK0* R0 _ BANK1* R0 _ BANK0* R1 _ BANK0* R1 _ BANK0* R1 _ BANK1* R2 _ BANK0* R2 _ BANK1* R2 _ BANK0* R3 _ BANK0* R3 _ BANK1* R3 _ BANK0* R4 _ BANK0* R4 _ BANK0* R4 _ BANK1* R5 _ BANK0* R5 _ BANK1*...
  • Page 78: General Registers

    R7_BANK1, and R8–R15). However, only 16 of these can be accessed as general registers R0– R15 in one processor mode. The SH7751 Series has two processor modes, user mode and privileged mode, in which R0–R7 are assigned as shown below.
  • Page 79: Figure 2.3 General Registers

    SR.MD = 0 or (SR.MD = 1, SR.RB = 0) (SR.MD = 1, SR.RB = 1) R0_BANK0 R0_BANK0 R1_BANK0 R1_BANK0 R2_BANK0 R2_BANK0 R3_BANK0 R3_BANK0 R4_BANK0 R4_BANK0 R5_BANK0 R5_BANK0 R6_BANK0 R6_BANK0 R7_BANK0 R7_BANK0 R0_BANK1 R0_BANK1 R1_BANK1 R1_BANK1 R2_BANK1 R2_BANK1 R3_BANK1 R3_BANK1 R4_BANK1 R4_BANK1 R5_BANK1...
  • Page 80: Floating-Point Registers

    2.2.3 Floating-Point Registers Figure 2.4 shows the floating-point registers. There are thirty-two 32-bit floating-point registers, divided into two banks (FPR0_BANK0–FPR15_BANK0 and FPR0_BANK1–FPR15_BANK1). These 32 registers are referenced as FR0–FR15, DR0/2/4/6/8/10/12/14, FV0/4/8/12, XF0–XF15, XD0/2/4/6/8/10/12/14, or XMTRX. The correspondence between FPRn_BANKi and the reference name is determined by the FR bit in FPSCR (see figure 2.4).
  • Page 81: Figure 2.4 Floating-Point Registers

    Single-precision floating-point extended register matrix, XMTRX: XMTRX comprises all 16 XF registers XMTRX = XF12 XF13 XF10 XF14 XF11 XF15 FPSCR.FR = 0 FPSCR.FR = 1 FPR0_BANK0 XMTRX FPR1_BANK0 FPR2_BANK0 FPR3_BANK0 FPR4_BANK0 FPR5_BANK0 FPR6_BANK0 FPR7_BANK0 FPR8_BANK0 FPR9_BANK0 FPR10_BANK0 DR10 FR10 XF10 XD10 FPR11_BANK0...
  • Page 82: Control Registers

    Programming Note: After a reset, the values of FPR0_BANK0–FPR15_BANK0 and FPR0_BANK1–FPR15_BANK1 are undefined. 2.2.4 Control Registers Status register, SR (32 bits, privilege protection, initial value = 0111 0000 0000 0000 0000 00XX 1111 00XX (X = undefined)) 31 30 29 28 27 16 15 14 —...
  • Page 83: System Registers

    Saved status register, SSR (32 bits, privilege protection, initial value undefined): The current contents of SR are saved to SSR in the event of an exception or interrupt. Saved program counter, SPC (32 bits, privilege protection, initial value undefined): The address of an instruction at which an interrupt or exception occurs is saved to SPC.
  • Page 84 Floating-point status/control register, FPSCR (32 bits, initial value = H'0004 0001) 22 21 20 19 18 17 12 11 — FR SZ PR DN Cause Enable Flag Note: —: Reserved. These bits are always read as 0, and should only be written with 0. FR: Floating-point register bank FR = 0: FPR0_BANK0–FPR15_BANK0 are assigned to FR0–FR15;...
  • Page 85: Memory-Mapped Registers

    When an FPU operation instruction is executed, the FPU exception cause field is cleared to zero first. When the next FPU exception is occured, the corresponding bits in the FPU exception cause field and FPU exception flag field are set to 1. The FPU exception flag field holds the status of the exception generated after the field was last cleared.
  • Page 86: Data Format In Registers

    Data Format 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. Longword Data Formats in Memory Memory data formats are classified into bytes, words, and longwords.
  • Page 87: Processor States

    Note: The SH7751 Series does not support endian conversion for the 64-bit data format. Therefore, if double-precision floating-point format (64-bit) access is performed in little endian mode, the upper and lower 32 bits will be reversed. Processor States The SH7751 Series has five processor states: the reset state, exception-handling state, bus-released state, program execution state, and power-down state.
  • Page 88: Processor Modes

    From any state when From any state when RESET = 0 RESET = 1 and MRESET = 0 Power-on reset state Manual reset state RESET = 0 Reset state RESET = 1 RESET = 1, MRESET = 1 Exception-handling state Bus request Bus request clearance...
  • Page 89 Rev. 3.0, 04/02, page 50 of 1064...
  • Page 90: Memory Management Unit (Mmu)

    (translation lookaside buffer: TLB). The SH7751 Series has four instruction TLB (ITLB) entries and 64 unified TLB (UTLB) entries. UTLB copies are stored in the ITLB by hardware. A paging system is used for address translation, with support for four page sizes (1, 4, and 64 kbytes, and 1 Mbyte).
  • Page 91 (usually from 1 to 64 kbytes in size). In the following descriptions, the address space in virtual memory in the SH7751 Series is referred to as virtual address space, and the address space in physical memory as physical address space.
  • Page 92: Figure 3.1 Role Of The Mmu

    Virtual memory Physical Process 1 memory Physical 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 3.1 Role of the MMU Rev. 3.0, 04/02, page 53 of 1064...
  • Page 93: Register Configuration

    3.1.3 Register Configuration The MMU registers are shown in table 3.1. Table 3.1 MMU Registers Abbrevia- Initial Area 7 Access Name tion Value* Address* Address* Size Page table entry high PTEH Undefined H'FF00 0000 H'1F00 0000 32 register Page table entry low PTEL Undefined H'FF00 0004 H'1F00 0004 32...
  • Page 94: Register Descriptions

    Register Descriptions There are six MMU-related registers. 1. PTEH 10 9 — — ASID 2. PTEL 31 30 29 28 10 9 — — — — V SZ SZ C D SH WT 3. PTEA 4. TTB 5. TEA Virtual address at which MMU exception or address error occurred 6.
  • Page 95 1. Page table entry high register (PTEH): Longword access to PTEH can be performed from H'FF00 0000 in the P4 area and H'1F00 0000 in area 7. 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 field by hardware.
  • Page 96 Longword access to MMUCR can be performed from H'FF00 0010 in the P4 area and H'1F00 0010 in area 7. 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 is updated, an instruction that performs data access to the P0, P3, U0, or store queue area should be located at least four instructions after the MMUCR update instruction.
  • Page 97: Address Space

    3.3.1 Physical Address Space The SH7751 Series supports a 32-bit physical address space, and can access a 4-Gbyte address space. When the MMUCR.AT bit is cleared to 0 and the MMU is disabled, the address space is this physical address space. The physical address space is divided into a number of areas, as shown in figure 3.3.
  • Page 98: Figure 3.3 Physical Address Space (Mmucr.at = 0)

    P4 Area: The P4 area is mapped onto SH7751 Series on-chip I/O channels. This area cannot be accessed using the cache. The P4 area is shown in detail in figure 3.4.
  • Page 99: Figure 3.4 P4 Area

    H'E000 0000 Store queue H'E400 0000 Reserved area H'F000 0000 Instruction cache address array H'F100 0000 Instruction cache data array H'F200 0000 Instruction TLB address array H'F300 0000 Instruction TLB data arrays 1 and 2 H'F400 0000 Operand cache address array H'F500 0000 Operand cache data array H'F600 0000...
  • Page 100: External Memory Space

    3.3.2 External Memory Space The SH7751 Series supports a 29-bit external memory space. The external memory space is divided into eight areas as shown in figure 3.5. Areas 0 to 6 relate to memory, such as SRAM, synchronous DRAM, DRAM, and PCMCIA. Area 7 is a reserved area. For details, see section 13, Bus State Controller (BSC).
  • Page 101: Virtual Address Space

    Setting the MMUCR.AT bit to 1 enables the P0, P3, and U0 areas of the physical address space in the SH7751 Series to be mapped onto any external memory space in 1-, 4-, or 64-kbyte, or 1- Mbyte, page units. By using an 8-bit address space identifier, the P0, U0, P3, and store queue areas can be increased to a maximum of 256.
  • Page 102: On-Chip Ram Space

    3.3.4 On-Chip RAM Space In the SH7751 Series, half of the operand cache can be used as on-chip RAM. This can be done by changing the CCR settings. When the operand cache is used as on-chip RAM (CCR.ORA = 1), P0, U0 area addresses H'7C00 0000 to H'7FFF FFFF are an on-chip RAM area.
  • Page 103: Single Virtual Memory Mode And Multiple Virtual Memory Mode

    Notes: (1) In single virtual memory mode of the SH7751 Series, entries with the same virtual page number (VPN) but different ASIDs cannot be set in the TLB simultaneously.
  • Page 104: Tlb Functions

    UTLB with a different ASID and unshared address translation information. Note that this restriction does not apply to the SH7751R. TLB Functions 3.4.1 Unified TLB (UTLB) Configuration The unified TLB (UTLB) is so called because of its use for the following two purposes: 1.
  • Page 105: Figure 3.8 Relationship Between Page Size And Address Format

    • 1-kbyte page Virtual address Physical address 10 9 10 9 Offset Offset • 4-kbyte page Virtual address Physical address 12 11 12 11 Offset Offset • 64-kbyte page Virtual address Physical address 16 15 16 15 Offset Offset • 1-Mbyte page Virtual address Physical address 20 19...
  • Page 106 SZ: Page size bits Specify the page size. 00: 1-kbyte page 01: 4-kbyte page 10: 64-kbyte page 11: 1-Mbyte page V: Validity bit Indicates whether the entry is valid. 0: Invalid 1: Valid Cleared to 0 by a power-on reset. Not affected by a manual reset.
  • Page 107 D: Dirty bit Indicates whether a write has been performed to a page. 0: Write has not been performed 1: Write has been performed WT: Write-through bit Specifies the cache write mode. 0: Copy-back mode 1: Write-through mode When performing PCMCIA space mapping in the cache enabled state, either set this bit to 1 or clear the C bit to 0.
  • Page 108: Instruction Tlb (Itlb) Configuration

    3.4.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 3.9 shows the overall configuration of the ITLB. The ITLB consists of 4 fully-associative type entries.
  • Page 109: Figure 3.10 Flowchart Of Memory Access Using 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 On-chip I/O access CCR.OCE? MMUCR.AT = 1 CCR.CB? CCR.WT? SH = 0 and (MMUCR.SV = 0 or SR.MD = 0) VPNs match...
  • Page 110: Figure 3.11 Flowchart Of Memory Access Using Itlb

    Instruction 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 Access prohibited CCR.ICE? MMUCR.AT = 1 SH = 0 and (MMUCR.SV = 0 or SR.MD = 0) VPNs match VPNs match...
  • Page 111: Mmu Functions

    A TLB load instruction (LDTLB) is provided for recording UTLB entries. When an LDTLB instruction is issued, the SH7751 Series copies the contents of PTEH, PTEL, and PTEA to the UTLB entry indicated by MMUCR.URC. ITLB entries are not updated by the LDTLB instruction, and therefore address translation information purged from the UTLB entry may still remain in the ITLB entry.
  • Page 112: Hardware Itlb Miss Handling

    3.5.4 Hardware ITLB Miss Handling In an instruction access, the SH7751 Series searches the ITLB. If it cannot find the necessary address translation information (i.e. in the event of an ITLB miss), the UTLB is searched by hardware, and if the necessary address translation information is present, it is recorded in the ITLB.
  • Page 113: Avoiding Synonym Problems

    This problem does not occur with the instruction TLB or instruction cache. In the SH7751 Series, entry specification is performed using bits [13:5] of the virtual address in order to achieve fast operand cache operation. However, bits [13:10] of the virtual address in the case of a 1-kbyte page, and bits [13:12] of the virtual address in the case of a 4- kbyte page, are subject to address translation.
  • Page 114: Mmu Exceptions

    MMU Exceptions There are seven MMU exceptions: the 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.
  • Page 115: Instruction Tlb Protection Violation Exception

    Hardware Processing: In the event of an instruction TLB miss exception, hardware carries out the following processing: 1. Sets the VPN of the virtual address at which the exception occurred in PTEH. 2. Sets the virtual address at which the exception occurred in TEA. 3.
  • Page 116: Data Tlb Multiple Hit Exception

    Hardware Processing: In the event of an instruction TLB protection violation exception, hardware carries out the following processing: 1. Sets the VPN of the virtual address at which the exception occurred in PTEH. 2. Sets the virtual address at which the exception occurred in TEA. 3.
  • Page 117: Data Tlb Miss Exception

    3.6.5 Data TLB Miss Exception A data TLB miss exception occurs when address translation information for the virtual address to which a data access is made is not found in the UTLB entries. The data TLB miss exception processing carried out by hardware and software is shown below. Hardware Processing: In the event of a data TLB miss exception, hardware carries out the following processing: 1.
  • Page 118: Data Tlb Protection Violation Exception

    3.6.6 Data TLB Protection Violation Exception A data TLB protection violation exception occurs when, even though a UTLB entry contains address translation information matching the virtual address to which a data access is made, the actual access type is not permitted by the access right specified by the PR bit. The data TLB protection violation exception processing carried out by hardware and software is shown below.
  • Page 119: Memory-Mapped Tlb Configuration

    3. Sets exception code H'080 in EXPEVT. 4. Sets the PC value indicating the address of the instruction at which the exception occurred in SPC. If the exception occurred at a delay slot, sets the PC value indicating the address of the delayed branch instruction in SPC.
  • Page 120: Itlb Address Array

    performed in these areas. For reserved bits, a write value of 0 should be specified; their read value is undefined. 3.7.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).
  • Page 121: Itlb Data Array 1

    3.7.2 ITLB Data Array 1 ITLB data array 1 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). Information for selecting the entry to be accessed is specified in the address field, and PPN, V, SZ, PR, C, and SH to be written to the data array are specified in the data field.
  • Page 122: Itlb Data Array 2

    3.7.3 ITLB Data Array 2 ITLB data array 2 is allocated to addresses H'F380 0000 to H'F3FF 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). Information for selecting the entry to be accessed is specified in the address field, and SA and TC to be written to data array 2 are specified in the data field.
  • Page 123: Figure 3.16 Memory-Mapped Utlb Address Array

    In the address field, bits [31:24] have the value H'F6 indicating the UTLB address array, and the entry is selected by bits [13:8]. The address array bit [7] association bit (A bit) specifies whether or not address comparison is performed when writing to the UTLB address array. In the data field, VPN is indicated by bits [31:10], D by bit [9], V by bit [8], and ASID by bits [7:0].
  • Page 124: Utlb Data Array 1

    3.7.5 UTLB Data Array 1 UTLB data array 1 is allocated to addresses H'F700 0000 to H'F77F 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). Information for selecting the entry to be accessed is specified in the address field, and PPN, V, SZ, PR, C, D, SH, and WT to be written to the data array are specified in the data field.
  • Page 125: Utlb Data Array 2

    3.7.6 UTLB Data Array 2 UTLB data array 2 is allocated to addresses H'F780 0000 to H'F7FF 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). Information for selecting the entry to be accessed is specified in the address field, and SA and TC to be written to data array 2 are specified in the data field.
  • Page 126: Section 4 Caches

    RAM. When the EMODE bit in the CCR register is cleared to 0 in the SH7751R, both the IC and OC are set to SH7751 compatible mode. Operation is as shown in table 4.1. When the EMODE bit in the CCR register is set to 1, the cache characteristics are as shown in table 4.2.
  • Page 127: Register Configuration

    Table 4.2 Cache Features (SH7751R) Item Instruction Cache Operand Cache Capacity 16-kbyte cache 32-kbyte cache or 16-kbyte cache + 16-kbyte RAM Type 2-way set-associative 2-way set-associative Line size 32 bytes 32 bytes Entries 256 entry/way 512 entry/way Write method Copy-back/write-through selectable Replace method LRU (Least Recently Used) LRU (Least Recently Used)
  • Page 128: Register Descriptions

    0 must be specified in a write; the read value is 0. Figure 4.1 Cache and Store Queue Control Registers (CCR) (1) Cache Control Register (CCR): CCR contains the following bits: EMODE: Cache-double-mode (SH7751R only. Reserved bit in SH7751.) IIX: IC index enable...
  • Page 129 EMODE: Cache-double-mode bit Indicates whether or not cache-double-mode is used in the SH7751R. This bit is reserved in the SH7751. The EMODE bit cannot be modified while the cache is in use. 0: SH7751-compatible-mode (Initial value) 1: Cache-double-mode Note: *1 Address allocation in OC index mode and RAM mode is not compatible with that in RAM mode.
  • Page 130: Operand Cache (Oc)

    4.3.1 Configuration The operand cache in the SH7751 adopts the direct-mapping method, and consists of 512 cache lines. Each cache line is composed of a 19-bit tag, V bit, U bit, and 32-byte data. The operand cache in the SH7751R adopts the 2-way set-associative method, and each way consists of 512 cache lines.
  • Page 131: Figure 4.2 Configuration Of Operand Cache (Sh7751)

    1 bit 1 bit 32 bits 32 bits 32 bits 32 bits 32 bits 32 bits 32 bits 32 bits Compare Write data Read data Hit signal Figure 4.2 Configuration of Operand Cache (SH7751) Rev. 3.0, 04/02, page 92 of 1064...
  • Page 132: Figure 4.3 Configuration Of Operand Cache (Sh7751R)

    Effective address 26 25 13 12 RAM area Longword (LW) determination selection [12:5] [13] Entry selection Address array Data array (way 0, way 1) (way 0, way 1) 19 bits 1 bit 1 bit 32 bits 32 bits 32 bits 32 bits 32 bits 32 bits...
  • Page 133: Read Operation

    The U bit is never set to 1 while the cache is being used in write- through mode, unless it is modified by accessing the memory-mapped cache (see section 4.5, Memory-Mapped Cache Configuration (SH7751) and 4.6, Memory-Mapped Cache Configuration (SH7751R)). The U bit is initialized to 0 by a power-on reset, but retains its value in a manual reset.
  • Page 134: Write Operation

    3b. Cache miss (no write-back) Data is read into the cache line from the external memory space corresponding to the effective address. Data reading is performed, using the wraparound method, in order from the longword data corresponding to the effective address, and when the corresponding data arrives in the cache, the read data is returned to the CPU.
  • Page 135 3b. Cache hit (write-through) A data write in accordance with the access size (quadword/longword/word/byte) is performed for the data field of the cache line indexed by effective address bits [13:5] and for the data indexed by effective address bits [4:0]. A write is also performed to the corresponding external memory using the specified access size.
  • Page 136: Write-Back Buffer

    Setting CCR.ORA to 1 enables 8 kbytes of the operand cache to be used as RAM. The operand cache entries used as RAM are the 8 kbytes of entries 128 to 255 and 384 to 511. In SH7751- compatible-mode in the SH7751R, the 8 kbytes of operand cache entries 256 to 511 are used as RAM.
  • Page 137 H'7DFF F000 to H'7E00 0FFF should be used to secure a continuous 8-kbyte RAM area. An example of RAM use in the SH7751R is shown below. SH7751-compatible-mode (CCR.EMODE = 0) H'7C00 0000 to H'7C00 1FFF (8 kB): Corresponds to RAM area (entries 256 to 511) H'7C00 2000 to H'7C00 3FFF (8 kB): Corresponds to RAM area (entries 256 to 511) A shadow of the RAM area occurs every 8 kbytes up to H'7FFF FFFF.
  • Page 138: Oc Index Mode

    Prefetch Operation The SH7751 Series supports a prefetch instruction to reduce the cache fill penalty incurred as the result of a cache miss. If it is known that a cache miss will result from a read or write operation, it is possible to fill the cache with data beforehand by means of the prefetch instruction to prevent a cache miss due to the read or write operation, and so improve software performance.
  • Page 139: Figure 4.6 Configuration Of Instruction Cache (Sh7751)

    Figure 4.6 shows the configuration of the instruction cache in the SH7751. Figure 4.7 shows the configuration of the instruction cache in the SH7751R. Effective address 26 25 13 12 11 10 9 5 4 3 2 1 [11:5] [12]...
  • Page 140: Figure 4.7 Configuration Of Instruction Cache (Sh7751R)

    Effective address 13 12 11 10 Longword (LW) selection [11:5] [12] Entry selection Address array (way 0, way 1) Data array (way 0, way 1) 19 bits 1 bit 32 bits 32 bits 32 bits 32 bits 32 bits 32 bits 32 bits 32 bits 1 bit...
  • Page 141: Read Operation

    LRU (SH7751R only) In a 2-way set-associative system, up to two entry addresses (among addresses 12 to 15) can register the same data in cache. The LRU bit indicates to which way the entry is to be registered among the two ways. There is one LRU bit in each entry, and it is controlled by hardware.
  • Page 142: Memory-Mapped Cache Configuration (Sh7751)

    Memory-Mapped Cache Configuration (SH7751) To enable the IC and OC to be managed by software, the IC contents can be read and written by a P2 area program with a MOV instruction in privileged mode. Operation is not guaranteed if access is made from a program in another area.
  • Page 143: Ic Data Array

    MMU is enabled at this time, comparison is performed after the virtual address specified by data field bits [31:10] has been translated to a physical address using the ITLB. If the addresses match and the V bit is 1, the V bit specified in the data field is written into the IC entry. In other cases, no operation is performed.
  • Page 144: Oc Address Array

    2. IC data array write The longword data specified in the data field is written for the data specified by the longword specification bits in the address field in the IC entry corresponding to the entry set in the address field. 2 1 0 Address field 1 1 1 1 0 0 0 1...
  • Page 145: Oc Data Array

    the entry set in the address field. The A bit in the address field should be cleared to 0. When a write is performed to a cache line for which the U bit and V bit are both 1, after write- back of that cache line, the tag, U bit, and V bit specified in the data field are written.
  • Page 146: Memory-Mapped Cache Configuration (Sh7751R)

    Instruction fetches cannot be performed in these areas. For reserved bits, a write value of 0 should be specified, and read values are undefined. Note that the memory-mapped cache configuration in SH7751-compatible-mode of the SH7751R is the same as that in the SH7751. Rev. 3.0, 04/02, page 107 of 1064...
  • Page 147: Ic Address Array

    4.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. The way and entry to be accessed are specified in the address field, and the write tag and V bit are specified in the data field.
  • Page 148: Ic Data Array

    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 (0 write value, undefined read value) Figure 4.12 Memory-Mapped IC Address Array 4.6.2 IC Data Array The IC data array is allocated to addresses H'F100 0000 to H'F1FF FFFF in the P4 area.
  • Page 149: Oc Address Array

    2 1 0 Address field 1 1 1 1 0 0 0 1 Entry Data field Longword data : Longword specification bits : Reserved bits (0 write value, undefined read value) Figure 4.13 Memory-Mapped IC Data Array 4.6.3 OC Address Array The OC address array is allocated to addresses H'F400 0000 to H'F4FF FFFF in the P4 area.
  • Page 150: Oc Data Array

    3. OC address array write (associative) When a write is performed with the A bit in the address field set to 1, each way’s tag stored in the entry specified in the address field is compared with the tag specified in the data field. The way number set in bit [14] is ignored.
  • Page 151: Summary Of Memory-Mapped Oc Addresses

    The following two kinds of operation can be used on the OC data array: 1. OC data array read Longword data is read into the data field from the data specified by the longword specification bits in the address field in the OC entry corresponding to the way and entry set in the address field.
  • Page 152: Store Queues

    Store Queues Two 32-byte store queues (SQs) are supported to perform high-speed writes to external memory. When not using the SQs, the low power dissipation power-down modes, in which SQ functions are stopped, can be used. The queue address control registers (QACR0 and QACR1) cannot be accessed while SQ functions are stopped.
  • Page 153 External address bits [4:0] are always fixed at 0 since burst transfer starts at a 32-byte boundary. In the SH7751 Series, data transfer to a PCMCIA interface area is always performed using the SA and TC bits in the PTEA register.
  • Page 154: Determination Of Sq Access Exception

    If an exception occurs in an SQ write, the SQ contents may be corrupted in the SH7751 (see section 4.7.6, SQ Usage Notes), but the previous values of the SQ contents are guaranteed in the SH7751R. If an exception occurs in transfer from an SQ to external memory, the transfer to external memory will be aborted.
  • Page 155: Sq Usage Notes

    If an exception occurs within the three instructions preceding an instruction that writes to an SQ in the SH7751, a branch may be made to the exception handling routine after execution of the SQ write that should be suppressed when an exception occurs.
  • Page 156 Example 3: When an instruction at which an exception occurs is a branch instruction but a branch is not made Instruction 1 (branch instruction) ; Address of this instruction is saved to SPC when exception occurs. Instruction 2 ; May be executed if an SQ store instruction. Instruction 3 ;...
  • Page 157 Rev. 3.0, 04/02, page 118 of 1064...
  • Page 158: Section 5 Exceptions

    SH7751 Series exception handling is of three kinds: for resets, general exceptions, and interrupts. 5.1.2 Register Configuration The registers used in exception handling are shown in table 5.1.
  • Page 159: Register Descriptions

    Register Descriptions There are three registers related to exception handling. Addresses are allocated for these, and can be accessed by specifying the P4 address or area 7 address. 1. The exception event register (EXPEVT) resides at P4 address H'FF00 0024, and contains a 12- bit exception code.
  • Page 160: Exception Handling Functions

    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 register 15 (SGR), and the CPU starts execution of the appropriate exception handling routine according to the vector address.
  • Page 161: Exception Types And Priorities

    Exception Types and Priorities Table 5.2 shows the types of exceptions, with their relative priorities, vector addresses, and exception/interrupt codes. Table 5.2 Exceptions Exception Execution Priority Priority Vector Exception Category Mode Exception Level Order Address Offset Code Reset Abort type Power-on reset H'A000 0000 —...
  • Page 162 Table 5.2 Exceptions (cont) Exception Execution Priority Priority Vector Exception Category Mode Exception Level Order Address Offset Code Interrupt Completion Nonmaskable interrupt — (VBR) H'600 H'1C0 type External IRL3–IRL0 (VBR) H'600 H'200 interrupts H'220 H'240 H'260 H'280 H'2A0 H'2C0 H'2E0 H'300 H'320 H'340...
  • Page 163 Table 5.2 Exceptions (cont) Exception Execution Priority Priority Vector Exception Category Mode Exception Level Order Address Offset Code Interrupt Completion Peripheral H-UDI H-UDI (VBR) H'600 H'600 type module GPIO GPIOI H'620 interrupt DMAC DMTE0 H'640 (module/ source) DMTE1 H'660 DMTE2 H'680 DMTE3 H'6A0...
  • Page 164: Exception Flow

    Exception Flow 5.5.1 Exception Flow Figure 5.2 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.2 shows the relative priority order of the different kinds of exceptions (reset/general exception/interrupt).
  • Page 165: Exception Source Acceptance

    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—the 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.
  • Page 166: Figure 5.3 Example Of General Exception Acceptance Order

    Pipeline flow: TLB miss (data access) Instruction n Instruction n+1 General illegal instruction exception TLB miss (instruction access) Instruction n+2 Instruction fetch ID: Instruction decode EX: Instruction execution Instruction n+3 MA: Memory access WB: Write-back Order of detection: General illegal instruction exception (instruction n+1) and TLB miss (instruction n+2) are detected simultaneously TLB miss (instruction n) Order of exception handling:...
  • Page 167: Exception Requests And Bl Bit

    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 post-reset state, and the CPU branches to the same address as in a reset (H'A000 0000).
  • Page 168: Resets

    5.6.1 Resets (1) Power-On Reset Sources: pin low level When the watchdog timer overflows while the WT/ bit is set to 1 and the RSTS bit is cleared to 0 in WTCSR. For details, see section 10, Clock Oscillation Circuits. Transition address: H'A000 0000 Transition operations: Exception code H'000 is set in EXPEVT, initialization of VBR and SR is performed, and a...
  • Page 169: Table 5.3 Types Of Reset

    (2) Manual Reset Sources: pin low level and pin high level When a general exception other than a user break occurs while the BL bit is set to 1 in SR When the watchdog timer overflows while the RSTS bit is set to 1 in WTCSR. For details, see section 10, Clock Oscillation Circuits.
  • Page 170 (3) H-UDI Reset Source: SDIR.TI3–TI0 = B'0110 (negation) or B'0111 (assertion) Transition address: H'A000 0000 Transition operations: Exception code H'000 is set in EXPEVT, initialization of VBR and SR is performed, and a branch is made to PC = H'A000 0000. In the initialization processing, the VBR register is set to H'0000 0000, and in SR, the MD, RB, and BL bits are set to 1, the FD bit is cleared to 0, and the interrupt mask bits (I3–I0) are set to B'1111.
  • Page 171 (4) Instruction TLB Multiple-Hit Exception Source: Multiple ITLB address matches Transition address: H'A000 0000 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.
  • Page 172 (5) Data TLB Multiple-Hit Exception Source: Multiple UTLB address matches Transition address: H'A000 0000 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.
  • Page 173: General Exceptions

    5.6.2 General Exceptions (1) Data TLB Miss Exception Source: Address mismatch in UTLB address comparison Transition address: VBR + H'0000 0400 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.
  • Page 174 (2) Instruction TLB Miss Exception Source: Address mismatch in ITLB address comparison Transition address: VBR + H'0000 0400 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.
  • Page 175 (3) Initial Page Write Exception Source: TLB is hit in a store access, but dirty bit D = 0 Transition address: VBR + H'0000 0100 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 176 (4) 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 Read/write access possible...
  • Page 177 (5) 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'0000 0100 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 178 (6) 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) Quadword data access from other than a quadword data boundary (8n +1, 8n + 2, 8n +3, 8n + 4, 8n + 5, 8n + 6, or 8n + 7) Access to area H'8000 0000–H'FFFF FFFF in user mode Transition address: VBR + H'0000 0100...
  • Page 179 (7) Instruction Address Error Sources: Instruction fetch from other than a word boundary (2n +1) Instruction fetch from area H'8000 0000–H'FFFF FFFF in user mode Transition address: VBR + H'0000 0100 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 180 (8) Unconditional Trap Source: Execution of TRAPA instruction Transition address: VBR + H'0000 0100 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 181 (9) 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 Transition address: VBR + H'0000 0100...
  • Page 182 (10) 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 Decoding in user mode of a privileged instruction in a delay slot...
  • Page 183 (11) General FPU Disable Exception Source: Decoding of an FPU instruction* not in a delay slot with SR.FD =1 Transition address: VBR + H'0000 0100 Transition operations: The PC and SR contents for the instruction at which this exception occurred are saved in SPC and SSR.
  • Page 184 (12) Slot FPU Disable Exception Source: Decoding of an FPU instruction in a delay slot with SR.FD =1 Transition address: VBR + H'0000 0100 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 185 (13) User Breakpoint Trap Source: Fulfilling of a break condition set in the user break controller Transition address: VBR + H'0000 0100, 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 186 (14) FPU Exception Source: Exception due to execution of a floating-point operation Transition address: VBR + H'0000 0100 Transition operations: The PC and SR contents for the instruction at which this exception occurred are saved in SPC and SSR . The R15 contents at this time are saved in SGR. Exception code H'120 is set in EXPEVT.
  • Page 187: Interrupts

    5.6.3 Interrupts (1) NMI Source: NMI pin edge detection Transition address: VBR + H'0000 0600 Transition operations: The PC and SR contents for the instruction at which 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.
  • Page 188 (2) IRL Interrupts Source: The interrupt mask bit setting in SR is smaller than the IRL (3–0) level, and the BL bit in SR is 0 (accepted at instruction boundary). Transition address: VBR + H'0000 0600 Transition operations: The PC contents immediately after the instruction at which the interrupt is accepted are set in SPC.
  • Page 189 (3) Peripheral Module Interrupts Source: The interrupt mask bit setting in SR is smaller than the peripheral module (H-UDI, GPIO, DMAC, PCIC, TMU, RTC, SCI, SCIF, WDT, or REF) interrupt level, and the BL bit in SR is 0 (accepted at instruction boundary). Transition address: VBR + H'0000 0600 Transition operations: The PC contents immediately after the instruction at which the interrupt is accepted are set in...
  • Page 190: Priority Order With Multiple Exceptions

    5.6.4 Priority Order with Multiple Exceptions With some instructions, such as instructions that make two accesses to memory, and the indivisible pair comprising a delayed branch instruction and delay slot instruction, multiple exceptions occur. Care is required in these cases, as the exception priority order differs from the normal order.
  • Page 191: Usage Notes

    If the accepted exception (the highest-priority exception) is a delay slot instruction re- execution type exception, the branch instruction PR register write operation (PC operation performed in BSR, BSRF, JSR) is not inhibited. Usage Notes 1. Return from exception handling a.
  • Page 192: Restrictions

    Restrictions 1. Restrictions on first instruction of exception handling routine Do not locate a BT, BF, BT/S, BF/S, BRA, or BSR instruction at address VBR + H'100, VBR + H'400, or VBR + H'600. When the UBDE bit in the BRCR register is set to 1 and the user break debug support function* is used, do not locate a BT, BF, BT/S, BF/S, BRA, or BSR instruction at the address indicated by the DBR register.
  • Page 193 Rev. 3.0, 04/02, page 154 of 1064...
  • Page 194: Section 6 Floating-Point Unit

    A floating-point number consists of the following three fields: Sign (s) Exponent (e) Fraction (f) The SH7751 Series can handle single-precision and double-precision floating-point numbers, using the formats shown in figures 6.1 and 6.2. 23 22 Figure 6.1 Format of Single-Precision Floating-Point Number...
  • Page 195: Figure 6.2 Format Of Double-Precision Floating-Point Number

    52 51 Figure 6.2 Format of Double-Precision Floating-Point Number The exponent is expressed in biased form, as follows: e = E + bias The range of unbiased exponent E is E – 1 to E + 1. The two values E –...
  • Page 196: Non-Numbers (Nan)

    Table 6.2 Floating-Point Ranges Type Single-Precision Double-Precision Signaling non-number H'7FFFFFFF to H'7FC00000 H'7FFFFFFF FFFFFFFF to H'7FF80000 00000000 Quiet non-number H'7FBFFFFF to H'7F800001 H'7FF7FFFF FFFFFFFF to H'7FF00000 00000001 Positive infinity H'7F800000 H'7FF00000 00000000 Positive normalized H'7F7FFFFF to H'00800000 H'7FEFFFFF FFFFFFFF to number H'00100000 00000000 Positive denormalized...
  • Page 197: Denormalized Numbers

    EN.V bit in the FPSCR register. An exception will not be generated in this case. The qNAN values generated by the SH7751 Series as operation results are as follows: Single-precision qNaN: H'7FBFFFFF...
  • Page 198: Registers

    Registers 6.3.1 Floating-Point Registers Figure 6.4 shows the floating-point register configuration. There are thirty-two 32-bit floating- point registers, referenced by specifying FR0–FR15, DR0/2/4/6/8/10/12/14, FV0/4/8/12, XF0– XF15, XD0/2/4/6/8/10/12/14, or XMTRX. 1. Floating-point registers, FPRi_BANKj (32 registers) FPR0_BANK0–FPR15_BANK0 FPR0_BANK1–FPR15_BANK1 2. Single-precision floating-point registers, FRi (16 registers) When FPSCR.FR = 0, FR0–FR15 indicate FPR0_BANK0–FPR15_BANK0;...
  • Page 199: Figure 6.4 Floating-Point Registers

    FPSCR.FR = 0 FPSCR.FR = 1 FPR0_BANK0 XMTRX FPR1_BANK0 FPR2_BANK0 FPR3_BANK0 FPR4_BANK0 FPR5_BANK0 FPR6_BANK0 FPR7_BANK0 FPR8_BANK0 FPR9_BANK0 FPR10_BANK0 DR10 FR10 XF10 XD10 FPR11_BANK0 FR11 XF11 FPR12_BANK0 FV12 DR12 FR12 XF12 XD12 FPR13_BANK0 FR13 XF13 FPR14_BANK0 DR14 FR14 XF14 XD14 FPR15_BANK0 FR15 XF15 FPR0_BANK1...
  • Page 200: Floating-Point Status/Control Register (Fpscr)

    6.3.2 Floating-Point Status/Control Register (FPSCR) Floating-point status/control register, FPSCR (32 bits, initial value = H'0004 0001) 22 21 20 19 18 17 12 11 — FR SZ PR DN Cause Enable Flag Note: —: Reserved. These bits are always read as 0, and should only be written with 0. FR: Floating-point register bank FR = 0: FPR0_BANK0–FPR15_BANK0 are assigned to FR0–FR15;...
  • Page 201: Floating-Point Communication Register (Fpul)

    When an FPU operation instruction is executed, the FPU exception cause field is cleared to zero first. When the next FPU exception is occurred, the corresponding bits in the FPU exception cause field and FPU exception flag field are set to 1. The FPU exception flag field holds the status of the exception generated after the field was last cleared.
  • Page 202: Floating-Point Exceptions

    0, but the corresponding bit in the FPU exception flag field remains unchanged. Enable/disable exception handling The SH7751 Series supports enable exception handling and disable exception handling. Enable exception handling is initiated in the following cases: FPU error (E): FPSCR.DN = 0 and a denormalized number is input Invalid operation (V): FPSCR.EN.V = 1 and (instruction = FTRV or invalid operation)
  • Page 203: Graphics Support Functions

    The number of significant digits is 24 for a normalized number and 23 for a denormalized number (number of leading zeros in the fractional part). In future version of SuperH series, the above error is guaranteed, but the same result as SH7751 Series is not guaranteed.
  • Page 204 This operation is generally used for viewpoint changes, angle changes, or movements called vector transformations (4-dimensional). Since affine transformation processing for angle + parallel movement basically requires a 4 4 matrix, the SH7751 Series supports 4-dimensional operations. Matrix (4 matrix (4 This operation requires the execution of four FTRV instructions.
  • Page 205: Pair Single-Precision Data Transfer

    In addition to the powerful new geometric operation instructions, the SH7751 Series also supports high-speed data transfer instructions. When FPSCR.SZ = 1, the SH7751 Series can perform data transfer by means of pair single- precision data transfer instructions. FMOV DRm/XDm, DRn/XDRn (m, n: 0, 2, 4, 6, 8, 10, 12, 14) FMOV DRm/XDm, @Rn (m: 0, 2, 4, 6, 8, 10, 12, 14;...
  • Page 206: Section 7 Instruction Set

    Execution Environment PC: PC indicates the address of the instruction itself. Data sizes and data types: The SH7751 Series instruction set is implemented with 16-bit fixed- length instructions. The SH7751 Series can use byte (8-bit), word (16-bit), longword (32-bit), and quadword (64-bit) data sizes for memory access.
  • Page 207 In an RTE delay slot, status register (SR) bits are referenced as follows. In instruction access, the MD bit is used before modification, and in data access, the MD bit is accessed after modification. The other bits—S, T, M, Q, FD, BL, and RB—after modification are used for delay slot instruction execution.
  • Page 208: Addressing Modes

    Addressing Modes Addressing modes and effective address calculation methods are shown in table 7.1. When a location in virtual memory space is accessed (MMUCR.AT = 1), the effective address is translated into a physical address. If multiple virtual memory space systems are selected (MMUCR.SV = 0), the least significant bit of PTEH is also referenced as the access ASID.
  • Page 209 Table 7.1 Addressing Modes and Effective Addresses (cont) Addressing Instruction Calculation Mode Format Effective Address Calculation Method Formula Register @(disp:4, Rn) Effective address is register Rn contents with Byte: Rn + indirect with 4-bit displacement disp added. After disp is disp displacement zero-extended, it is multiplied by 1 (byte), 2 (word),...
  • Page 210 Table 7.1 Addressing Modes and Effective Addresses (cont) 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 with disp added. After disp is zero-extended, it is + disp displacement multiplied by 2 (word), or 4 (longword), according...
  • Page 211: Table 7.1 Addressing Modes And Effective Addresses

    Table 7.1 Addressing Modes and Effective Addresses (cont) Addressing Instruction Calculation Mode Format Effective Address Calculation Method Formula PC-relative disp:12 Effective address is PC+4 with 12-bit displacement PC + 4 + disp disp added after being sign-extended and Branch- multiplied by 2. Target PC + 4 + disp ×...
  • Page 212: Instruction Set

    Instruction Set Table 7.2 shows the notation used in the following SH instruction list. Table 7.2 Notation Used in Instruction List Item Format Description Instruction OP.Sz SRC, DEST Operation code mnemonic Size SRC: Source DEST: Source and/or destination operand Summary of Transfer direction operation (xx):...
  • Page 213: Table 7.3 Fixed-Point Transfer Instructions

    Table 7.3 Fixed-Point Transfer Instructions Instruction Operation Instruction Code Privileged T Bit #imm,Rn sign extension 1110nnnniiiiiiii — — MOV.W @(disp,PC),Rn (disp 2 + PC + 4) sign 1001nnnndddddddd — — extension MOV.L @(disp,PC),Rn (disp 4 + PC & H'FFFFFFFC 1101nnnndddddddd — —...
  • Page 214 Table 7.3 Fixed-Point Transfer Instructions (cont) Instruction Operation Instruction Code Privileged T Bit MOV.B R0,@(disp,GBR) (disp + GBR) 11000000dddddddd — — MOV.W R0,@(disp,GBR) (disp 2 + GBR) 11000001dddddddd — — MOV.L R0,@(disp,GBR) (disp 4 + GBR) 11000010dddddddd — — MOV.B @(disp,GBR),R0 (disp + GBR) 11000100dddddddd —...
  • Page 215 Table 7.4 Arithmetic Operation Instructions Instruction Operation Instruction Code Privileged T Bit Rm,Rn Rn + Rm 0011nnnnmmmm1100 — — #imm,Rn Rn + imm 0111nnnniiiiiiii — — ADDC Rm,Rn Rn + Rm + T Rn, carry 0011nnnnmmmm1110 — Carry ADDV Rm,Rn Rn + Rm Rn, overflow 0011nnnnmmmm1111 —...
  • Page 216: Table 7.4 Arithmetic Operation Instructions

    Table 7.4 Arithmetic Operation Instructions (cont) Instruction Operation Instruction Code Privileged T Bit EXTS.W Rm,Rn Rm sign-extended from 0110nnnnmmmm1111 — — word EXTU.B Rm,Rn Rm zero-extended from 0110nnnnmmmm1100 — — byte EXTU.W Rm,Rn Rm zero-extended from 0110nnnnmmmm1101 — — word MAC.L @Rm+,@Rn+ Signed, (Rn) (Rm) + MAC...
  • Page 217: Table 7.5 Logic Operation Instructions

    Table 7.5 Logic Operation Instructions Instruction Operation Instruction Code Privileged T Bit Rm,Rn Rn & Rm 0010nnnnmmmm1001 — — #imm,R0 R0 & imm 11001001iiiiiiii — — AND.B #imm,@(R0,GBR) (R0 + GBR) & imm (R0 + 11001101iiiiiiii — — GBR) Rm,Rn 0110nnnnmmmm0111 —...
  • Page 218: Table 7.6 Shift Instructions

    Table 7.6 Shift Instructions Instruction Operation Instruction Code Privileged T Bit ROTL 0100nnnn00000100 — ROTR 0100nnnn00000101 — ROTCL 0100nnnn00100100 — ROTCR 0100nnnn00100101 — SHAD Rm,Rn When Rn 0, Rn << Rm 0100nnnnmmmm1100 — — When Rn < 0, Rn >> Rm [MSB SHAL 0100nnnn00100000 —...
  • Page 219: Table 7.7 Branch Instructions

    Table 7.7 Branch Instructions Instruction Operation Instruction Code Privileged T Bit label When T = 0, disp 2 + PC + 10001011dddddddd — — When T = 1, nop BF/S label Delayed branch; when T = 0, 10001111dddddddd — — disp 2 + PC + 4 When T = 1, nop...
  • Page 220: Table 7.8 System Control Instructions

    Table 7.8 System Control Instructions Instruction Operation Instruction Code Privileged T Bit CLRMAC MACH, MACL 0000000000101000 — — CLRS 0000000001001000 — — CLRT 0000000000001000 — Rm,SR 0100mmmm00001110 Privileged Rm,GBR 0100mmmm00011110 — — Rm,VBR 0100mmmm00101110 Privileged — Rm,SSR 0100mmmm00111110 Privileged — Rm,SPC 0100mmmm01001110 Privileged —...
  • Page 221 Table 7.8 System Control Instructions (cont) Instruction Operation Instruction Code Privileged T Bit SETS 0000000001011000 — — SETT 0000000000011000 — SLEEP Sleep or standby 0000000000011011 Privileged — SR,Rn 0000nnnn00000010 Privileged — GBR,Rn 0000nnnn00010010 — — VBR,Rn 0000nnnn00100010 Privileged — SSR,Rn 0000nnnn00110010 Privileged —...
  • Page 222: Table 7.9 Floating-Point Single-Precision Instructions

    Table 7.9 Floating-Point Single-Precision Instructions Instruction Operation Instruction Code Privileged T Bit FLDI0 H'00000000 1111nnnn10001101 — — FLDI1 H'3F800000 1111nnnn10011101 — — FMOV FRm,FRn 1111nnnnmmmm1100 — — FMOV.S @Rm,FRn (Rm) 1111nnnnmmmm1000 — — FMOV.S @(R0,Rm),FRn (R0 + Rm) 1111nnnnmmmm0110 — —...
  • Page 223: Table 7.10 Floating-Point Double-Precision Instructions

    Table 7.10 Floating-Point Double-Precision Instructions Instruction Operation Instruction Code Privileged T Bit FABS DRn & H'7FFF FFFF FFFF 1111nnn001011101 — — FFFF FADD DRm,DRn DRn + DRm 1111nnn0mmm00000 — — FCMP/EQ DRm,DRn When DRn = DRm, 1 1111nnn0mmm00100 — Comparison Otherwise, 0 result FCMP/GT...
  • Page 224: Table 7.12 Floating-Point Graphics Acceleration Instructions

    Table 7.12 Floating-Point Graphics Acceleration Instructions Instruction Operation Instruction Code Privileged T Bit FMOV DRm,XDn 1111nnn1mmm01100 — — FMOV XDm,DRn 1111nnn0mmm11100 — — FMOV XDm,XDn 1111nnn1mmm11100 — — FMOV @Rm,XDn (Rm) 1111nnn1mmmm1000 — — FMOV @Rm+,XDn (Rm) XDn, Rm + 8 1111nnn1mmmm1001 —...
  • Page 225 Rev. 3.0, 04/02, page 186 of 1064...
  • Page 226: Section 8 Pipelining

    Instruction execution is pipelined, and two instructions can be executed in parallel. The execution cycles depend on the implementation of a processor. Definitions in this section may not be applicable to SH-4 Series models other than the SH7751 Series. Pipelines Figure 8.1 shows the basic pipelines.
  • Page 227: Figure 8.1 Basic Pipelines

    1. General Pipeline • Instruction fetch • Instruction • Operation • Non-memory • Write-back decode data access • Issue • Register read • Destination address calculation for PC-relative branch 2. General Load/Store Pipeline • Instruction fetch • Instruction • Address •...
  • Page 228: Figure 8.2 Instruction Execution Patterns

    1. 1-step operation: 1 issue cycle EXT[SU].[BW], MOV, MOV#, MOVA, MOVT, SWAP.[BW], XTRCT, ADD*, CMP*, DIV*, DT, NEG*, SUB*, AND, AND#, NOT, OR, OR#, TST, TST#, XOR, XOR#, ROT*, SHA*, SHL*, BF*, BT*, BRA, NOP, CLRS, CLRT, SETS, SETT, LDS to FPUL, STS from FPUL/FPSCR, FLDI0, FLDI1, FMOV, FLDS, FSTS, single-/double-precision FABS/FNEG 2.
  • Page 229 10. OCBI: 1 issue cycle 11. OCBP, OCBWB: 1 issue cycle 12. MOVCA.L: 1 issue cycle 13. TRAPA: 7 issue cycles 14. LDC to DBR/Rp_BANK/SSR/SPC/VBR, BSR: 1 issue cycle 15. LDC to GBR: 3 issue cycles 16. LDC to SR: 4 issue cycles 17.
  • Page 230 19. LDC.L to SR: 4 issue cycles 20. STC from DBR/GBR/Rp_BANK/SR/SSR/SPC/VBR: 2 issue cycles 21. STC.L from SGR: 3 issue cycles 22. STC.L from DBR/GBR/Rp_BANK/SR/SSR/SPC/VBR: 2 issue cycles 23. STC.L from SGR: 3 issue cycles 24. LDS to PR, JSR, BSRF: 2 issue cycles 25.
  • Page 231 31. STS.L from MACH/L: 1 issue cycle 32. LDS to FPSCR: 1 issue cycle 33. LDS.L to FPSCR: 1 issue cycle 34. Fixed-point multiplication: 2 issue cycles DMULS.L, DMULU.L, MUL.L, MULS.W, MULU.W (CPU) (FPU) 35. MAC.W, MAC.L: 2 issue cycles (CPU) (FPU) 36.
  • Page 232 40. Double-precision FCMP: 2 issue cycles FCMP/EQ,FCMP/GT 41. Double-precision FDIV/SQRT: 1 issue cycle FDIV, FSQRT 42. FIPR: 1 issue cycle 43. FTRV: 1 issue cycle : Cannot overlap a stage of the same kind, except when two instructions are Notes: executed in parallel.
  • Page 233: Parallel-Executability

    Parallel-Executability Instructions are categorized into six groups according to the internal function blocks used, as shown in table 8.1. Table 8.2 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 8.1 Instruction Groups 1.
  • Page 234 Table 8.1 Instruction Groups (cont) 4. LS Group FABS FMOV.S @Rm+,FRn MOV.L R0,@(disp,GBR) FABS FMOV.S FRm,@(R0,Rn) MOV.L Rm,@(disp,Rn) FLDI0 FMOV.S FRm,@-Rn MOV.L Rm,@(R0,Rn) FLDI1 FMOV.S FRm,@Rn MOV.L Rm,@-Rn FLDS FRm,FPUL FNEG MOV.L Rm,@Rn FMOV @(R0,Rm),DRn FNEG MOV.W @(disp,GBR),R0 FMOV @(R0,Rm),XDn FSTS FPUL,FRn MOV.W...
  • Page 235 Table 8.1 Instruction Groups (cont) 5. FE Group FADD DRm,DRn FIPR FVm,FVn FSQRT FADD FRm,FRn FLOAT FPUL,DRn FSQRT FCMP/EQ FRm,FRn FLOAT FPUL,FRn FSUB DRm,DRn FCMP/GT FRm,FRn FMAC FR0,FRm,FRn FSUB FRm,FRn FCNVDS DRm,FPUL FMUL DRm,DRn FTRC DRm,FPUL FCNVSD FPUL,DRn FMUL FRm,FRn FTRC FRm,FPUL FDIV...
  • Page 236 Table 8.1 Instruction Groups (cont) 6. CO Group AND.B #imm,@(R0,GBR) LDS Rm,FPSCR SR,Rn BRAF Rm,MACH SSR,Rn BSRF Rm,MACL VBR,Rn CLRMAC Rm,PR STC.L DBR,@-Rn CLRS LDS.L @Rm+,FPSCR STC.L GBR,@-Rn DMULS.L Rm,Rn LDS.L @Rm+,FPUL STC.L Rp_BANK,@-Rn DMULU.L Rm,Rn LDS.L @Rm+,MACH STC.L SGR,@-Rn FCMP/EQ DRm,DRn LDS.L...
  • Page 237: Execution Cycles And Pipeline Stalling

    Table 8.2 Parallel-Executability 2nd Instruction Instruction O: Can be executed in parallel X: Cannot be executed in parallel Execution Cycles and Pipeline Stalling There are three basic clocks in this processor: the I-clock, B-clock, and P-clock. Each hardware unit operates on one of these clocks, as follows: I-clock: CPU, FPU, MMU, caches B-clock: External bus controller P-clock: Peripheral units...
  • Page 238 The instruction execution sequence is expressed as a combination of the execution patterns shown in figure 8.2. One instruction is separated from the next by the number of machine cycles for its issue rate. Normally, execution, data access, and write-back stages cannot be overlapped onto the same stages of another instruction;...
  • Page 239 Anti-flow dependency can occur only between a preceding double-precision FADD, FMUL, FSUB, or FTRV and a following FMOV, FLDI0, FLDI1, FABS, FNEG, or FSTS. See figure 8.3 (g). If an executing instruction locks any resource—i.e. a function block that performs a basic operation—a following instruction that attempts to use the locked resource is stalled (figure 8.3 (h)).
  • Page 240: Figure 8.3 Examples Of Pipelined Execution

    (a) Serial execution: non-parallel-executable instructions 1 issue cycle SHAD R0,R1 EX-group SHAD and EX-group ADD R2,R3 cannot be executed in parallel. Therefore, next SHAD is issued first, and the following 1 stall cycle ADD is recombined with the next instruction. (b) Parallel execution: parallel-executable and no dependency 1 issue cycle EX-group ADD and LS-group MOV.L can...
  • Page 241 (e) Flow dependency Zero-cycle latency The following instruction, ADD, is not R0,R1 stalled when executed after an instruction R2,R1 with zero-cycle latency, even if there is dependency. 1-cycle latency ADD and MOV.L are not executed in R2,R1 parallel, since MOV.L references the result MOV.L @R1,R1 of ADD as its destination address.
  • Page 242 (e) Flow dependency (cont) Effectively 1-cycle latency for consecutive LDS/FLOAT instructions R0,FPUL FLOAT FPUL,FR0 R1,FPUL FLOAT FPUL,FR1 Effectively 1-cycle latency for consecutive FTRC FR0,FPUL FTRC/STS instructions FPUL,R0 FTRC FR1,FPUL FPUL,R1 (f) Output dependency 11-cycle latency FSQRT FR4 FMOV FR0,FR4 10 stall cycles = latency (11) - 1 The registers are written-back in program order.
  • Page 243 (h) Resource conflict ..........Latency 1 cycle/issue FDIV FR6,FR7 F1 stage locked for 1 cycle FMAC FR0,FR8,FR9 FMAC FR0,FR10,FR11 FMAC FR0,FR12,FR13 1 stall cycle (F1 stage resource conflict) FIPR FV8,FV0 FADD FR15,FR4 1 stall cycle LDS.L @R15+,PR GBR,R2 3 stall cycles FADD DR0,DR2 MAC.W @R1+,@R2+ 5 stall cycles...
  • Page 244: Table 8.3 Execution Cycles

    Table 8.3 Execution Cycles Instruc- Execu- Lock Functional tion Issue tion Category Instruction Group Rate Latency Pattern Stage Start Cycles Data transfer EXTS.B Rm,Rn — — — instructions EXTS.W Rm,Rn — — — EXTU.B Rm,Rn — — — EXTU.W Rm,Rn —...
  • Page 245 Table 8.3 Execution Cycles (cont) Instruc- Execu- Lock Functional tion Issue tion Category Instruction Group Rate Latency Pattern Stage Start Cycles Data transfer MOV.W R0,@(disp,Rn) — — — instructions MOV.L Rm,@(disp,Rn) — — — MOV.B Rm,@(R0,Rn) — — — MOV.W Rm,@(R0,Rn) —...
  • Page 246 Table 8.3 Execution Cycles (cont) Instruc- Execu- Lock Functional tion Issue tion Category Instruction Group Rate Latency Pattern Stage Start Cycles Fixed-point DIV0U — — — arithmetic DIV1 Rm,Rn — — — instructions DMULS.L Rm,Rn DMULU.L Rm,Rn — — — MAC.L @Rm+,@Rn+ 2/2/4/4...
  • Page 247 Table 8.3 Execution Cycles (cont) Instruc- Execu- Lock Functional tion Issue tion Category Instruction Group Rate Latency Pattern Stage Start Cycles Shift ROTL — — — instructions ROTR — — — ROTCL — — — ROTCR — — — SHAD Rm,Rn —...
  • Page 248 Table 8.3 Execution Cycles (cont) Instruc- Execu- Lock Functional tion Issue tion Category Instruction Group Rate Latency Pattern Stage Start Cycles System — — — control CLRMAC instructions CLRS — — — CLRT — — — SETS — — — SETT —...
  • Page 249 Table 8.3 Execution Cycles (cont) Instruc- Execu- Lock Functional tion Issue tion Category Instruction Group Rate Latency Pattern Stage Start Cycles System GBR,Rn — — — control Rp_BANK,Rn — — — instructions SR,Rn — — — SSR,Rn — — — SPC,Rn —...
  • Page 250 Table 8.3 Execution Cycles (cont) Instruc- Execu- Lock Functional tion Issue tion Category Instruction Group Rate Latency Pattern Stage Start Cycles Single- FABS — — — precision FADD FRm,FRn — — — floating-point FCMP/EQ FRm,FRn — — — instructions FCMP/GT FRm,FRn —...
  • Page 251 Table 8.3 Execution Cycles (cont) Instruc- Execu- Lock Functional tion Issue tion Category Instruction Group Rate Latency Pattern Stage Start Cycles Double- FNEG — — — precision FSQRT (23, 24)/ floating-point instructions FSUB DRm,DRn (7, 8)/9 FTRC DRm,FPUL FPU system Rm,FPUL —...
  • Page 252 5. Double-precision floating-point instruction latency “(L1, L2)/L3”: L1 is the latency for FR [n+1], L2 that for FR [n], and L3 that for FPSCR. 6. FTRV latency “(L1, L2, L3, L4)/L5”: L1 is the latency for FR [n], L2 that for FR [n+1], L3 that for FR [n+2], L4 that for FR [n+3], and L5 that for FPSCR.
  • Page 253 Rev. 3.0, 04/02, page 214 of 1064...
  • Page 254: Section 9 Power-Down Modes

    Section 9 Power-Down Modes Overview In the power-down modes, some of the on-chip peripheral modules and the CPU functions are halted, enabling power consumption to be reduced. 9.1.1 Types of Power-Down Modes The following power-down modes and functions are provided: Sleep mode Deep sleep mode Standby mode...
  • Page 255: Table 9.1 Status Of Cpu And Peripheral Modules In Power-Down Modes

    Table 9.1 Status of CPU and Peripheral Modules in Power-Down Modes Status Power- On-chip Down Entering On-Chip Peripheral External Exiting Mode Conditions CPG Memory Modules Pins Memory Method Sleep SLEEP Operating Halted Held Operating Held Refresh- Interrupt instruction (registers Reset executed held) while STBY...
  • Page 256: Register Configuration

    9.1.2 Register Configuration Table 9.2 shows the registers used for power-down mode control. Table 9.2 Power-Down Mode Registers Area 7 Access Name Abbreviation Initial Value P4 Address Address Size Standby control STBCR H'00 H'FFC00004 H'1FC00004 register Standby control STBCR2 H'00 H'FFC00010 H'1FC00010 register 2 Clock stop register CLKSTP00...
  • Page 257: Register Descriptions

    Register Descriptions 9.2.1 Standby Control Register (STBCR) The standby control register (STBCR) is an 8-bit readable/writable register that specifies the power-down mode status. It is initialized to H'00 by a power-on reset via the pin or due to watchdog timer overflow. Bit: STBY MSTP4...
  • Page 258 Bit 4—Module Stop 4 (MSTP4): Specifies stopping of the clock supply to the DMAC among the on-chip peripheral modules. The clock supply to the DMAC is stopped when the MSTP4 bit is set to 1. When DMA transfer is used, stop the transfer before setting the MSTP4 bit to 1. When DMA transfer is performed after clearing the MSTP4 bit to 0, DMAC settings must be made again.
  • Page 259: Peripheral Module Pin High Impedance Control

    Bit 0: MSTP0 Description SCI operates (Initial value) SCI clock supply is stopped 9.2.2 Peripheral Module Pin High Impedance Control When bit 6 in the standby control register (STBCR) is set to 1, peripheral module related pins go to the high-impedance state in standby mode. Relevant Pins SCI related pins MD0/SCK2...
  • Page 260: Standby Control Register 2 (Stbcr2)

    9.2.4 Standby Control Register 2 (STBCR2) Standby control register 2 (STBCR2) is an 8-bit readable/writable register that specifies the sleep mode and deep sleep mode transition conditions. It is initialized to H'00 by a power-on reset via pin or due to watchdog timer overflow. Bit: DSLP STHZ...
  • Page 261: Clock Stop Register 00 (Clkstp00)

    Bit 0—Module Stop 5 (MSTP5): Specifies stopping of the clock supply to the user break controller (UBC) among the on-chip peripheral modules. See section 20.6, User Break Controller Stop Function for how to set the clock supply. Bit 0: MSTP5 Description UBC operating (Initial value)
  • Page 262: Clock Stop Clear Register 00 (Clkstpclr00)

    Bit 1—Clock Stop 1 (CSTP1): Specifies stopping of the peripheral clock supply to timer unit (TMU) channels 3 and 4. Bit 1: CSTP1 Description Peripheral clock is supplied to TMU channels 3 and 4 (Initial value) Peripheral clock supply to TMU channels 3 and 4 is stopped Bit 0—Clock Stop 0 (CSTP0): Specifies stopping of the peripheral clock supply to the interrupt controller (INTC).
  • Page 263: Sleep Mode

    Sleep Mode 9.3.1 Transition to Sleep Mode If a SLEEP instruction is executed when the STBY bit in STBCR is cleared to 0, the chip switches from the program execution state to sleep mode. After execution of the SLEEP instruction, the CPU halts but its register contents are retained.
  • Page 264: Exit From Deep Sleep Mode

    Transition to Pin Sleep Mode Changing the pin to the low level causes the SH7751 Series to make a transition to sleep mode. To ensure that memory is correctly refreshed, use this function when the DSLP bit of STBCR2 is set to 0.
  • Page 265: Exit From Standby Mode

    Table 9.4 State of Registers in Standby Mode Registers That Retain Module Initialized Registers Their Contents Interrupt controller — All registers User break controller — All registers Bus state controller — All registers On-chip oscillation circuits — All registers Timer unit TSTR register* All registers except TSTR Realtime clock...
  • Page 266: Clock Pause Function

    Notes: *1 Only when the RTC clock (32.768 kHz) is operating (see section 19.2.2, IRL Interrupts), standby mode can be exited by means of IRL3–IRL0 (when the IRL3– IRL0 level is higher than the SR register I3–I0 mask level). *2 GPIC can be used to cancel standby mode when the RTC clock (32.768 kHz) is operating (when the GPIC level is higher than the SR register I3–I0 mask level).
  • Page 267: Exit From Module Standby Function

    Description CSTP2 Peripheral clock is supplied to PCIC Peripheral clock supply to PCIC is stopped CSTP1 Peripheral clock is supplied to TMU channels 3 and 4 Peripheral clock supply to TMU channels 3 and 4 is stopped CSTP0 INTC detects PCIC and TMU channel 3 and 4 interrupts INTC does not detect PCIC and TMU channel 3 and 4 interrupts MSTP6 SQ operates...
  • Page 268: Hardware Standby Mode

    Hardware Standby Mode 9.8.1 Transition to Hardware Standby Mode Setting the CA pin level low effects a transition to hardware standby mode. In this mode, all modules other than the RTC stop, as in the standby mode selected using the SLEEP command. Hardware standby mode differs from standby mode as follows: 1.
  • Page 269: Usage Notes

    9.8.3 Usage Notes The CA pin level must be kept high during the power-on oscillation settling period when the RTC power supply is started (figure 9.15). STATUS Pin Change Timing The STATUS1 and STATUS0 pin change timing is shown below. The meaning of the STATUS pin settings is as follows: Reset: HH (STATUS1 high, STATUS0 high)
  • Page 270: In Exit From Standby Mode

    Manual Reset CKIO (High) Normal Reset Normal STATUS 0–30 Bcyc ≥ 0 Bcyc Note: * In a manual reset, STATUS = HH (reset) is set and an internal reset started after waiting until the end of the currently executing bus cycle. Figure 9.2 STATUS Output in Manual Reset 9.9.2 In Exit from Standby Mode...
  • Page 271: Figure 9.4 Status Output In Standby Power-On Reset Sequence

    Standby Power-On Reset Oscillation stops Reset CKIO Normal Standby Reset Normal STATUS 0–30 Bcyc 0–10 Bcyc Notes: *1 When standby mode is exited by means of a power-on reset, a WDT count is not performed. Hold low for the PLL oscillation stabilization time. *2 Undefined Figure 9.4 STATUS Output in Standby Power-On Reset Sequence...
  • Page 272: In Exit From Sleep Mode

    Standby Manual Reset Oscillation stops Reset CKIO (High) Normal Standby Undefined Reset Normal STATUS 0–30 Bcyc 0–20 Bcyc Note: * When standby mode is exited by means of a manual reset, a WDT count is not performed. Hold low for the PLL oscillation stabilization time. Figure 9.5 STATUS Output in Standby Manual Reset Sequence 9.9.3...
  • Page 273: Figure 9.7 Status Output In Sleep Power-On Reset Sequence

    Sleep Power-On Reset Reset CKIO Normal Sleep Reset Normal STATUS 0–30 Bcyc 0–10 Bcyc Notes: *1 When sleep mode is exited by means of a power-on reset, hold low for the oscillation stabilization time. *2 Undefined Figure 9.7 STATUS Output in Sleep Power-On Reset Sequence Rev.
  • Page 274: Figure 9.8 Status Output In Sleep Manual Reset Sequence

    Sleep Manual Reset Reset CKIO (High) Normal Sleep Reset Normal STATUS 0–30 Bcyc 0–30 Bcyc Note: * Hold low until STATUS = reset. Figure 9.8 STATUS Output in Sleep Manual Reset Sequence Rev. 3.0, 04/02, page 235 of 1064...
  • Page 275: In Exit From Deep Sleep Mode

    9.9.4 In Exit from Deep Sleep Mode Deep Sleep Interrupt Interrupt request CKIO Sleep STATUS Normal Normal Figure 9.9 STATUS Output in Deep Sleep Interrupt Sequence Deep Sleep Power-On Reset Reset CKIO RESET * Normal Sleep Reset Normal STATUS 0–30 Bcyc 0–10 Bcyc Notes: *1 When deep sleep mode is exited by means of a power-on reset, hold RESET low for the oscillation stabilization time.
  • Page 276: Figure 9.11 Status Output In Deep Sleep Manual Reset Sequence

    Deep Sleep Manual Reset Reset CKIO (High) Normal Reset Normal STATUS Sleep 0–30 Bcyc 0–30 Bcyc Note: * Hold low until STATUS = reset. Figure 9.11 STATUS Output in Deep Sleep Manual Reset Sequence Rev. 3.0, 04/02, page 237 of 1064...
  • Page 277: Hardware Standby Mode Timing

    9.9.5 Hardware Standby Mode Timing Figure 9.12 shows the timing of the signals of the respective pins in hardware standby mode. The CA pin level must be kept low while in hardware standby mode. After setting the pin level low, the clock starts when the CA pin level is switched to high. CKIO Normal Standby...
  • Page 278: Figure 9.13 Hardware Standby Mode Timing (When Ca = Low In Wdt Operation)

    Interrupt request WDT overflow CKIO (High) Standby Normal Standby* STATUS 0–10 Bcyc WDT count Note: * High impedance when STBCR2. STHZ = 0 Figure 9.13 Hardware Standby Mode Timing (When CA = Low in WDT Operation) Min 0s Min 0s Max 50 µs Note: * V DD-CPG...
  • Page 279: Figure 9.15 Timing When Vdd-Rtc Power Is Off On

    DD-RTC Power-on oscillation settling time Min 0s Note: * V DD-PLL1/2 DD-CPG Figure 9.15 Timing When VDD-RTC Power is Off Rev. 3.0, 04/02, page 240 of 1064...
  • Page 280: Section 10 Clock Oscillation Circuits

    Section 10 Clock Oscillation Circuits 10.1 Overview The on-chip oscillation circuits comprise a clock pulse generator (CPG) and a watchdog timer (WDT). The CPG generates the clocks supplied inside the processor and performs power-down mode control. The WDT is a single-channel timer used to count the clock stabilization time when exiting standby mode or the frequency is changed.
  • Page 281 The WDT has the following features Can be used to secure clock stabilization time Used when exiting standby mode or a temporary standby state when the clock frequency is changed. Can be switched between watchdog timer mode and interval timer mode Internal reset generation in watchdog timer mode An internal reset is executed on counter overflow.
  • Page 282: Overview Of Cpg

    10.2 Overview of CPG 10.2.1 Block Diagram of CPG Figures 10.1(1) and 10.1(2) show a block diagram of the CPG in the SH7751 and SH7751R. Oscillator circuit Frequency divider 2 × 1 PLL circuit 1 × 1/2 × 6 × 1/3 CPU clock (Iø)
  • Page 283: Figure 10.1(2) Block Diagram Of Cpg (Sh7751R)

    Oscillator circuit Frequency divider 2 × 1 PLL circuit 1 × 1/2 × 6 × 1/3 × 12 CPU clock (Iø) × 1/4 cycle Icyc × 1/6 × 1/8 Crystal XTAL Peripheral module oscillator clock (Pø) cycle Pcyc EXTAL Bus clock (Bø) cycle Bcyc PLL circuit 2 ×...
  • Page 284 The function of each of the CPG blocks is described below. PLL Circuit 1: PLL circuit 1 has a function for multiplying the clock frequency from the EXTAL pin or crystal oscillator by 6 or 12. Starting and stopping is controlled by a frequency control register setting.
  • Page 285: Cpg Pin Configuration

    10.2.2 CPG Pin Configuration Table 10.1 shows the CPG pins and their functions. Table 10.1 CPG Pins Pin Name Abbreviation Function Mode control pins Input Set clock operating mode Crystal I/O pins XTAL Output Connects crystal resonator (clock input pins) EXTAL Input Connects crystal resonator, or used as...
  • Page 286: Clock Operating Modes

    Tables 10.3(1) and 10.3(2) show the clock operating modes corresponding to various combinations of mode control pin (MD2–MD0) settings (initial settings such as the frequency division ratio). Table 10.4 shows FRQCR settings and internal clock frequencies. Table 10.3(1) Clock Operating Modes (SH7751) External Frequency Pin Combination (vs.
  • Page 287: Table 10.4 Frqcr Settings And Internal Clock Frequencies

    Table 10.4 FRQCR Settings and Internal Clock Frequencies Frequency Division Ratio FRQCR (Lower 9 Bits) CPU Clock Bus Clock Peripheral Module Clock 9'h000 9'h002 9'h004 9'h008 9'h00a 9'h00c 9'h011 9'h013 9'h01a 9'h01c 9'h023 9'h02c 9'h048 9'h04a 9'h04c 9'h05a 9'h05c 9'h063 9'h06c 9'h091 9'h093...
  • Page 288: Cpg Register Description

    10.4 CPG Register Description 10.4.1 Frequency Control Register (FRQCR) The frequency control register (FRQCR) is a 16-bit readable/writable register that specifies use/non-use of clock output from the CKIO pin, PLL circuit 1 and 2 on/off control, and the CPU clock, bus clock, and peripheral module clock frequency division ratios. Only word access can be used on FRQCR.
  • Page 289 Bit 9—PLL Circuit 2 Enable (PLL2EN): Specifies whether PLL circuit 2 is on or off. Bit 9: PLL2EN Description PLL circuit 2 is not used PLL circuit 2 is used (Initial value) Bits 8 to 6—CPU Clock Frequency Division Ratio (IFC): These bits specify the CPU clock frequency division ratio with respect to the input clock, 1/2 frequency divider, or PLL circuit 1 output frequency.
  • Page 290: Changing The Frequency

    Bit 2: PFC2 Bit 1: PFC1 Bit 0: PFC0 Description Other than the above Setting prohibited (Do not set) 10.5 Changing the Frequency There are two methods of changing the internal clock frequency: by changing stopping and starting of PLL circuit 1, and by changing the frequency division ratio of each clock. In both cases, control is performed by software by means of the frequency control register.
  • Page 291: Changing Bus Clock Division Ratio (When Pll Circuit 2 Is On)

    3. Internal processor operation stops temporarily, PLL circuit 1 oscillates, and the WDT starts counting up. The internal clock stops and an unstable clock is output to the CKIO pin. 4. After the WDT count overflows, PLL circuit 2 starts oscillating. The WDT resumes its up- count from the value set in step 1 above.
  • Page 292: Output Clock Control

    10.6 Output Clock Control The CKIO pin can be switched between clock output and a high-impedance state by means of the CKOEN bit in the FRQCR register. When the CKIO pin goes to the high-impedance state, it is pulled up. 10.7 Overview of Watchdog Timer 10.7.1...
  • Page 293: Register Configuration

    10.7.2 Register Configuration The WDT has the two registers summarized in table 10.5. These registers control clock selection and timer mode switching. Table 10.5 WDT Registers Initial Area 7 Name Abbreviation Value P4 Address Address Access Size Watchdog timer WTCNT R/W* H'00 H'FFC00008...
  • Page 294: Watchdog Timer Control/Status Register (Wtcsr)

    10.8.2 Watchdog Timer Control/Status Register (WTCSR) The watchdog timer control/status register (WTCSR) is an 8-bit readable/writable register containing bits for selecting the count clock and timer mode, and overflow flags. WTCSR is initialized to H'00 only by a power-on reset via the pin.
  • Page 295 Bit 4—Watchdog Timer Overflow Flag (WOVF): Indicates that WTCNT has overflowed in watchdog timer mode. This flag is not set in interval timer mode. Bit 4: WOVF Description No overflow (Initial value) WTCNT has overflowed in watchdog timer mode Bit 3—Interval Timer Overflow Flag (IOVF): Indicates that WTCNT has overflowed in interval timer mode.
  • Page 296: Notes On Register Access

    10.8.3 Notes on Register Access The watchdog timer counter (WTCNT) and watchdog timer control/status register (WTCSR) differ from other registers in being more difficult to write to. The procedure for writing to these registers is given below. Writing to WTCNT and WTCSR: These registers must be written to with a word transfer instruction.
  • Page 297: Using The Wdt

    10.9 Using the WDT 10.9.1 Standby Clearing Procedure The WDT is used when clearing standby mode by means of an NMI or other interrupt. The procedure is shown below. (As the WDT does not operate when standby mode is cleared with a reset, the pin should be held low until the clock stabilizes.)
  • Page 298: Using Watchdog Timer Mode

    10.9.3 Using Watchdog Timer Mode 1. Set the WT/ bit in the WTCSR register to 1, select the type of reset with the RSTS bit, and the count clock with bits CKS2–CKS0, and set the initial value in the WTCNT counter. 2.
  • Page 299: Notes On Board Design

    CL1 = CL2 = 0–33 pF R = 0Ω EXTAL XTAL SH7751 Series Note: The values for CL1, CL2, and the damping resistance should be determined after consultation with the crystal resonator manufacturer. Figure 10.4 Points for Attention when Using Crystal Resonator When Inputting External Clock from EXTAL Pin: Make no connection to the XTAL pin.
  • Page 300: Figure 10.5 Points For Attention When Using Pll Oscillator Circuit

    CPB1 = CPB2 = 10 µF RB = 10 Ω VSS-PLL1 CB = 10 µF RCB2 VDD-PLL2 1.8 V CPB2 SH7751 Series VSS-PLL2 VDD-CPG 3.3 V VSS-CPG Figure 10.5 Points for Attention when Using PLL Oscillator Circuit Rev. 3.0, 04/02, page 261 of 1064...
  • Page 301 Rev. 3.0, 04/02, page 262 of 1064...
  • Page 302: Section 11 Realtime Clock (Rtc)

    Section 11 Realtime Clock (RTC) 11.1 Overview The SH7751 Series includes an on-chip realtime clock (RTC) and a 32.768 kHz crystal oscillator for use by the RTC. 11.1.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.
  • Page 303: Block Diagram

    11.1.2 Block Diagram Figure 11.1 shows a block diagram of the RTC. RTCCLK RESET, STBY, etc 16.384 kHz RTC crystal RTC operation 32.768 kHz Prescaler oscillator control unit 128 Hz RCR1 RCR2 Counter unit RCR3 Interrupt R64CNT control unit RSECCNT RMINCNT RHRCNT RDAYCNT...
  • Page 304: Pin Configuration

    11.1.3 Pin Configuration Table 11.1 shows the RTC pins. Table 11.1 RTC Pins Pin Name Abbreviation Function RTC oscillator crystal pin EXTAL2 Input Connects crystal to RTC oscillator RTC oscillator crystal pin XTAL2 Output Connects crystal to RTC oscillator Clock input/clock output TCLK External clock input pin/input capture control input pin/RTC output pin...
  • Page 305 Table 11.2 RTC Registers (cont) Initialization Abbrevia- Power-On Manual Standby Initial Area 7 Access Name tion Reset Reset Mode Value P4 Address Address Size Month RMONCNT R/W Counts Counts Counts Undefined H'FFC80018 H'1FC80018 8 counter Year RYRCNT R/W Counts Counts Counts Undefined H'FFC8001C H'1FC8001C 16...
  • Page 306: Register Descriptions

    11.2 Register Descriptions 11.2.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 kHz 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.
  • Page 307: Minute Counter (Rmincnt)

    11.2.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. The setting range is decimal 00 to 59. The RTC will not operate normally if any other value is set. Write processing should be performed after stopping the count with the START bit in RCR2, or by using the carry flag.
  • Page 308: Day-Of-Week Counter (Rwkcnt)

    11.2.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. The setting range is decimal 0 to 6. The RTC will not operate normally if any other value is set. Write processing should be performed after stopping the count with the START bit in RCR2, or by using the carry flag.
  • Page 309: Day Counter (Rdaycnt)

    11.2.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. The setting range is decimal 01 to 31. The RTC will not operate normally if any other value is set. Write processing should be performed after stopping the count with the START bit in RCR2, or by using the carry flag.
  • Page 310: Year Counter (Ryrcnt)

    Bit: — — — 10-month 1-month units unit Initial value: Undefined Undefined Undefined Undefined Undefined R/W: 11.2.8 Year Counter (RYRCNT) RYRCNT is a 16-bit readable/writable register used as a counter for setting and counting the BCD-coded year value in the RTC. It counts on the carry generated once per year by the month counter.
  • Page 311: Second Alarm Register (Rsecar)

    11.2.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. Comparison between the counter and the alarm register is performed for those registers among RSECAR, RMINAR, RHRAR, RWKAR, RDAYAR, and RMONAR in which the ENB bit is set to 1, and the RCR1 alarm flag is set when the respective values all match.
  • Page 312: Hour Alarm Register (Rhrar)

    11.2.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. Comparison between the counter and the alarm register is performed for those registers among RSECAR, RMINAR, RHRAR, RWKAR, RDAYAR, and RMONAR in which the ENB bit is set to 1, and the RCR1 alarm flag is set when the respective values all match.
  • Page 313: Day Alarm Register (Rdayar)

    Bit: — — — — Day-of-week code Initial value: Undefined Undefined Undefined R/W: Day-of-week code Day of week 11.2.13 Day Alarm Register (RDAYAR) RDAYAR is an 8-bit readable/writable register used as an alarm register for the RTC’s BCD- coded day value counter, RDAYCNT. When the ENB bit is set to 1, the RDAYAR value is compared with the RDAYCNT value.
  • Page 314: Month Alarm Register (Rmonar)

    11.2.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. Comparison between the counter and the alarm register is performed for those registers among RSECAR, RMINAR, RHRAR, RWKAR, RDAYAR, and RMONAR in which the ENB bit is set to 1, and the RCR1 alarm flag is set when the respective values all match.
  • Page 315 Bit 7—Carry Flag (CF): This flag is set to 1 on generation of a second counter carry, or a 64 Hz counter carry when the 64 Hz counter is read. The count register value read at this time is not guaranteed, and so the count register must be read again.
  • Page 316: Rtc Control Register 2 (Rcr2)

    Bit 0—Alarm Flag (AF): 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. Bit 0: AF Description Alarm registers and counter values do not match (Initial value)
  • Page 317 Bit 7—Periodic Interrupt Flag (PEF): Indicates interrupt generation at the interval specified by bits PES2–PES0. When this flag is set to 1, a periodic interrupt is generated. Bit 7: PEF Description Interrupt is not generated at interval specified by bits PES2–PES0 [Clearing condition] When 0 is written to PEF Interrupt is generated at interval specified by bits PES2–PES0...
  • Page 318 Bit 2—30-Second Adjustment (ADJ): 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. The frequency divider circuits (RTC prescaler and R64CNT) are also reset at this time.
  • Page 319: Rtc Control Register (Rcr3) And Year-Alarm Register (Ryrar)

    11.2.17 RTC Control Register (RCR3) and Year-Alarm Register (RYRAR) (SH7751R Only) RCR3 and RYRAR are readable/writable registers. RYRAR is the alarm register for the RTC’s BCD-coded year-value counter RYRCNT. When the YENB bit of RCR3 is set to 1, the RYRCNT value is compared with the RYRAR value.
  • Page 320: Operation

    11.3 Operation Examples of the use of the RTC are shown below. 11.3.1 Time Setting Procedures Figure 11.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 day-of-week/month/year Set RCR2.START to 1...
  • Page 321: Time Reading Procedures

    The procedure for setting the time while the clock is running is shown in figure 11.2 (b). This method is useful for modifying only certain counter values (for example, only the second data or hour data). If a carry occurs during the write operation, the write data is automatically updated and there will be an error in the set data.
  • Page 322: Figure 11.3 Examples Of 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) Read counter register Carry flag = 1? Read RCR1 register and check CF bit (a) Reading time without using interrupts Clear carry flag Set RCR1.CIE to 1 Enable carry interrupts...
  • Page 323: Alarm Function

    11.3.3 Alarm Function The use of the alarm function is illustrated in figure 11.4. Clock running Disable alarm interrupts Clear RCR1.AIE to prevent erroneous interrupts Set alarm time Be sure to reset the flag as it may have been Clear alarm flag set during alarm time setting Set RCR1.AIE to 1 Enable alarm interrupts...
  • Page 324: Interrupts

    11.4 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. A periodic interrupt request (PRI) is generated when the periodic interrupt enable bits (PES2–...
  • Page 325: Figure 11.5 Example Of Crystal Oscillator Circuit Connection

    SH7751 Series 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. Built-in resistance value R (typ.
  • Page 326: Section 12 Timer Unit (Tmu)

    Section 12 Timer Unit (TMU) 12.1 Overview The SH7751 Series includes an on-chip 32-bit timer unit (TMU) comprising five 32-bit timer channels (channels 0 to 4). 12.1.1 Features The TMU has the following features. Auto-reload type 32-bit down-counter provided for each channel...
  • Page 327: Block Diagram

    12.1.2 Block Diagram Figure 12.1 shows a block diagram of the TMU. TICPI2 RESET, STBY, TUNI0,1 PCLK/4, 16, 64* TUNI2 TCLK RTCCLK TUNI3, TUNI4 etc. TCLK Prescaler operation control unit control unit To chan- To chan- TOCR nels nels 0 to 4 0 to 2 TSTR TSTR2...
  • Page 328: Register Configuration

    12.1.4 Register Configuration Table 12.2 summarizes the TMU registers. Table 12.2 TMU Registers Initialization Power- Stand- Chan- Abbre- Manual Area 7 Access Name viation R/W Reset Reset Mode Initial Value P4 Address Address Size Com- Timer TOCR R/W Ini- Ini- Held H'00 H’FFD80000 H'1FD80000 8...
  • Page 329: Register Descriptions

    Table 12.2 TMU Registers (cont) Initialization Power- Stand- Chan- Abbre- Manual Area 7 Access Name viation R/W Reset Reset Mode Initial Value P4 Address Address Size Timer TCOR3 R/W Ini- Held Held H'FFFFFFFF H'FE100008 H'1E100008 32 constant tialized register 3 Timer TCNT3 R/W Ini- Held...
  • Page 330: Timer Start Register (Tstr)

    Bit 0—Timer Clock Pin Control (TCOE): Specifies whether timer clock pin TCLK is used as the external clock or input capture control input pin, or as the on-chip RTC output clock output pin. Bit 0: TCOE Description Timer clock pin (TCLK) is used as external clock input or input capture control input pin (Initial value) Timer clock pin (TCLK) is used as on-chip RTC output clock output pin*...
  • Page 331: Timer Start Register 2 (Tstr2)

    Bit 1—Counter Start 1 (STR1): Specifies whether timer counter 1 (TCNT1) is operated or stopped. Bit 1: STR1 Description TCNT1 count operation is stopped (Initial value) TCNT1 performs count operation Bit 0—Counter Start 0 (STR0): Specifies whether timer counter 0 (TCNT0) is operated or stopped.
  • Page 332: Timer Constant Registers (Tcor)

    Bit 0—Counter Start 3 (STR3): Specifies whether timer counter 3 (TCNT3) is operated or stopped. Bit 0: STR3 Description TCNT3 count operation is stopped (Initial value) TCNT3 performs count operation 12.2.4 Timer Constant Registers (TCOR) The TCOR registers are 32-bit readable/writable registers. There are five TCOR registers, one for each channel.
  • Page 333: Timer Control Registers (Tcr)

    The TCNT registers in channels 3 and 4 are initialized to H'FFFFFFFF by a power-on reset, but are not initialized and retain their contents by a manual reset or in standby mode. Bit: · · · · · · · · · · · · · Initial value: R/W: In channels 0 to 2, when the input clock is the on-chip RTC output clock (RTCCLK), TCNT...
  • Page 334 2. Channel 2 TCR bit configuration Bit: — — — — — — ICPF Initial value: R/W: Bit: ICPE1 ICPE0 UNIE CKEG1 CKEG0 TPSC2 TPSC1 TPSC0 Initial value: R/W: 3. Channel 3 and 4 TCR bit configuration Bit: — — —...
  • Page 335 Bit 8—Underflow Flag (UNF): Status flag that indicates the occurrence of underflow. Bit 8: UNF Description TCNT has not underflowed (Initial value) [Clearing condition] When 0 is written to UNF TCNT has underflowed [Setting condition] When TCNT underflows* Note: * Writing 1 does not change the value. Bits 7 and 6—Input Capture Control (ICPE1, ICPE0) (Channel 2 Only): 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.
  • Page 336: Input Capture Register (Tcpr2)

    Bit 5: UNIE Description Interrupt due to underflow (TUNI) is not enabled (Initial value) Interrupt due to underflow (TUNI) is enabled Bits 4 and 3—Clock Edge 1 and 0 (CKEG1, CKEG0): In channels 0 to 2, these bits select the external clock input edge when an external clock is selected or the input capture function is used.
  • Page 337: Operation

    TCPR2 is not initialized by a power-on or manual reset, or in standby mode. Bit: · · · · · · · · · · · · · Initial value: Undefined R/W: 12.3 Operation Each channel has a 32-bit timer counter (TCNT) that performs count-down operations, and a 32- bit timer constant register (TCOR).
  • Page 338: Figure 12.2 Example Of Count Operation Setting Procedure

    Operation selection Select count clock Underflow interrupt generation setting When input capture function is used Input capture interrupt generation setting Timer constant register setting Set initial timer counter value Start count Note: When an interrupt is generated, clear the source flag in the interrupt handler. If the interrupt enabled state is set without clearing the flag, another interrupt will be generated.
  • Page 339: Figure 12.4 Count Timing When Operating On Internal Clock

    TCNT Count Timing: Operating on internal clock Any of five count clocks (P /4, P /16, P /64, P /256, or P /1024) scaled from the peripheral module clock can be selected as the count clock by means of the TPSC2–TPSC0 bits in TCR. Figure 12.4 shows the timing in this case.
  • Page 340: Input Capture Function

    RTC output clock N + 1 N – 1 TCNT Figure 12.6 Count Timing when Operating on On-Chip RTC Output Clock 12.3.2 Input Capture Function Channel 2 has an input capture function. The procedure for using the input capture function is as follows: 1.
  • Page 341: Interrupts

    TCOR value set in TCNT TCNT value on underflow TCOR H'00000000 Time TCLK TCNT value set TCPR2 TICPI2 Figure 12.7 Operation Timing when Using Input Capture Function 12.4 Interrupts There are four TMU interrupt sources, comprising underflow interrupts and the input capture interrupt (when the input capture function is used).
  • Page 342: Usage Notes

    Table 12.3 TMU Interrupt Sources Channel Interrupt Source Description TUNI0 Underflow interrupt 0 TUNI1 Underflow interrupt 1 TUNI2 Underflow interrupt 2 TICPI2 Input capture interrupt 2 TUNI3 Underflow interrupt 3 TUNI4 Underflow interrupt 4 12.5 Usage Notes 12.5.1 Register Writes When performing a TMU register write, timer count operation must be stopped by clearing the start bit (STR0–STR4) for the relevant channel in the timer start register (TSTR, TSTR2).
  • Page 343 Rev. 3.0, 04/02, page 304 of 1064...
  • Page 344: Section 13 Bus State Controller (Bsc)

    The BSC functions allow DRAM, synchronous DRAM, SRAM, ROM, etc., to be connected to the SH7751 Series and also support the PCMCIA interface protocol, enabling system design to be simplified and data transfers to be carried out at high speed by a compact system.
  • Page 345 Consecutive accesses to the same row address Connectable area: 3 Settable bus widths: 32, 16 Synchronous DRAM interface Row address/column address multiplexing according to synchronous DRAM capacity Burst operation Auto-refresh and self-refresh Synchronous DRAM control signal timing can be controlled by register settings Consecutive accesses to the same row address Connectable areas: 2, 3 Settable bus widths: 32...
  • Page 346: Block Diagram

    13.1.2 Block Diagram Figure 13.1 shows a block diagram of the BSC. interface WCR1 Wait control unit WCR2 WCR3 BCR1 – Area control unit – BCR2 BCR3 * BCR4 * – Memory control unit RFCR RTCNT Refresh Interrupt Comparator control unit controller RTCOR RTCSR...
  • Page 347: Pin Configuration

    13.1.3 Pin Configuration Table 13.1 shows the BSC pin configuration. Table 13.1 BSC Pins Name Signals Description Address bus A25–A0 Address output Data bus D31–D0 Data input/output Bus cycle start Signal that indicates the start of a bus cycle When setting synchronous DRAM interface or MPX interface: asserted once for a burst transfer For other burst transfers: asserted each data cycle Chip select 6–0...
  • Page 348 Table 13.1 BSC Pins (cont) Name Signals Description Column address /DQM0 When setting DRAM interface: signal for strobe 0 D7–D0 When setting synchronous DRAM interface: selection signal for D7–D0 Column address /DQM1 When setting DRAM interface: signal for strobe 1 D15–D8 When setting synchronous DRAM interface:...
  • Page 349: Register Configuration

    The BSC has the 11 registers shown in table 13.2. In addition, the synchronous DRAM mode register incorporated in synchronous DRAM can also be accessed as an SH7751 Series register. The functions of these registers include control of interfaces to various types of memory, wait states, and refreshing.
  • Page 350: Overview Of Areas

    (MMU). Details are given in section 3, Memory Management Unit (MMU). This section describes the areas into which the external address is divided. With the SH7751 Series, various kinds of memory or PC cards can be connected to the seven areas of external address as shown in table 13.3, and chip select signals (...
  • Page 351: Table 13.3 External Memory Space Map

    Table 13.3 External Memory Space Map External Connectable Settable Bus Area Addresses Size Memory Widths Access Size H'00000000– 64 Mbytes SRAM 8, 16, 32* 8, 16, 32, H'03FFFFFF bits, Burst ROM 8, 16, 32* 32 bytes H'04000000– 64 Mbytes SRAM 8, 16, 32* 8, 16, 32, H'07FFFFFF...
  • Page 352: Figure 13.3 External Memory Space Allocation

    Figure 13.3 External Memory Space Allocation Memory Bus Width: In the SH7751 Series, the memory bus width can be set independently for each space. For area 0, a bus size of 8, 16, or 32 bits can be selected in a power-on reset by means...
  • Page 353: Pcmcia Support

    The area 7 address range, H'1C000000 to H'1FFFFFFFF, is a reserved space and must not be used. 13.1.6 PCMCIA Support The SH7751 Series supports PCMCIA interface specifications for external memory space areas 5 and 6. The interfaces supported are the IC memory card interface and I/O card interface stipulated in JEIDA specifications version 4.2 (PCMCIA2.1).
  • Page 354: Table 13.5 Pcmcia Support Interfaces

    Table 13.5 PCMCIA Support Interfaces IC Memory Card Interface I/O Card Interface Corresponding Signal Signal SH7751 Series Name I/O Function Name I/O Function Ground Ground — I/O Data I/O Data I/O Data I/O Data I/O Data I/O Data I/O Data...
  • Page 355 Table 13.5 PCMCIA Support Interfaces (cont) IC Memory Card Interface I/O Card Interface Corresponding Signal Signal SH7751 Series Name I/O Function Name I/O Function Address Address I/O Data I/O Data I/O Data I/O Data I/O Data I/O Data ...
  • Page 356 Table 13.5 PCMCIA Support Interfaces (cont) IC Memory Card Interface I/O Card Interface Corresponding Signal Signal SH7751 Series Name I/O Function Name I/O Function Reserved Reserved — RESET Reset RESET Reset Output from port Wait request Wait request...
  • Page 357: Register Descriptions

    13.2 Register Descriptions 13.2.1 Bus Control Register 1 (BCR1) Bus control register 1 (BCR1) is a 32-bit readable/writable register that specifies the function, bus cycle status, etc., of each area. BCR1 is initialized to H'00000000 by a power-on reset, but is not initialized by a manual reset or in standby mode.
  • Page 358 Bit 31: ENDIAN Description In a power-on reset, the endian setting external pin (MD5) is low, designating big-endian mode for the SH7751 Series In a power-on reset, the endian setting external pin (MD5) is high, designating little-endian mode for the SH7751 Series Bit 30—Master/Slave Flag (MASTER): Samples the value of the master/slave specification...
  • Page 359 Bit 25—Control Input Pin Pull-Up Resistor Control (IPUP): Specifies the pull-up resistor status for control input pins (NMI, – , MD6/ ). IPUP is initialized by a power-on reset. Bit 25: IPUP Description Pull-up resistor is on for control input pins (NMI, –...
  • Page 360 Bit 19—BREQ Enable (BREQEN): Indicates whether external requests and bus requests from PCIC can be accepted. BREQEN is initialized to the external request and bus request from PCIC acceptance disabled state by a power-on reset. It is ignored in the case of a slave mode startup. The bus request from the PCIC is always accepted in a slave mode start up.
  • Page 361 Bit 14—High Impedance Control (HIZCNT): Specifies the state of the signals in standby mode and when the bus is released. Bit 14: HIZCNT Description /DQMn, and signals go to high- impedance (Hi-Z) in standby mode and when the bus is released (Initial value) ...
  • Page 362 Bits 10 to 8—Area 5 Burst Enable (A5BST2–A5BST0): These bits specify whether burst ROM interface is used in area 5. When burst ROM interface is used, they also specify the number of accesses in a burst. If area 5 is an MPX interface area, these bits are ignored. Bit 10: A5BST2 Bit 9: A5BST1 Bit 8: A5BST0...
  • Page 363 Bits 7 to 5—Area 6 Burst Enable (A6BST2–A6BST0): These bits specify whether burst ROM interface is used in area 6. When burst ROM is used, they also specify the number of accesses in a burst. If area 6 is an MPX interface area, these bits are ignored. Bit 7: A6BST2 Bit 6: A6BST1 Bit 5: A6BST0...
  • Page 364 Bits 4 to 2—Area 2 and 3 Memory Type (DRAMTP2–DRAMTP0): These bits specify the type of memory connected to areas 2 and 3. ROM, SRAM, flash ROM, etc., can be connected as SRAM interface. DRAM and synchronous DRAM can also be directly connected. Bit 4: DRAMTP2 Bit 3: DRAMTP1 Bit 2: DRAMTP0 Description Areas 2 and 3 are accessed as SRAM interface or MPX interface*...
  • Page 365: Bus Control Register 2 (Bcr2)

    13.2.2 Bus Control Register 2 (BCR2) Bus control register 2 (BCR2) is a 32-bit readable/writable register that specifies the bus width for each area, and whether a 16-bit port is used. BCR2 is initialized to H'3FFC by a power-on reset, but is not initialized by a manual reset or in standby mode.
  • Page 366: Bus Control Register 3 (Bcr3) (Sh7751R Only)

    Bits 2n + 1, 2n—Area n (1 to 6) Bus Width Specification (AnSZ1, AnSZ0): These bits specify the bus width of area n (n = 1 to 6). (Bit 0): PORTEN Bit 2n + 1: AnSZ1 Bit 2n: AnSZ0 Description Reserved (Setting prohibited) Bus width is 8 bits Bus width is 16 bits...
  • Page 367 Bit: Bit name: A1MPX A4MPX — — — — — MEMMODE Initial value: R/W: Bit: Bit name: — — — — — — — SDBL Initial value: R/W: Bit 15 A1MPX/A4MPX Enable (MEMMODE): Determines whether or not the selection of either the MPX interface or the SRAM interface is by A1MPX and A4MPX rather than by MEMMPX.
  • Page 368: Bus Control Register 4 (Bcr4) (Sh7751R Only)

    13.2.4 Bus Control Register 4 (BCR4) (SH7751R Only) Bus control register 4 (BCR4) is a register that enables asynchronous input for pins corresponding to individual bits. The BCR4 register is a 32-bit readable/writable register. It is initialized to H'00000000 by a power-on reset, but is not initialized by a manual reset or in standby mode.
  • Page 369 Bits 4 to 0—Asynchronous Input: These bits enable asynchronous input for the corresponding pins. Bit 4–0: ASYNCn Description Corresponding pin is synchronous input with respect to CKIO (Initial value) Asynchronous input with respect to CKIO is enabled for corresponding pin ...
  • Page 370: Wait Control Register 1 (Wcr1)

    In the SH7751 Series, the number of idle cycles set in the WCR1 register are inserted automatically if there is a possibility of this kind of data bus collision.
  • Page 371 same device. The DMAIW bits are valid only for DMA single address transfer; with DMA dual address transfer, inter-area idle cycles are inserted. Bits 4n + 2 to 4n—Area n (6 to 0) Inter-Cycle Idle Specification (AnlW2–AnlW0): These bits specify the number of idle cycles between bus cycles to be inserted when switching from external memory space area n (n = 6 to 0) to another space, or from a read access to a write access in the same space.
  • Page 372: Table 13.6 Idle Insertion Between Accesses

    Table 13.6 Idle Insertion between Accesses Following Cycle Same Different Same Area Different Area Area Area Read Write Read Write Preceding Address Address Cycle CPU DMA CPU DMA CPU DMA CPU DMA Output Output Read M (1) M (1) Write DMA read —...
  • Page 373: Wait Control Register 2 (Wcr2)

    13.2.6 Wait Control Register 2 (WCR2) Wait control register 2 (WCR2) is a 32-bit readable/writable register that specifies the number of wait states to be inserted for each area. It also specifies the data access pitch when performing burst memory access. This enables low-speed memory to be connected without using external circuitry.
  • Page 374 Bits 31 to 29—Area 6 Wait Control (A6W2–A6W0): These bits specify the number of wait states to be inserted for area 6. For the case where an MPX interface setting is made, see table 13.7. Description First Cycle Bit 31: A6W2 Bit 30: A6W1 Bit 29: A6W0 Inserted Wait States...
  • Page 375 Bits 25 to 23—Area 5 Wait Control (A5W2–A5W0): These bits specify the number of wait states to be inserted for area 5. For the case where an MPX interface setting is made, see table 13.7. Description First Cycle Bit 25: A5W2 Bit 24: A5W1 Bit 23: A5W0 Inserted Wait States...
  • Page 376 Bits 19 to 17—Area 4 Wait Control (A4W2–A4W0): These bits specify the number of wait states to be inserted for area 4. For the case where an MPX interface setting is made, see table 13.7. Description Bit 19: A4W2 Bit 18: A4W1 Bit 17: A4W0 Inserted Wait States Ignored...
  • Page 377 When DRAM or Synchronous DRAM Interface is Set* Note: * External wait input is always ignored Description DRAM Synchronous DRAM Bit 15: A3W2 Bit 14: A3W1 Bit 13: A3W0 Assertion Width Latency Cycles Inhibited Inhibited Inhibited Note: * Inhibited in RAS down mode Bits 11 to 9—Area 2 Wait Control (A2W2–A2W0): These bits specify the number of wait states to be inserted for area 2.
  • Page 378 When Synchronous DRAM Interface is Set * Description Bit 11: A2W2 Bit 10: A2W1 Bit 9: A2W0 Synchronous DRAM Latency Cycles Inhibited Inhibited Inhibited Notes: *1 External wait input is always ignored *2 Inhibited in RAS down mode Bits 8 to 6—Area 1 Wait Control (A1W2–A1W0): These bits specify the number of wait states to be inserted for area 1.
  • Page 379 Bits 5 to 3—Area 0 Wait Control (A0W2 to A0W0): These bits specify the number of wait states to be inserted for area 0. For the case where an MPX interface setting is made, see table 13.7. Description First Cycle Bit 5: A0W2 Bit 4: A0W1 Bit 3: A0W0...
  • Page 380: Table 13.7 When Mpx Interface Is Set (Areas 0 To 6)

    Table 13.7 When MPX Interface is Set (Areas 0 to 6) Description Inserted Wait States 1st Data 2nd Data AnW2 AnW1 AnW0 Read Write Onward Enabled Enabled Enabled Enabled Enabled Enabled Enabled Enabled (n = 6 to 0) Rev. 3.0, 04/02, page 341 of 1064...
  • Page 381: Wait Control Register 3 (Wcr3)

    R/W* Note: * These bits can be set only in the SH7751R. Bits 31 to 27, 23, 19*, 15, 11, 7*, and 3 (SH7751) Bits 31 to 27, 23, 15, 11, and 3 (SH7751R) Reserved: These bits are always read as 0, and should only be written with 0.
  • Page 382 Bit 4n + 2—Area n (6 to 0) Write Strobe Setup Time (AnS0): Specifies the number of cycles inserted in the setup time from the address until assertion of the read/write strobe. Valid only for SRAM interface, byte control SRAM interface, and burst ROM interface: Bit 4n + 2: AnS0 Waits Inserted in Setup (Initial value)
  • Page 383: Memory Control Register (Mcr)

    13.2.8 Memory Control Register (MCR) The memory control register (MCR) is a 32-bit readable/writable register that specifies timing and burst control for DRAM and synchronous DRAM (areas 2 and 3), address multiplexing, and refresh control. This enables DRAM and synchronous DRAM to be connected without using external circuitry.
  • Page 384 Bit 31—RAS Down (RASD): Sets RAS down mode. When RAS down mode is used, set BE to 1. Do not set RAS down mode in slave mode or partial-sharing mode, or when areas 2 and 3 are both designated as synchronous DRAM interface. Bit 31: RASD Description Normal mode...
  • Page 385 Bits 21 to 19—RAS Precharge Period (TPC2–TPC0): When the DRAM interface is set, these bits specify the minimum number of cycles until is asserted again after being negated. When the synchronous DRAM interface is set, these bits specify the minimum number of cycles until the next bank active command is output after precharging.
  • Page 386 Bit 15: TRWL2 Bit 14: TRWL1 Bit 13: TRWL0 Write Precharge ACT Delay Time 1 (Initial value) Reserved (Setting prohibited) Reserved (Setting prohibited) Reserved (Setting prohibited) Note: * Inhibited in RAS down mode Bits 12 to 10—CAS-Before-RAS Refresh Assertion Period (TRAS2–TRAS0): When the DRAM interface is set, these bits set the assertion period in CAS-before-RAS refreshing.
  • Page 387 EDOMODE 8/16/32/64-Bit Transfer 32-Byte Transfer Single Single Setting prohibited Setting prohibited Single/fast page* Fast page Note: * In fast page mode, 32-bit or 64-bit transfer with a 16-bit bus, 64-bit transfer with a 32-bit bus Bits 8 and 7—Memory Data Size (SZ1, SZ0): These bits specify the bus width of DRAM and synchronous DRAM.
  • Page 388 For Synchronous DRAM Interface: Example Synchronous DRAM AMXEXT Configurations BANK (16M: 512k 16 bits a[21]* (16M: 512k 16 bits a[20]* (16M: 1M 8 bits a[22]* (16M: 1M 8 bits a[21]* — (64M: 1M 16 bits a[23:22]* — (64M: 2M 8 bits a[24:23]* —...
  • Page 389: Pcmcia Control Register (Pcr)

    Bit 0—EDO Mode (EDOMODE): Used to specify the data sampling timing for data reads when using EDO mode DRAM interface. The setting of this bit does not affect the operation timing of memory other than DRAM. Set this bit to 1 only when DRAM is used. 13.2.9 PCMCIA Control Register (PCR) The PCMCIA control register (PCR) is a 16-bit readable/writable register that specifies the...
  • Page 390 Bit 13: A6PCW1 Bit 12: A6PCW0 Waits Inserted 0 (Initial value) Bits 11 to 9—Address-OE/WE Assertion Delay (A5TED2–A5TED0): These bits set the delay time from address output to assertion on the connected PCMCIA interface. The setting of these bits is selected when the PCMCIA interface access TC bit is 0. Bit 11: A5TED2 Bit 10: A5TED1 Bit 9: A5TED0...
  • Page 391: Synchronous Dram Mode Register (Sdmr)

    Bit 5: A5TEH2 Bit 4: A5TEH1 Bit 3: A5TEH0 Waits Inserted 0 (Initial value) Bits 2 to 0—OE/WE Negation-Address Delay (A6TEH2–A6TEH0): These bits set the address hold delay time from negation in a write on the connected PCMCIA interface or in an I/O card read.
  • Page 392 DRAM bus width is set to 32 bits, as A0 of the synchronous DRAM is connected to A2 of the SH7751 Series, and A1 of the synchronous DRAM is connected to A3 of the SH7751 Series, the value actually written to the synchronous DRAM is the value of “X” shifted 2 bits to the right.
  • Page 393: Refresh Timer Control/Status Register (Rtcsr)

    For a 32-bit bus: Address WT BL2 BL1 BL0 10 bits set in case of 32-bit bus width LMODE: RAS-CAS latency Burst length Wrap type (0: Sequential) LMODE 000: Reserved 000: Reserved 001: Reserved 001: 1 010: 4 010: 2 011: 8* 011: 3 100: Reserved...
  • Page 394 Bits 15 to 8—Reserved: These bits are always read as 0. For the write values, see section 13.2.15, Notes on Accessing Refresh Control Registers. Bit 7—Compare-Match Flag (CMF): Status flag that indicates a match between the refresh timer counter (RTCNT) and refresh time constant register (RTCOR) values. Bit 7: CMF Description RTCNT and RTCOR values do not match...
  • Page 395: Refresh Timer Counter (Rtcnt)

    Bit 2—Refresh Count Overflow Flag (OVF): Status flag that indicates that the number of refresh requests indicated by the refresh count register (RFCR) has exceeded the number specified by the LMTS bit in RTCSR. Bit 2: OVF Description RFCR has not overflowed the count limit indicated by LMTS (Initial value) [Clearing condition] When 0 is written to OVF...
  • Page 396: Refresh Time Constant Register (Rtcor)

    Bit: — — — — — — — — Initial value: R/W: — — — — — — — — Bit: Initial value: R/W: 13.2.13 Refresh Time Constant Register (RTCOR) The refresh time constant register (RTCOR) is a readable/writable register that specifies the upper limit of the RTCNT counter.
  • Page 397: Refresh Count Register (Rfcr)

    13.2.14 Refresh Count Register (RFCR) The refresh count register (RFCR) is a 10-bit readable/writable counter that counts the number of refreshes by being incremented each time the RTCOR register and RTCNT counter values match. If the RFCR register value exceeds the count limit specified by the LMTS bit in the RTCSR register, the OVF flag is set in the RTCSR register and the RFCR register is cleared.
  • Page 398: Operation

    13.3.1 Endian/Access Size and Data Alignment The SH7751 Series supports both big-endian mode, in which the most significant byte (MSByte) is at the 0 address end in a string of byte data, and little-endian mode, in which the least significant byte (LSByte) is at the 0 address end.
  • Page 399: Table 13.8 32-Bit External Device/Big-Endian Access And Data Alignment

    Data Configuration Byte Data 7–0 Word Data 15–8 Data 7–0 Longword Data 31–24 Data 23–16 Data 15–8 Data 7–0 Quadword Data Data Data Data Data Data Data Data 63–56 55–48 47–40 39–32 31–24 23–16 15–8 7–0 Table 13.8 32-Bit External Device/Big-Endian Access and Data Alignment Operation Data Bus Strobe Signals...
  • Page 400: Table 13.9 16-Bit External Device/Big-Endian Access And Data Alignment

    Table 13.9 16-Bit External Device/Big-Endian Access and Data Alignment Operation Data Bus Strobe Signals Access Size Address No. D31–D24 D23–D16 D15–D8 D7–D0 DQM3 DQM2 DQM1 DQM0 Byte — — Data — Asserted 7–0 2n+1 —...
  • Page 401: Table 13.10 8-Bit External Device/Big-Endian Access And Data Alignment

    Table 13.10 8-Bit External Device/Big-Endian Access and Data Alignment Operation Data Bus Strobe Signals Access Size Address No. D31–D24 D23–D16 D15–D8 D7–D0 DQM3 DQM2 DQM1 DQM0 Byte — — — Data Asserted 7–0 Word —...
  • Page 402: Table 13.11 32-Bit External Device/Little-Endian Access And Data Alignment

    Table 13.11 32-Bit External Device/Little-Endian Access and Data Alignment Operation Data Bus Strobe Signals Access Size Address No. D31–D24 D23–D16 D15–D8 D7–D0 DQM3 DQM2 DQM1 DQM0 Byte — — Data Asserted 7–0 4n+1 —...
  • Page 403: Table 13.12 16-Bit External Device/Little-Endian Access And Data Alignment

    Table 13.12 16-Bit External Device/Little-Endian Access and Data Alignment Operation Data Bus Strobe Signals Access Size Address No. D31–D24 D23–D16 D15–D8 D7–D0 DQM3 DQM2 DQM1 DQM0 Byte — — — Data Asserted 7–0 2n+1 —...
  • Page 404: Table 13.13 8-Bit External Device/Little-Endian Access And Data Alignment

    Table 13.13 8-Bit External Device/Little-Endian Access and Data Alignment Operation Data Bus Strobe Signals Access Size Address No. D31–D24 D23–D16 D15–D8 D7–D0 DQM3 DQM2 DQM1 DQM0 Byte — — — Data Asserted 7–0 Word —...
  • Page 405: Areas

    13.3.2 Areas Area 0: For area 0, external address bits A28 to A26 are 000. SRAM, MPX, and burst ROM can be set for this area. A bus width of 8, 16, or 32 bits can be selected in a power-on reset by means of external pins MD4 and MD3.
  • Page 406 Area 2: For area 2, external address bits A28 to A26 are 010. SRAM, MPX, and synchronous DRAM can be set to this area. When SRAM interface is set, a bus width of 8, 16, or 32 bits can be selected with bits A2SZ1 and A2SZ0 in the BCR2 register.
  • Page 407 The read/write strobe signal address and setup and hold times can be set within a range of 0–1 and 0–3 cycles, respectively, by means of bit A3S0 and bits A3H1 and A3H0 in the WCR3 register. When synchronous DRAM interface is set, the signals, RD/ signal, and byte control signals DQM0 to DQM3 are asserted, and address multiplexing is performed.
  • Page 408 , and the , and signals, which can be used as , and , respectively, are asserted. As regards the number of bus cycles, from 0 to 15 waits can be selected with bits A5W2 to A5W0 in the WCR2 register. In addition, any number of waits can be inserted in each bus cycle by means of the external wait pin ( When the burst function is used, the number of burst cycle transfer states is determined in the range 2 to 9 according to the number of waits.
  • Page 409: Sram Interface

    13.3.3 SRAM Interface Basic Timing: The SRAM interface of the SH7751 Series uses strobe signal output in consideration of the fact that mainly SRAM will be connected. Figure 13.6 shows the SRAM timing of normal space accesses. A no-wait normal access is completed in two cycles. The signal is asserted for one cycle to indicate the start of a bus cycle.
  • Page 410: Figure 13.6 Basic Timing Of Sram Interface

    CKIO A25–A0 D31–D0 (read) D31–D0 (write) DACKn (SA: IO ← memory) DACKn (SA: IO → memory) DACKn (DA) Single address DMA Dual address DMA Figure 13.6 Basic Timing of SRAM Interface Rev. 3.0, 04/02, page 371 of 1064...
  • Page 411: Figure 13.7 Example Of 32-Bit Data Width Sram Connection

    Figures 13.7, 13.8, and 13.9 show examples of connection to 32-, 16-, and 8-bit data width SRAM. 128k × 8-bit SH7751 Series SRAM I/O7 I/O0 I/O7 I/O0 I/O7 I/O0 I/O7 I/O0 Figure 13.7 Example of 32-Bit Data Width SRAM Connection...
  • Page 412: Figure 13.8 Example Of 16-Bit Data Width Sram Connection

    128k × 8-bit SH7751 Series SRAM I/O7 I/O0 I/O7 I/O0 Figure 13.8 Example of 16-Bit Data Width SRAM Connection Rev. 3.0, 04/02, page 373 of 1064...
  • Page 413: Figure 13.9 Example Of 8-Bit Data Width Sram Connection

    128k × 8-bit SH7751 Series SRAM I/O7 I/O0 Figure 13.9 Example of 8-Bit Data Width SRAM Connection Wait State Control: Wait state insertion on the SRAM interface can be controlled by the WCR2 settings. If the WCR2 wait specification bits corresponding to a particular area are not zero, a software wait is inserted in accordance with that specification.
  • Page 414: Figure 13.10 Sram Interface Wait Timing (Software Wait Only)

    CKIO A25–A0 D31–D0 (read) D31–D0 (write) DACKn (SA: IO ← memory) DACKn (SA: IO → memory) DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.10 SRAM Interface Wait Timing (Software Wait Only) Rev.
  • Page 415: Figure 13.11 Sram Interface Wait State Timing (Wait State Insertion By Signal)

    When software wait insertion is specified by WCR2, the external wait input signal is also sampled. signal sampling is shown in figure 13.11. A single-cycle wait is specified as a software wait. Sampling is performed at the transition from the Tw state to the T2 state; therefore, signal has no effect if asserted in the T1 cycle or the first Tw cycle.
  • Page 416: Figure 13.12 Sram Interface Wait State Timing (Read Strobe Negate Timing Setting)

    Read-Strobe Negate Timing (Setting Only Possible in the SH7751R): When the SRAM interface is used, timing for the negation of the strobe during read operations can be specified by the setting of the A1RDH and A4RDH bits of the WCR3 register. For information about this setting, see the description of the WCR3 register.
  • Page 417: Dram Interface

    Direct Connection of DRAM: When the memory type bits (DRAMTP2–0) in BCR1 are set to 100, area 3 becomes DRAM interface. The DRAM interface function can then be used to connect DRAM to the SH7751 Series. 16 or 32 bits can be selected as the interface data width.
  • Page 418: Table 13.14 Relationship Between Amxext And Amx2-0 Bits And Address Multiplexing

    DRAM. This enables DRAM, which requires row and column address multiplexing, to be connected to the SH7751 Series without using an external address multiplexer circuit. Any of the five multiplexing methods shown below can be selected, by setting bits AMXEXT and AMX2–0 in MCR.
  • Page 419: Figure 13.14 Basic Dram Access Timing

    Basic Timing: The basic timing for DRAM access is 4 cycles. This basic timing is shown in figure 13.14. Tpc is the precharge cycle, Tr the assert cycle, Tc1 the assert cycle, and Tc2 the read data latch cycle. CKIO Address Column D31–D0...
  • Page 420: Figure 13.15 Dram Wait State Timing

    Wait State Control: As the clock frequency increases, it becomes impossible to complete all states in one cycle as in basic access. Therefore, provision is made for state extension by using the setting bits in WCR2 and MCR. The timing with state extension using these settings is shown in figure 13.15.
  • Page 421: Figure 13.16 Dram Burst Access Timing

    Burst Access: In addition to the normal DRAM access mode in which a row address is output in each data access, a fast page mode is also provided for the case where consecutive accesses are made to the same row. This mode allows fast access to data by outputting the row address only once, then changing only the column address for each subsequent access.
  • Page 422: Figure 13.17 Dram Bus Cycle (Edo Mode, Rcd = 0, Anw = 0, Tpc = 1)

    In the SH7751 Series, the EDO mode bit (EDOMODE) in MCR enables either normal access/burst access using fast page mode, or EDO mode normal access/burst access, to be selected for DRAM.
  • Page 423: Figure 13.18 Burst Access Timing In Dram Edo Mode

    Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.18 Burst Access Timing in DRAM EDO Mode RAS Down Mode: The SH7751 Series has an address comparator for detecting row address matches in burst mode. By using this address comparator, and also setting RAS down mode...
  • Page 424: Figure 13.19(1) Dram Burst Bus Cycle, Ras Down Mode Start (Fast Page Mode, Rcd = 0, Anw = 0)

    CKIO Address D31–D0 (read) D31–D0 (write) DACKn (SA: IO ← memory) DACKn (SA: IO → memory) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.19(1) DRAM Burst Bus Cycle, RAS Down Mode Start (Fast Page Mode, RCD = 0, AnW = 0) Rev.
  • Page 425: Figure 13.19(2) Dram Burst Bus Cycle, Ras Down Mode Continuation (Fast Page Mode, Rcd = 0, Anw = 0)

    Tnop CKIO Address End of RAS down mode D31–D0 (read) D31–D0 (write) DACKn (SA: IO ← memory) DACKn (SA: IO → memory) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.19(2) DRAM Burst Bus Cycle, RAS Down Mode Continuation (Fast Page Mode, RCD = 0, AnW = 0) Rev.
  • Page 426: Figure 13.19(3) Dram Burst Bus Cycle, Ras Down Mode Start (Edo Mode, Rcd = 0, Anw = 0)

    CKIO Address D31–D0 (read) DACKn (SA: IO ← memory) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.19(3) DRAM Burst Bus Cycle, RAS Down Mode Start (EDO Mode, RCD = 0, AnW = 0) Rev.
  • Page 427: Figure 13.19(4) Dram Burst Bus Cycle, Ras Down Mode Continuation (Edo Mode, Rcd = 0, Anw = 0)

    Tnop CKIO Address End of RAS down mode D31–D0 (read) DACKn (SA: IO ← memory) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.19(4) DRAM Burst Bus Cycle, RAS Down Mode Continuation (EDO Mode, RCD = 0, AnW = 0) Rev.
  • Page 428: Figure 13.20 Cas-Before-Ras Refresh Operation

    refresh request is generated and the pin goes high. If the SH7751 Series external bus can be used, CAS-before-RAS refreshing is performed. At the same time, RTCNT is cleared to zero and the count-up is restarted. Figure 13.20 shows the operation of CAS-before-RAS refreshing.
  • Page 429: Figure 13.21 Dram Cas-Before-Ras Refresh Cycle Timing (Tras = 0, Trc = 1)

    Figure 13.21 DRAM CAS-Before-RAS Refresh Cycle Timing (TRAS = 0, TRC = 1) Self-Refresh The self-refreshing supported by the SH7751 Series is shown in figure 13.22. After the self-refresh is cleared, the refresh controller immediately generates a refresh request. The RAS precharge time immediately after the end of the self-refreshing can be set by bits TRC2–TRC0 in MCR.
  • Page 430 Therefore, normal refreshing can be performed by having the pin monitored by a bus master other than the SH7751 Series requesting the bus, or the bus arbiter, and returning the bus to the SH7751 Series. Rev. 3.0, 04/02, page 391 of 1064...
  • Page 431: Figure 13.22 Dram Self-Refresh Cycle Timing

    TRr1 TRr2 TRr3 TRr4 TRr5 CKIO A25–A0 D63–D0 Figure 13.22 DRAM Self-Refresh Cycle Timing Power-On Sequence: Regarding use of DRAM after powering on, it is requested that a wait time (at least 100 s or 200 s) during which no access can be performed be provided, followed by at least the prescribed number (usually 8) of dummy CAS-before-RAS refresh cycles.
  • Page 432: Synchronous Dram Interface

    DRAM interface; if set to 011, areas 2 and 3 are both synchronous DRAM interface. The SH7751 Series supports burst read and burst write operations with a burst length of 4 as a synchronous DRAM operating mode. The data bus width is 32 bit, and the SZ size bits in MCR must be set to 11.
  • Page 433: Figure 13.23 Example Of 32-Bit Data Width Synchronous Dram Connection (Area 3)

    When A0, the LSB of the synchronous DRAM address, is connected to the SH7751 Series, it makes a longword address specification. Connection should therefore be made in this order: connect pin A0 of the synchronous DRAM to pin A2 of the SH7751 Series, then connect pin A1 to pin A3.
  • Page 434: Table 13.15 Example Of Correspondence Between Sh7751 Series And Synchronous Dram

    READA command inside the synchronous DRAM; no new access command can be issued to the same bank during this cycle. In the SH7751 Series, the number of Tpc cycles is determined by the specification of bits TPC2–TPC0 in MCR, and commands are not issued for the synchronous DRAM during this interval.
  • Page 435: Figure 13.24 Basic Timing For Synchronous Dram Burst Read

    Figure 13.24 Basic Timing for Synchronous DRAM Burst Read Rev. 3.0, 04/02, page 396 of 1064...
  • Page 436 READA command reads the 16 bytes of data, which is the remainder of the data between 32-byte boundaries. Single Read: With the SH7751 Series, as synchronous DRAM is set to burst read/burst write mode, read data output continues after the required data has been read. To prevent data collisions, after the required data is read in Td1, empty read cycles Td2 to Td4 are performed, and the SH7751 Series waits for the end of the synchronous DRAM operation.
  • Page 437: Figure 13.25 Basic Timing For Synchronous Dram Single Read

    Figure 13.25 Basic Timing for Synchronous DRAM Single Read Burst Write: The timing chart for a burst write is shown in figure 13.26. In the SH7751 Series, a burst write occurs only in the event of 32-byte transfer. In a burst write operation, the WRIT command is issued in the Tc1 cycle following the Tr cycle in which the ACTV command is output and, 4 cycles later, the WRITA command is issued.
  • Page 438: Figure 13.26 Basic Timing For Synchronous Dram Burst Write

    Figure 13.26 Basic Timing for Synchronous DRAM Burst Write Rev. 3.0, 04/02, page 399 of 1064...
  • Page 439 The number of Trwl cycles can be specified by bits TRWL2–TRWL0 in MCR. DACK is asserted two cycles before the data write cycle. The SH7751 Series supports burst-length 4 burst read and burst write operations of synchronous DRAM. A wait cycle is therefore generated even with single write operations.
  • Page 440: Figure 13.27 Basic Timing For Synchronous Dram Single Write

    Trw1 Trw1 CKIO Bank Precharge-sel Address RD/WR CASS DQMn D31–D0 (write) DACKn (SA: IO → memory) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.27 Basic Timing for Synchronous DRAM Single Write Rev.
  • Page 441 RAS Down Mode: The synchronous DRAM bank function is used to support high-speed accesses to the same row address. When the RASD bit in MCR is 1, read/write command accesses are performed using commands without auto-precharge (READ, WRIT). In this case, precharging is not performed when the access ends.
  • Page 442: Figure 13.28 Burst Read Timing

    Figure 13.28 Burst Read Timing Rev. 3.0, 04/02, page 403 of 1064...
  • Page 443: Figure 13.29 Burst Read Timing (Ras Down, Same Row Address)

    Tc3 Tc4/Td1 CKIO Bank Precharge-sel Address DQMn D31–D0 (read) DACKn (SA: IO ← memory) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.29 Burst Read Timing (RAS Down, Same Row Address) Rev.
  • Page 444: Figure 13.30 Burst Read Timing (Ras Down, Different Row Addresses)

    Figure 13.30 Burst Read Timing (RAS Down, Different Row Addresses) Rev. 3.0, 04/02, page 405 of 1064...
  • Page 445: Figure 13.31 Burst Write Timing

    Figure 13.31 Burst Write Timing Rev. 3.0, 04/02, page 406 of 1064...
  • Page 446: Figure 13.32 Burst Write Timing (Same Row Address)

    Figure 13.32 Burst Write Timing (Same Row Address) Rev. 3.0, 04/02, page 407 of 1064...
  • Page 447: Figure 13.33 Burst Write Timing (Different Row Addresses)

    Figure 13.33 Burst Write Timing (Different Row Addresses) Pipelined Access: When the RASD bit is set to 1 in MCR, pipelined access is performed between an access by the CPU and an access by the DMAC, or in the case of consecutive accesses by the DMAC, to provide faster access to synchronous DRAM.
  • Page 448: Table 13.16 Cycles In Which Pipelined Access Can Be Used

    possible to issue a PRE, ACTV, or other command during the CAS latency cycle or data latch cycle, or during the data write cycle, and so shorten the access cycle. When a read access is followed by another read access to the same row address, after a READ command has been issued, another READ command is issued before the end of the data latch cycle, so that there is read data on the data bus continuously.
  • Page 449: Figure 13.34 Burst Read Cycle For Different Bank And Row Address Following Preceding Burst Read Cycle

    Figure 13.34 Burst Read Cycle for Different Bank and Row Address Following Preceding Burst Read Cycle Rev. 3.0, 04/02, page 410 of 1064...
  • Page 450: Figure 13.35 Auto-Refresh Operation

    Refreshing: The bus state controller is provided with a function for controlling synchronous DRAM refreshing. Auto-refreshing can be performed by clearing the RMODE bit to 0 and setting the RFSH bit to 1 in MCR. If synchronous DRAM is not accessed for a long period, self-refresh mode, in which the power consumption for data retention is low, can be activated by setting both the RMODE bit and the RFSH bit to 1.
  • Page 451: Figure 13.36 Synchronous Dram Auto-Refresh Timing

    RTCNT value 1 less than the RTCOR value will enable refreshing to be started immediately. After self-refreshing has been set, the self-refresh state continues even if the chip standby state is entered using the SH7751 Series standby function, and is maintained even after recovery from standby mode other than through a power-on reset.
  • Page 452: Figure 13.37 Synchronous Dram Self-Refresh Timing

    Therefore, normal refreshing can be performed by having the pin monitored by a bus master other than the SH7751 Series requesting the bus, or the bus arbiter, and returning the bus to the SH7751 Series. Rev. 3.0, 04/02, page 413 of 1064...
  • Page 453 To set burst read/burst write, CAS latency 1 to 3, wrap type = sequential, and burst length 4, 8*, supported by the SH7751 Series, arbitrary data is written by byte-size access to the following addresses.
  • Page 454: Figure 13.38(1) Synchronous Dram Mode Write Timing (Pall)

    Synchronous DRAM mode register setting should be executed once only after power-on reset and before synchronous DRAM access, and no subsequent changes should be made. TRp1 TRp2 TRp3 TRp4 TMw1 TMw2 TMw3 TMw4 TMw5 CKIO Bank Precharge-sel Address D31–D0 (High) Figure 13.38(1) Synchronous DRAM Mode Write Timing (PALL) Rev.
  • Page 455: Figure 13.38(2) Synchronous Dram Mode Write Timing (Mode Register Setting)

    TRp1 TRp2 TRp3 TRp4 TMw1 TMw2 TMw3 TMw4 TMw5 CKIO Bank Precharge-sel Address D31–D0 (High) Figure 13.38(2) Synchronous DRAM Mode Write Timing (Mode Register Setting) Changing the Burst Length (SH7751R Only): When synchronous DRAM is connected with the 32-bit memory bus of the SH7751R, a burst length of either 4 or 8 can be selected by the setting of the SDBL bit of the BCR3 register.
  • Page 456: Figure 13.39 Basic Timing Of A Burst Read From Synchronous Dram (Burst Length = 8)

    by the setting of the TPC2 to TPC0 bits of the MCR, and no command that operates on the synchronous DRAM is issued during these cycles. Figure 13.39 shows an example of the basic timing of a burst-read. To allow the connection of a lower-speed DRAM, the cycle’s period can be extended by the settings of the bits in WCR2 and MCR.
  • Page 457: Figure 13.40 Basic Timing Of A Burst Write To Synchronous Dram

    In a cycle of access to synchronous DRAM, the signal is asserted for one clock cycle at the beginning of a bus cycle. Data are accessed in the following sequence: in the fill operation for a cache miss, the data between the 32-bit boundaries that include the missed data are first read; after that, the data between 32-byte boundaries that include the missed data are read in a wraparound way.
  • Page 458: Burst Rom Interface

    13.3.6 Burst ROM Interface Setting bits A0BST2–A0BST0, A5BST2–A5BST0, and A6BST2–A6BST0 in BCR1 to a non- zero value allows burst ROM to be connected to areas 0, 5, and 6. The burst ROM interface provides high-speed access to ROM that has a burst access function. The timing for burst access to burst ROM is shown in figure 13.41.
  • Page 459: Figure 13.41 Burst Rom Basic Access Timing

    CKIO A25–A5 A4–A0 D31–D0 (read) DACKn (SA: IO ← memory) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.41 Burst ROM Basic Access Timing Rev. 3.0, 04/02, page 420 of 1064...
  • Page 460: Figure 13.42 Burst Rom Wait Access Timing

    CKIO A25–A5 A4–A0 D31–D0 (read) DACKn (SA: IO ← memory) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.42 Burst ROM Wait Access Timing CKIO A25–A5 A4–A0 D31–D0 (read) DACKn (SA: IO ← memory) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC.
  • Page 461: Pcmcia Interface

    13.3.7 PCMCIA Interface In the SH7751 Series, setting the A56PCM bit in BCR1 to 1 makes the bus interface for external memory space areas 5 and 6 an IC memory card interface or I/O card interface as stipulated in JEIDA specification version 4.2 (PCMCIA2.1).
  • Page 462 insertion specified by WCR2. AnTED2–AnTED0 can be set to a value from 0 to 15, enabling the address, , and setup times with respect to the signals to be secured. AnTEH2–AnTEH0 can also be set to a value from 0 to 15, enabling the address, , and...
  • Page 463: Table 13.17 Relationship Between Address And Ce When Using Pcmcia Interface

    Table 13.17 Relationship between Address and CE When Using PCMCIA Interface Access Width Read/ Size Odd/ (Bits) Write (Bits)* Even IOIS16 Access CE2 CE1 A0 D15–D8 D7–D0 Read Even Don’t — Invalid Read data care Don’t — Invalid Read data care Even Don’t...
  • Page 464 Table 13.17 Relationship between Address and CE When Using PCMCIA Interface (cont) Access Width Read/ Size Odd/ (Bits) Write (Bits)* Even IOIS16 Access CE2 CE1 A0 D15–D8 D7–D0 Dynamic Read Even — Invalid Read data — Read data Invalid sizing* Even —...
  • Page 465: Figure 13.44 Example Of Pcmcia Interface

    A25–A0 A25–A0 D15–D0 D7–D0 D15–D0 PC card D15–D8 (memory I/O) SH7751 Series Card detection CD1, CD2 circuit A25–A0 D7–D0 D15–D0 D15–D8 PC card (memory I/O) Card CD1, CD2 detection circuit Figure 13.44 Example of PCMCIA Interface Rev. 3.0, 04/02, page 426 of 1064...
  • Page 466: Figure 13.45 Basic Timing For Pcmcia Memory Card Interface

    Memory Card Interface Basic Timing: Figure 13.45 shows the basic timing for the PCMCIA memory card interface, and figure 13.46 shows the wait timing for the PCMCIA memory card interface. Tpcm1 Tpcm2 CKIO A25–A0 (read) D15–D0 (read) (write) D15–D0 (write) DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC.
  • Page 467: Figure 13.46 Wait Timing For Pcmcia Memory Card Interface

    Tpcm0 Tpcm0w Tpcm1 Tpcm1w Tpcm1w Tpcm2 Tpcm2w CKIO A25–A0 (read) D15–D0 (read) (write) D15–D0 (write) DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.46 Wait Timing for PCMCIA Memory Card Interface Rev.
  • Page 468: Figure 13.47 Pcmcia Space Allocation

    Common memory (64 MB) Virtual Access address space by CS5 wait External I/O controller addresses 1 kB IO 1 Virtual Access page address space by CS6 wait IO 1 controller Common IO 2 memory 1 Common Card 1 memory 2 on CS5 IO 2 Attribute memory...
  • Page 469: Figure 13.48 Basic Timing For Pcmcia I/O Card Interface

    Tpci1 Tpci2 CKIO A25–A0 (read) D15–D0 (read) (write) D15–D0 (write) DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.48 Basic Timing for PCMCIA I/O Card Interface Rev. 3.0, 04/02, page 430 of 1064...
  • Page 470: Figure 13.49 Wait Timing For Pcmcia I/O Card Interface

    Tpci0 Tpci0w Tpci1 Tpci1w Tpci1w Tpci2 Tpci2w CKIO A25–A0 (read) D15–D0 (read) (write) D15–D0 (write) DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.49 Wait Timing for PCMCIA I/O Card Interface Rev.
  • Page 471: Figure 13.50 Dynamic Bus Sizing Timing For Pcmcia I/O Card Interface

    Tpci2 Tpci2w Tpci0 Tpci Tpci1w Tpci2 Tpci2w Tpci0 Tpci Tpci1w CKIO A25–A1 (read) D15–D0 (read) (write) D15–D0 (write) DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.50 Dynamic Bus Sizing Timing for PCMCIA I/O Card Interface Rev.
  • Page 472: Mpx Interface

    13.3.8 MPX Interface If the MD6 pin is cleared to 0 in a power-on reset by means of the pin, the MPX interface is selected for area 0. The MPX interface is selected for areas 1 to 6 by means of the MPX bit in BCR1 and MEMMODE, A4MPX, and A1MPX in BCR3.
  • Page 473: Figure 13.51 Example Of 32-Bit Data Width Mpx Connection

    MPX device SH7751 Series CKIO D31–D0 I/O31–I/O0 Figure 13.51 Example of 32-Bit Data Width MPX Connection The MPX interface timing is shown below. When the MPX interface is used for areas 1 to 6, a bus size of 32 bit should be specified in BCR2.
  • Page 474: Figure 13.52 Mpx Interface Timing 1 (Single Read Cycle, Anw = 0, No External Wait)

    Tmd1w Tmd1 CKIO D31–D0 DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.52 MPX Interface Timing 1 (Single Read Cycle, AnW = 0, No External Wait) Rev. 3.0, 04/02, page 435 of 1064...
  • Page 475: Figure 13.53 Mpx Interface Timing 2 (Single Read, Anw = 0, One External Wait Inserted)

    Tmd1w Tmd1w Tmd1 CKIO D31–D0 DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.53 MPX Interface Timing 2 (Single Read, AnW = 0, One External Wait Inserted) Rev. 3.0, 04/02, page 436 of 1064...
  • Page 476: Figure 13.54 Mpx Interface Timing 3 (Single Write Cycle, Anw = 0, No External Wait)

    Tmd1 CKIO D31–D0 DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.54 MPX Interface Timing 3 (Single Write Cycle, AnW = 0, No External Wait) Rev. 3.0, 04/02, page 437 of 1064...
  • Page 477: Figure 13.55 Mpx Interface Timing 4 (Single Write, Anw = 1, One External Wait Inserted)

    Tmd1w Tmd1w Tmd1 CKIO D31–D0 DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.55 MPX Interface Timing 4 (Single Write, AnW = 1, One External Wait Inserted) Rev. 3.0, 04/02, page 438 of 1064...
  • Page 478: Figure 13.56 Mpx Interface Timing 5 (Burst Read Cycle, Anw = 0, No External Wait)

    Figure 13.56 MPX Interface Timing 5 (Burst Read Cycle, AnW = 0, No External Wait) Rev. 3.0, 04/02, page 439 of 1064...
  • Page 479: Figure 13.57 Mpx Interface Timing 6 (Burst Read Cycle, Anw = 0, External Wait Control)

    Figure 13.57 MPX Interface Timing 6 (Burst Read Cycle, AnW = 0, External Wait Control) Rev. 3.0, 04/02, page 440 of 1064...
  • Page 480: Figure 13.58 Mpx Interface Timing 7 (Burst Write Cycle, Anw = 0, No External Wait)

    Figure 13.58 MPX Interface Timing 7 (Burst Write Cycle, AnW = 0, No External Wait) Rev. 3.0, 04/02, page 441 of 1064...
  • Page 481: Figure 13.59 Mpx Interface Timing 8 (Burst Write Cycle, Anw = 1, External Wait Control)

    Figure 13.59 MPX Interface Timing 8 (Burst Write Cycle, AnW = 1, External Wait Control) Rev. 3.0, 04/02, page 442 of 1064...
  • Page 482: Figure 13.60 Mpx Interface Timing 1 (Burst Read Cycle, Anw = 0, No External Wait, Bus Width: 32 Bits, Transfer Data Size: 64 Bits)

    Tmd1w Tmd1 Tmd2 CKIO D31–D0 DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.60 MPX Interface Timing 1 (Burst Read Cycle, AnW = 0, No External Wait, Bus Width: 32 Bits, Transfer Data Size: 64 Bits) Rev.
  • Page 483 Tmd1w Tmd1w Tmd1 Tmd2 CKIO D31–D0 DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.61 MPX Interface Timing 2 (Burst Read Cycle, AnW = 0, One External Wait Inserted, Bus Width: 32 Bits, Transfer Data Size: 64 Bits) Rev.
  • Page 484: Figure 13.62 Mpx Interface Timing

    Tmd1 Tmd2 CKIO D31–D0 DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.62 MPX Interface Timing 3 (Burst Write Cycle, AnW = 0, No External Wait, Bus Width: 32 Bits, Transfer Data Size: 64 Bits) Rev.
  • Page 485: Figure 13.63 Mpx Interface Timing

    Tmd1w Tmd1w Tmd1 Tmd2 CKIO D31–D0 DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.63 MPX Interface Timing 4 (Burst Write Cycle, AnW = 1, One External Wait Inserted, Bus Width: 32 Bits, Transfer Data Size: 64 Bits) Rev.
  • Page 486: Figure 13.64 Mpx Interface Timing

    Figure 13.64 MPX Interface Timing 5 (Burst Read Cycle, AnW = 0, No External Wait, Bus Width: 32 Bits, Transfer Data Size: 32 Bytes) Rev. 3.0, 04/02, page 447 of 1064...
  • Page 487: Figure 13.65 Mpx Interface Timing

    Figure 13.65 MPX Interface Timing 6 (Burst Read Cycle, AnW = 0, External Wait Control, Bus Width: 32 Bits, Transfer Data Size: 32 Bytes) Rev. 3.0, 04/02, page 448 of 1064...
  • Page 488: Figure 13.66 Mpx Interface Timing

    Figure 13.66 MPX Interface Timing 7 (Burst Write Cycle, AnW = 0, No External Wait, Bus Width: 32 Bits, Transfer Data Size: 32 Bytes) Rev. 3.0, 04/02, page 449 of 1064...
  • Page 489: Figure 13.67 Mpx Interface Timing

    Figure 13.67 MPX Interface Timing 8 (Burst Write Cycle, AnW = 1, External Wait Control, Bus Width: 32 Bits, Transfer Data Size: 32 Bytes) Rev. 3.0, 04/02, page 450 of 1064...
  • Page 490: Byte Control Sram Interface

    32-byte boundary. The bus is not released during this period. Figure 13.68 shows an example of byte control SRAM connection to the SH7751 Series, and figures 13.69 to 13.71 show examples of byte control SRAM read cycles.
  • Page 491: Figure 13.69 Byte Control Sram Basic Read Cycle (No Wait)

    CKIO A25–A0 D31–D0 (read) DACKn (SA: IO ← memory) DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.69 Byte Control SRAM Basic Read Cycle (No Wait) Rev. 3.0, 04/02, page 452 of 1064...
  • Page 492: Figure 13.70 Byte Control Sram Basic Read Cycle (One Internal Wait Cycle)

    CKIO A25–A0 D31–D0 (read) DACKn (SA: IO ← memory) DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.70 Byte Control SRAM Basic Read Cycle (One Internal Wait Cycle) Rev. 3.0, 04/02, page 453 of 1064...
  • Page 493: Figure 13.71 Byte Control Sram Basic Read Cycle

    CKIO A25–A0 D31–D0 (read) DACKn (SA: IO ← memory) DACKn (DA) Note: For DACKn, an example is shown where CHCRn.AL (access level) = 0 for the DMAC. Figure 13.71 Byte Control SRAM Basic Read Cycle (One Internal Wait + One External Wait) Rev.
  • Page 494: 13.3.10 Waits Between Access Cycles

    13.2.5, Wait Control Register 1 (WCR1). When the SH7751 Series performs consecutive write cycles, the data transfer direction is fixed (from the SH7751 Series to other memory) and there is no problem. With read accesses to the same area, also, in principle data is output from the same data buffer, and wait cycle insertion is not performed.
  • Page 495: Figure 13.72 Waits Between Access Cycles

    Twait Twait A25–A0 D31–D0 Area m space read Area n space read Area n space write Area m inter-access wait specification Area n inter-access wait specification Figure 13.72 Waits between Access Cycles Rev. 3.0, 04/02, page 456 of 1064...
  • Page 496: 13.3.11 Bus Arbitration

    13.3.11 Bus Arbitration The SH7751 Series is provided with a bus arbitration function that grants the bus to an external device when it makes a bus request. There are three bus arbitration modes: master mode, partial-sharing master mode, and slave mode.
  • Page 497 As the CPU in the SH7751 Series is connected to cache memory by a dedicated internal bus, reading from cache memory can still be carried out when the bus is being used by another bus master inside or outside the SH7751 Series.
  • Page 498: Figure 13.73 Arbitration Sequence

    Negated within 2 cycles A25–A0 D31–D0 (read) Slave mode device access Master access Slave access Master access Note: * For the SH7751, refer to the Usage Note in section 13.3.15. Figure 13.73 Arbitration Sequence Rev. 3.0, 04/02, page 459 of 1064...
  • Page 499: 13.3.12 Master Mode

    signal is negated even while the signal is asserted to request the slave to relinquish the bus. When the SH7751 Series is used in master mode, consecutive bus accesses may be Rev. 3.0, 04/02, page 460 of 1064...
  • Page 500: 13.3.13 Slave Mode

    Responsibility must also be assigned when a standby operation is performed to implement the power-down state. The design of the SH7751 Series provides for all control, including initialization, refreshing, and standby control, to be carried out by the master mode device.
  • Page 501: 13.3.15 Notes On Usage

    If the SH7751 Series is specified as the master in a power-on reset, it will not accept bus requests from the slave until the enable bit (BCR1.BREQEN) is set to 1. To ensure that the slave processor does not access memory requiring initialization before use, such...
  • Page 502: Section 14 Direct Memory Access Controller (Dmac)

    14.1 Overview The SH7751 Series includes an on-chip four-channel direct memory access controller (DMAC). The DMAC can be used in place of the CPU to perform high-speed data transfers among external devices equipped with DACK (DMA transfer end notification), external memories, memory- mapped external devices, and on-chip peripheral modules (TMU, RTC, SCI, SCIF, CPG, and INTC).
  • Page 503 , ID [2:0], and D[31:0] pins. External requests can be accepted on all eight channels. Channel 0 does not have a request queue, but channels 1 to 3 in the SH7751 and channels 1 to 7 in the SH7751R each have four request queues.
  • Page 504 Channel 7 (SH7751R only): Single or dual address mode. External requests are accepted. In DDT mode, data transfer is carried out by the SH7751 using the K, ID [1:0], and D[31:0] signals to perform handshaking between the external ...
  • Page 505: Block Diagram (Sh7751)

    14.1.2 Block Diagram (SH7751) Figure 14.1 shows a block diagram of the DMAC. DMAC module Count SARn control Register DARn control DMATCRn Activation On-chip control peripheral CHCRn module DMAOR Request priority SCI, SCIF control DACK0, DACK1 DRAK0, DRAK1 interface SAR0, DAR0, DMATCR0,...
  • Page 506: Pin Configuration (Sh7751)

    14.1.3 Pin Configuration (SH7751) Tables 14.1 and 14.2 show the DMAC pins. Table 14.1 DMAC Pins Channel Pin Name Abbreviation Function DMA transfer Input DMA transfer request input from request external device to channel 0 acceptance DRAK0 Output...
  • Page 507: Register Configuration (Sh7751)

    (ID [1] = DRAK1, ID [0] = DACK1) 14.1.4 Register Configuration (SH7751) Table 14.3 summarizes the DMAC registers. The DMAC has a total of 17 registers: four registers are allocated to each channel, and an additional control register is shared by all four channels.
  • Page 508 Table 14.3 DMAC Registers (cont) Chan- Abbre- Read/ Area 7 Access Name viation Write Initial Value P4 Address Address Size DMA source Undefined H'FFA00010 H'1FA00010 32 SAR1 address register 1 DMA destination Undefined H'FFA00014 H'1FA00014 32 DAR1 address register 1 DMA transfer DMATCR1 R/W Undefined...
  • Page 509: Register Descriptions

    14.2 Register Descriptions 14.2.1 DMA Source Address Registers 0–3 (SAR0–SAR3) Bit: Initial value: — — — — — — — — R/W: Bit: · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · Initial value: —...
  • Page 510: Dma Destination Address Registers 0-3 (Dar0-Dar3)

    14.2.2 DMA Destination Address Registers 0–3 (DAR0–DAR3) Bit: Initial value: — — — — — — — — R/W: Bit: · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · Initial value: —...
  • Page 511: Dma Transfer Count Registers 0-3 (Dmatcr0-Dmatcr3)

    14.2.3 DMA Transfer Count Registers 0–3 (DMATCR0–DMATCR3) Bit: Initial value: R/W: Bit: Initial value: — — — — — — — — R/W: Bit: Initial value: — — — — — — — — R/W: Bit: Initial value: — — —...
  • Page 512: Dma Channel Control Registers 0-3 (Chcr0-Chcr3)

    14.2.4 DMA Channel Control Registers 0–3 (CHCR0–CHCR3) Bit: SSA2 SSA1 SSA0 DSA2 DSA1 DSA0 Initial value: R/W: Bit: — — — — Initial value: — — — — R/W: (R/W) (R/W) Bit: Initial value: R/W: Bit: — Initial value: R/W: R/(W) Notes: The TE bit can only be written with 0 after being read as 1, to clear the flag.
  • Page 513 Bits 31 to 29—Source Address Space Attribute Specification (SSA2–SSA0): These bits specify the space attribute for PCMCIA interface area access. Bit 31: SSA2 Bit 30: SSA1 Bit 29: SSA0 Description Reserved in PCMCIA access (Initial value) Dynamic bus sizing I/O space 8-bit I/O space 16-bit I/O space 8-bit common memory space...
  • Page 514 Bits 27 to 25—Destination Address Space Attribute Specification (DSA2–DSA0): These bits specify the space attribute for PCMCIA interface area access. Bit 27: DSA2 Bit 26: DSA1 Bit 25: DSA0 Description Reserved in PCMCIA access (Initial value) Dynamic bus sizing I/O space 8-bit I/O space 16-bit I/O space 8-bit common memory space...
  • Page 515 Bit 19— Select (DS): Specifies either low level detection or falling edge detection as the sampling method for the pin used in external request mode. In normal DMA mode, this bit is valid only in CHCR0 and CHCR1. In DDT mode, it is valid in CHCR0–CHCR3.
  • Page 516 Bits 15 and 14—Destination Address Mode 1 and 0 (DM1, DM0): These bits specify incrementing/decrementing of the DMA transfer destination address. The specification of these bits is ignored when data is transferred from external memory to an external device in single address mode.
  • Page 517 Bits 11 to 8—Resource Select 3 to 0 (RS3–RS0): These bits specify the transfer request source. Bit 11: Bit 10: Bit 9: Bit 8: Description External request, dual address mode* (external address space external address space) (Initial value) Setting prohibited External request, single address mode External address space external device*...
  • Page 518 Bit 7—Transmit Mode (TM): Specifies the bus mode for transfer. Bit 7: TM Description Cycle steal mode (Initial value) Burst mode Bits 6 to 4—Transmit Size 2 to 0 (TS2–TS0): These bits specify the transfer data size. In access to external memory, the specification is treated as an access size as described in section 13.3, Operation.
  • Page 519 Bit 1—Transfer End (TE): This bit is set to 1 after the number of transfers specified in DMATCR. If the IE bit is set to 1 at this time, an interrupt request (DMTE) is generated. If data transfer ends before TE is set to 1 (for example, due to an NMI interrupt, address error, or clearing of the DE bit or the DME bit in DMAOR), the TE bit is not set to 1.
  • Page 520: Dma Operation Register (Dmaor)

    14.2.5 DMA Operation Register (DMAOR) Bit: — — — — — — — — Initial value: R/W: Bit: — — — — — — — — Initial value: R/W: Bit: — — — — — Initial value: R/W: Bit: — —...
  • Page 521 Bits 14 to 10—Reserved: These bits are always read as 0, and should only be written with 0. Bits 9 and 8—Priority Mode 1 and 0 (PR1, PR0): These bits determine the order of priority for channel execution when transfer requests are made for a number of channels simultaneously. Bit 9: PR1 Bit 8: PR0 Description...
  • Page 522: Operation

    Bit 0—DMAC Master Enable (DME): Enables activation of the entire DMAC. When the DME bit and the DE bit of the CHCR register for the corresponding channel are set to 1, that channel is enabled for transfer. If this bit is cleared during data transfer, transfers on all channels are suspended.
  • Page 523 Note: If a transfer request is issued while transfer is disabled, the transfer enable wait state (transfer suspended state) is entered. Transfer is started when subsequently enabled (by setting DE = 1, DME = 1, TE = 0, NMIF = 0, AE = 0). Rev.
  • Page 524: Figure 14.2 Dmac Transfer Flowchart

    Start Initial settings (SAR, DAR, DMATCR, CHCR, DMAOR) DE, DME = 1? Illegal address check (reflected in AE bit) NMIF, AE, TE = 0? Transfer request issued? Bus mode, transfer request mode, detection method Transfer (1 transfer unit) DMATCR - 1 → DMATCR Update SAR, DAR NMIF or DMATCR = 0?
  • Page 525: Dma Transfer Requests

    14.3.2 DMA Transfer Requests DMA transfer requests are basically generated at either the data transfer source or destination, but they can also be issued by external devices or on-chip peripheral modules that are neither the source nor the destination. Transfers can be requested in three modes: auto-request, external request, and on-chip peripheral module request.
  • Page 526: Table 14.4 Selecting External Request Mode With Rs Bits

    Table 14.4 Selecting External Request Mode with RS Bits Address Mode Transfer Source Transfer Destination Dual address External memory, External memory, mode memory-mapped memory-mapped external device, or external device, or external device with external device with DACK DACK Single address External memory External device mode...
  • Page 527 On-Chip Peripheral Module Request Mode: In this mode a transfer is performed in response to a transfer request signal (interrupt request signal) from an on-chip peripheral module. As shown in table 14.5, there are seven transfer request signals: input capture interrupts from the timer unit (TMU), and receive-data-full interrupts (RXI) and transmit-data-empty interrupts (TXI) from the two serial communication interfaces (SCI, SCIF).
  • Page 528: Table 14.5 Selecting On-Chip Peripheral Module Request Mode With Rs Bits

    Table 14.5 Selecting On-Chip Peripheral Module Request Mode with RS Bits DMAC Transfer DMAC Transfer Transfer Transfer RS3 RS2 RS1 RS0 Request Source Request Signal Source Destination Bus Mode SCI transmitter SCTDR1 (SCI External* SCTDR1 Cycle steal transmit-data- mode empty transfer request) SCI receiver SCRDR1 (SCI...
  • Page 529: Channel Priorities

    14.3.3 Channel Priorities If the DMAC receives simultaneous transfer requests on two or more channels, it selects a channel according to a predetermined priority system, either in a fixed mode or round robin mode. The mode is selected with priority bits PR1 and PR0 in the DMA operation register (DMAOR). Fixed Mode: In this mode, the relative channel priorities remain fixed.
  • Page 530: Figure 14.3 Round Robin Mode

    Transfer on channel 0 Channel 0 is given the lowest CH0 > CH1 > CH2 > CH3 Initial priority order priority. CH1 > CH2 > CH3 > CH0 Priority order after transfer Transfer on channel 1 When channel 1 is given the Initial priority order CH0 >...
  • Page 531: Figure 14.4 Example Of Changes In Priority Order In Round Robin Mode

    1. Transfer requests are issued simultaneously for channels 0 and 3. 2. Since channel 0 has a higher priority level than channel 3, the channel 0 transfer is executed first (channel 3 is on transfer standby). 3. A transfer request is issued for channel 1 during the channel 0 transfer (channels 1 and 3 are on transfer standby).
  • Page 532: Types Of Dma Transfer

    14.3.4 Types of DMA Transfer The DMAC supports the transfers shown in table 14.6. It can operate in single address mode, in which either the transfer source or the transfer destination is accessed using the acknowledge signal, or in dual address mode, in which both the transfer source and transfer destination addresses are output.
  • Page 533: Figure 14.5 Data Flow In Single Address Mode

    DACK in which the external device outputs data to the data bus and that data is written to external memory in the same bus cycle. External External address data bus SH7751 Series External memory DMAC External device with DACK DACK : Data flow Figure 14.5 Data Flow in Single Address Mode...
  • Page 534: Figure 14.6 Dma Transfer Timing In Single Address Mode

    CKIO Address output to external memory A28–A0 space Data output from external device D63–D0 with DACK DACK DACK signal to external device with DACK WE signal to external memory space (a) From external device with DACK to external memory space CKIO Address output to external memory A28–A0...
  • Page 535: Figure 14.7 Operation In Dual Address Mode

    Dual Address Mode: Dual address mode is used to access both the transfer source and the transfer destination by address. The transfer source and destination can be accessed by either on- chip peripheral module or external address. In dual address mode, data is read from the transfer source in the data read cycle, and written to the transfer destination in the data write cycle, so that the transfer is executed in two bus cycles.
  • Page 536: Figure 14.8 Example Of Transfer Timing In Dual Address Mode

    CKIO Transfer source Transfer destination A28–A0 address address D63–D0 DACK Data read cycle Data write cycle (1st cycle) (2nd cycle) Transfer from external memory space to external memory space Figure 14.8 Example of Transfer Timing in Dual Address Mode Bus Modes There are two bus modes, cycle steal mode and burst mode, selected with the TM bit in CHCR0–...
  • Page 537: Figure 14.9 Example Of Dma Transfer In Cycle Steal Mode

    Bus returned to CPU Bus cycle DMAC DMAC DMAC DMAC Read Write Read Write Figure 14.9 Example of DMA Transfer in Cycle Steal Mode Burst Mode: In burst mode, once the DMAC has acquired the bus it holds the bus and transfers data continuously until the transfer end condition is satisfied.
  • Page 538: Table 14.7 Relationship Between Dma Transfer Type, Request Mode, And Bus Mode

    Relationship between DMA Transfer Type, Request Mode, and Bus Mode Table 14.7 shows the relationship between the type of DMA transfer, the request mode, and the bus mode. Table 14.7 Relationship between DMA Transfer Type, Request Mode, and Bus Mode Address Request Transfer Size...
  • Page 539: Table 14.8 External Request Transfer Sources And Destinations In Normal Mode

    (a) Normal DMA Mode Table 14.8 shows the memory interfaces that can be specified for the transfer source and transfer destination in DMA transfer initiated by an external request supported by the SH7751 Series in normal DMA mode. Table 14.8 External Request Transfer Sources and Destinations in Normal Mode...
  • Page 540: Table 14.9 External Request Transfer Sources And Destinations In Ddt Mode

    (b) DDT Mode Table 14.9 shows the memory interfaces that can be specified for the transfer source and transfer destination in DMA transfer initiated by an external request supported by the SH7751 Series in DDT mode. Table 14.9 External Request Transfer Sources and Destinations in DDT Mode...
  • Page 541: Types Of Dma Transfer

    Since channel 1 is in burst mode (in the case of edge sensing) regardless of whether fixed mode or round robin mode is set for the priority order, the bus is not released to the CPU until channel 1 transfer ends. DMAC CH1 DMAC CH1 DMAC CH0...
  • Page 542 1. Cycle Steal Mode In cycle steal mode, The sampling timing differs for dual address mode and single address mode, and for level detection and edge detection of For example, in figure 14.12 (cycle steal mode, dual address mode, level detection), DMAC transfer begins, at the earliest, four CKIO cycles after the first sampling operation.
  • Page 543 In figure 14.22, with a 32-byte data size, 32-bit bus width, and SDRAM: row hit write, DMAC transfer begins, at the earliest, six CKIO cycles after the first sampling operation. The second sampling operation begins one cycle after DACK is asserted for the first DMAC transfer. 4.
  • Page 544: Figure 14.12 Dual Address Mode/Cycle Steal Mode External Bus External Bus

    Figure 14.12 Dual Address Mode/Cycle Steal Mode External Bus External Bus/ (Level Detection), DACK (Read Cycle) Rev. 3.0, 04/02, page 505 of 1064...
  • Page 545: Figure 14.13 Dual Address Mode/Cycle Steal Mode External Bus External Bus

    Figure 14.13 Dual Address Mode/Cycle Steal Mode External Bus External Bus/ (Edge Detection), DACK (Read Cycle) Rev. 3.0, 04/02, page 506 of 1064...
  • Page 546: Figure 14.14 Dual Address Mode/Burst Mode External Bus External Bus Level Detection), Dack (Read Cycle)

    Figure 14.14 Dual Address Mode/Burst Mode External Bus External Bus/ (Level Detection), DACK (Read Cycle) Rev. 3.0, 04/02, page 507 of 1064...
  • Page 547: Edge Detection), Dack (Read Cycle)

    Figure 14.15 Dual Address Mode/Burst Mode External Bus External Bus/ (Edge Detection), DACK (Read Cycle) Rev. 3.0, 04/02, page 508 of 1064...
  • Page 548: Figure 14.16 Dual Address Mode/Cycle Steal Mode On-Chip Sci (Level Detection External Bus

    Figure 14.16 Dual Address Mode/Cycle Steal Mode On-Chip SCI (Level Detection) External Bus Rev. 3.0, 04/02, page 509 of 1064...
  • Page 549 Figure 14.17 Dual Address Mode/Cycle Steal Mode External Bus On-Chip SCI (Level Detection) Rev. 3.0, 04/02, page 510 of 1064...
  • Page 550 Figure 14.18 Single Address Mode/Cycle Steal Mode External Bus External Bus/ (Level Detection) Rev. 3.0, 04/02, page 511 of 1064...
  • Page 551 Figure 14.19 Single Address Mode/Cycle Steal Mode External Bus External Bus/ (Edge Detection) Rev. 3.0, 04/02, page 512 of 1064...
  • Page 552 Figure 14.20 Single Address Mode/Burst Mode External Bus External Bus/ (Level Detection) Rev. 3.0, 04/02, page 513 of 1064...
  • Page 553 Figure 14.21 Single Address Mode/Burst Mode External Bus External Bus/ (Edge Detection) Rev. 3.0, 04/02, page 514 of 1064...
  • Page 554: Figure 14.22 Single Address Mode/Burst Mode External Bus External Bus

    Figure 14.22 Single Address Mode/Burst Mode External Bus External Bus/ (Level Detection)/32-Byte Block Transfer (Bus Width: 32 Bits, SDRAM: Row Hit Write) Rev. 3.0, 04/02, page 515 of 1064...
  • Page 555: Ending Dma Transfer

    14.3.6 Ending DMA Transfer The conditions for ending DMA transfer are different for ending on individual channels and for ending on all channels together. Except for the case where transfer ends when the value in the DMA transfer count register (DMATCR) reaches 0, the following conditions apply to ending transfer.
  • Page 556 Conditions for Ending Transfer on Individual Channels: Transfer ends on the corresponding channel when either of the following conditions is satisfied: The value in the DMA transfer count register (DMATCR) reaches 0. The DE bit in the DMA channel control register (CHCR) is cleared to 0. 1.
  • Page 557 2. End of transfer when NMIF = 1 in DMAOR If the NMIF bit in DMAOR is set to 1 due to an NMI interrupt, DMA transfer is suspended on all channels in accordance with the conditions in 1, 2, 3, and 4 in section 14.3.6, and the bus is passed to the CPU.
  • Page 558: Examples Of Use

    14.4 Examples of Use 14.4.1 Examples of Transfer between External Memory and an External Device with DACK Examples of transfer of data in external memory to an external device with DACK using DMAC channel 1 are considered here. Table 14.10 shows the transfer conditions and the corresponding register settings. Table 14.10 Conditions for Transfer between External Memory and an External Device with DACK, and Corresponding Register Settings Transfer Conditions...
  • Page 559: On-Demand Data Transfer Mode (Ddt Mode)

    14.5 On-Demand Data Transfer Mode (DDT Mode) 14.5.1 Operation Setting the DDT bit to 1 in DMAOR causes a transition to on-demand data transfer mode (DDT mode). In DDT mode, it is possible to transfer to channel 0 to 3 via the data bus and DDT module, ...
  • Page 560 1. Normal data transfer mode (channel 0) (the data bus available signal) is asserted in response to (the data bus request signal) from an external device. Two CKIO-synchronous cycles after is asserted, the external data bus drives the data transfer setting command (DTR command) in synchronization with (the transfer request signal).
  • Page 561: Pins In Ddt Mode

    14.5.2 Pins in DDT Mode Figure 14.24 shows the system configuration in DDT mode. /DRAK0 /DACK0 SH7751 Series ID1, ID0/DRAK1, DACK1 External device D31–D0 = DTR A25–A0, RAS, CAS, WE, DQMn, CKE Synchronous DRAM Figure 14.24 System Configuration in On-Demand Data Transfer Mode...
  • Page 562: Figure 14.25 Data Transfer Request Format

    : Reply strobe signal for external device from DMAC The assertion timing is the same as the DACKn assertion timing for each memory interface. However, note that is an active-low signal. ID1, ID0: Channel number notification signals 00: Channel 0 01: Channel 1 10: Channel 2...
  • Page 563: Table 14.11 Usable Sz, Id, And Md Combination In Ddt Mode

    101, 110. Usable SZ, ID, and MD Combination in DDT Mode Table 14.11 shows the usable combination of SZ, ID, and MD in DDT mode of the SH7751. Table 14.11 Usable SZ, ID, and MD Combination in DDT Mode SZ [2:0]...
  • Page 564: Transfer Request Acceptance On Each Channel

    14.5.3 Transfer Request Acceptance on Each Channel On channel 0, a DMA data transfer request can be made by means of the DTR format. No further transfer requests are accepted between DTR format acceptance and the end of the data transfer. On channels 1 to 3, output a transfer request from an external device by means of the DTR format (ID = 01, 10, or 11) after making DMAC control register settings in the same way as in normal DMA mode.
  • Page 565: Figure 14.26 Single Address Mode/Synchronous Dram External Device Longword Transfer Sdram Auto-Precharge Read Bus Cycle, Burst (Rcd=1, Cas Latency=3, Tpc=3)

    Figure 14.26 Single Address Mode/Synchronous DRAM External Device Longword Transfer SDRAM Auto-Precharge Read Bus Cycle, Burst (RCD=1, CAS latency=3, TPC=3) Rev. 3.0, 04/02, page 526 of 1064...
  • Page 566: Figure 14.27 Single Address Mode/External Device Synchronous Dram Longword Transfer Sdram Auto-Precharge Write Bus Cycle, Burst (Rcd=1, Trwl=2, Tpc=1)

    Figure 14.27 Single Address Mode/External Device Synchronous DRAM Longword Transfer SDRAM Auto-Precharge Write Bus Cycle, Burst (RCD=1, TRWL=2, TPC=1) Rev. 3.0, 04/02, page 527 of 1064...
  • Page 567: Figure 14.28 Dual Address Mode/Synchronous Dram Sram Longword Transfer

    Figure 14.28 Dual Address Mode/Synchronous DRAM SRAM Longword Transfer Rev. 3.0, 04/02, page 528 of 1064...
  • Page 568: Figure 14.29 Single Address Mode/Burst Mode/External Bus External Device 32-Byte

    CKIO DBREQ BAVL A25–A0 D31–D0 RAS, CAS, WE TDACK ID1, ID0 Figure 14.29 Single Address Mode/Burst Mode/External Bus External Device 32-Byte Block Transfer/Channel 0 On-Demand Data Transfer CKIO DBREQ BAVL A25–A0 D31–D0 RAS, CAS, WE TDACK ID1, ID0 Figure 14.30 Single Address Mode/Burst Mode/External Device External Bus 32-Byte Block Transfer/Channel 0 On-Demand Data Transfer Rev.
  • Page 569: Figure 14.31 Single Address Mode/Burst Mode/External Bus External Device 32-Bit Transfer/Channel 0 On-Demand Data Transfer

    CKIO DBREQ BAVL A25–A0 D31–D0 RAS, CAS, WE DQMn TDACK ID1, ID0 Figure 14.31 Single Address Mode/Burst Mode/External Bus External Device 32-Bit Transfer/Channel 0 On-Demand Data Transfer Rev. 3.0, 04/02, page 530 of 1064...
  • Page 570: Figure 14.32 Single Address Mode/Burst Mode/External Device External Bus 32-Bit Transfer/Channel 0 On-Demand Data Transfer

    CKIO DBREQ BAVL A25–A0 D31–D0 RAS, CAS, WE DQMn TDACK ID1, ID0 Figure 14.32 Single Address Mode/Burst Mode/External Device External Bus 32-Bit Transfer/Channel 0 On-Demand Data Transfer Rev. 3.0, 04/02, page 531 of 1064...
  • Page 571: Figure 14.33 Handshake Protocol Using Data Bus (Channel 0 On-Demand Data Transfer)

    CKIO DBREQ BAVL A25–A0 D31–D0 MD = 00 MD = 00 TDACK ID1, ID0 Start of data transfer Next transfer request Figure 14.33 Handshake Protocol Using Data Bus (Channel 0 On-Demand Data Transfer) Rev. 3.0, 04/02, page 532 of 1064...
  • Page 572: Figure 14.34 Handshake Protocol Without Use Of Data Bus

    CKIO DBREQ BAVL A25–A0 D31–D0 MD = 00 TDACK ID1, ID0 Start of data transfer Next transfer request Figure 14.34 Handshake Protocol without Use of Data Bus (Channel 0 On-Demand Data Transfer) Rev. 3.0, 04/02, page 533 of 1064...
  • Page 573: Figure 14.35 Read From Synchronous Dram Precharge Bank

    CKIO DBREQ BAVL A25–A0 D2 D3 D31–D0 RAS, CAS, Figure 14.35 Read from Synchronous DRAM Precharge Bank CKIO DBREQ Transfer requests can be accepted BAVL A25–A0 D31–D0 RAS, CAS, Figure 14.36 Read from Synchronous DRAM Non-Precharge Bank (Row Miss) Rev. 3.0, 04/02, page 534 of 1064...
  • Page 574: Figure 14.37 Read From Synchronous Dram (Row Hit)

    CKIO DBREQ BAVL A25–A0 D31–D0 D2 D3 RAS, CAS, Figure 14.37 Read from Synchronous DRAM (Row Hit) CKIO DBREQ BAVL A25–A0 D31–D0 D2 D3 RAS, CAS, Figure 14.38 Write to Synchronous DRAM Precharge Bank Rev. 3.0, 04/02, page 535 of 1064...
  • Page 575: Figure 14.39 Write To Synchronous Dram Non-Precharge Bank (Row Miss)

    CKIO DBREQ Transfer requests can be accepted BAVL A25–A0 D31–D0 RAS, CAS, Figure 14.39 Write to Synchronous DRAM Non-Precharge Bank (Row Miss) CKIO DBREQ BAVL A25–A0 D31–D0 RAS, CAS, Figure 14.40 Write to Synchronous DRAM (Row Hit) Rev. 3.0, 04/02, page 536 of 1064...
  • Page 576: Figure 14.41 Single Address Mode/Burst Mode/External Bus External Device 32-Byte Block Transfer/Channel 0 On-Demand Data Transfer

    CKIO DBREQ BAVL A25–A0 D31–D0 RAS, CAS, WE TDACK ID1, ID0 Figure 14.41 Single Address Mode/Burst Mode/External Bus External Device 32-Byte Block Transfer/Channel 0 On-Demand Data Transfer Rev. 3.0, 04/02, page 537 of 1064...
  • Page 577: Figure 14.42 Ddt Mode Setting

    DMA Operation Register (DMAOR) PR[1:0] NMIF DDT: 0: Normal DMA mode 1: On-demand data transfer mode Figure 14.42 DDT Mode Setting CKIO DBREQ BAVL No DMA request sampling A25–A0 D31–D0 D1 D2 D3 D1 D2 TDACK ID1, ID0 Start of data transfer Figure 14.43 Single Address Mode/Burst Mode/Edge Detection/ External Device External Bus Data Transfer...
  • Page 578: Figure 14.44 Single Address Mode/Burst Mode/Level Detection/ External Bus External Device Data Transfer

    CKIO DBREQ BAVL Wait for next DMA request A25–A0 D31–D0 D1 D2 D3 D0 D1 D2 D3 TDACK ID1, ID0 Start of data transfer Figure 14.44 Single Address Mode/Burst Mode/Level Detection/ External Bus External Device Data Transfer CKIO DBREQ BAVL A25–A0 D31–D0 Idle cycle...
  • Page 579: Figure 14.46 Single Address Mode/Burst Mode/Edge Detection/Byte, Word, Longword, Quadword/External Device External Bus Data Transfer

    CKIO DBREQ BAVL A25–A0 D31–D0 DQMn Idle cycle Idle cycle Idle cycle TDACK ID1, ID0 Figure 14.46 Single Address Mode/Burst Mode/Edge Detection/Byte, Word, Longword, Quadword/External Device External Bus Data Transfer Rev. 3.0, 04/02, page 540 of 1064...
  • Page 580: Figure 14.47 Single Address Mode/Burst Mode/32-Byte Block Transfer/Dma Transfer Request To Channels 1-3 Using Data Bus

    CKIO DBREQ BAVL A25–A0 D31–D0 ID = 1, 2, or 3 RAS, CAS, WE TDACK ID1, ID0 01 or 10 or 11 Figure 14.47 Single Address Mode/Burst Mode/32-Byte Block Transfer/DMA Transfer Request to Channels 1–3 Using Data Bus Rev. 3.0, 04/02, page 541 of 1064...
  • Page 581: Figure 14.48 Single Address Mode/Burst Mode/32-Byte Block Transfer/ External Bus

    CKIO DBREQ BAVL A25–A0 D31–D0 RAS, CAS, WE TDACK ID1, ID0 No DTR cycle, so requests can be made at any time Figure 14.48 Single Address Mode/Burst Mode/32-Byte Block Transfer/ External Bus External Device Data Transfer/ Direct Data Transfer Request to Channel 2 without Using Data Bus Rev.
  • Page 582: Figure 14.49 Single Address Mode/Burst Mode/External Bus External Device Data Transfer/Direct Data Transfer Request To Channel 2

    Four requests can be queued Handshaking is necessary to send additional requests CKIO 1st 2nd No more requests A25 A0 D31 D0 RAS, CAS, ID1, ID0 Must be ignored (no request transmitted) Figure 14.49 Single Address Mode/Burst Mode/External Bus External Device Data Transfer/Direct Data Transfer Request to Channel 2 Rev.
  • Page 583: Figure 14.50 Single Address Mode/Burst Mode/External Device External Bus Data Transfer/Direct Data Transfer Request To Channel 2

    Four requests can be queued Handshaking is necessary to send additional requests CKIO 1st 2nd A25–A0 D31–D0 RAS, CAS, ID1, ID0 Must be ignored (no request transmitted) Figure 14.50 Single Address Mode/Burst Mode/External Device External Bus Data Transfer/Direct Data Transfer Request to Channel 2 Rev.
  • Page 584 Handshaking is necessary Four requests can be queued to send additional requests CKIO 1st 2nd A25–A0 D31–D0 RAS, CAS, ID1, ID0 Must be ignored (no request transmitted) Figure 14.51 Single Address Mode/Burst Mode/External Bus External Device Data Transfer (Active Bank Address)/Direct Data Transfer Request to Channel 2 Rev.
  • Page 585 Four requests can be queued Handshaking is necessary to send additional requests 1st 2nd A25–A0 D31–D0 RAS, CAS, ID1, ID0 Must be ignored (no request transmitted) Figure 14.52 Single Address Mode/Burst Mode/External Device External Bus Data Transfer (Active Bank Address)/Direct Data Transfer Request to Channel 2 Rev.
  • Page 586: Notes On Use Of Ddt Module

    14.5.4 Notes on Use of DDT Module 1. Normal data transfer mode (channel 0) Set DTR.ID = 00 and DTR.MD = 00. If a setting of MD = 01, 10, or 11 is made, the DMAC will halt with an address error. In this case, the error can be cleared by reading DMAOR.AE = 1, then writing AE = 0.
  • Page 587 b. If a DMA transfer request for channel 0 is input during execution of a channel 0 DMA bus cycle, the DDT will ignore that request. Confirm that channel 0 DMA transfer has finished (burst mode) or that a DMA bus cycle is not in progress (cycle steal mode). 7.
  • Page 588 11. Clearing DDT mode Check that DMA transfer is not in progress on any channel before setting the DMAOR.DDT bit. If the DMAOR.DDT setting is changed from 1 to 0 during DMA transfer in DDT mode, the DMAC will freeze. This also applies when switching from normal DMA mode (DMAOR.DDT = 0) to DDT mode.
  • Page 589: Configuration Of The Dmac (Sh7751R)

    14.6 Configuration of the DMAC (SH7751R) 14.6.1 Block Diagram of the DMAC Figure 14.53 is a block diagram of the DMAC in the SH7751R. DMAC module Count control SAR0–7 DAR0–7 Registr control DMATCR0–7 Activation control On-chip peripheral CHCR0–7 module DMAOR Request SCI, SCIF priority...
  • Page 590: Pin Configuration (Sh7751R)

    14.6.2 Pin Configuration (SH7751R) Tables 14.12 and 14.13 show the pin configuration of the DMAC. Table 14.12 DMAC Pins Channel Pin Name Abbreviation Function DMA transfer Input DMA transfer request input from request external device to channel 0 DREQ acceptance DRAK0 Output Acceptance of request for DMA...
  • Page 591: Register Configuration (Sh7751R)

    Table 14.13 DMAC Pins in DDT Mode Pin Name Abbreviation Function Data bus request Input Data bus release request from external device for DTR format input Data bus available Output Data bus release notification (DRAK0) Data bus can be used 2 cycles after is asserted Notification of channel number to...
  • Page 592: Table 14.14 Register Configuration

    Table 14.14 Register Configuration Chan- Abbre- Read/ Area 7 Access Name viation Write Initial Value P4 Address Address Size DMA source SAR0 Undefined H'FFA00000 H'1FA00000 32 address register 0 DMA destination DAR0 Undefined H'FFA00004 H'1FA00004 32 address register 0 DMA transfer DMATCR0 R/W Undefined H'FFA00008 H'1FA00008 32...
  • Page 593 Table 14.14 Register Configuration (cont) Chan- Abbre- Read/ Area 7 Access Name viation Write Initial Value P4 Address Address Size DMA source SAR4 Undefined H'FFA00050 H'1FA00050 32 address register 4 DMA destination DAR4 Undefined H'FFA00054 H'1FA00054 32 address register 4 DMA transfer DMATCR4 R/W Undefined...
  • Page 594: Register Descriptions (Sh7751R)

    DMA destination address registers 0–7 (DAR0–DAR7) are 32-bit readable/writable registers that specify the destination address for a DMA transfer. The functions of these registers are the same as on the SH7751. For more information, see section 14.2.2, DMA Destination Address Registers 0–3 (DAR0–DAR3).
  • Page 595: Dma Transfer Count Registers 0-7 (Dmatcr0-Dmatcr7)

    (bytecount, word count, longword count, quadword count, or 32-byte count). Functions of these registers are the same as the transfer-count registers of the SH7751. For more information, see section 14.2.3, DMA Transfer Count Registers 0–3 (DMATCR0–DMATCR3).
  • Page 596 These registers are initialized to H'00000000 by a power-on or manual reset. Their values are retained in standby, sleep, and deep-sleep modes. Bits 31 to 29—Source Address Space Attribute Specification (SSA2–SSA0): These bits specify the space attribute for PCMCIA access. These bits are only valid in the case of page mapping to PCMCIA connected to areas 5 and 6.
  • Page 597 In normal DMA mode, this bit is valid only in CHCR0 and CHCR1. In DDT mode, it is valid in CHCR1–CHCR7. (DDT mode: ) For details of the settings, see the description of the AM bit in section 14.2.4, DMA Channel Control Registers 0–3 (CHCR0–CHCR3). Bit 16—Acknowledge Level (AL): Specifies the DACK (acknowledge) signal as active-high or active-low.
  • Page 598: Dma Operation Register (Dmaor)

    CHCR Bit 3 Description This bit is always read as 0. (Initial value) Writing a 0 to this bit is invalid. When DMAOR.DBL = 1, writing a 1 to this bit clears the request queues on the DDT side and any external requests stored in the DMAC. The written value is not retained.
  • Page 599: Figure 14.54 Dtr Format (Transfer Request Format) (Sh7751R)

    DMAOR is initialized to H'00000000 by a power-on or manual reset. They retain their values in standby mode and deep sleep mode. Bits 31 to 16—Reserved: These bits are always read as 0, and should only be written with 0. Bit 15—On-Demand Data Transfer (DDT): Specifies on-demand data transfer mode.
  • Page 600 Bits 13 to 10—Reserved: These bits are always read as 0, and should only be written with 0. Bits 9 and 8—Priority Mode 1 and 0 (PR1, PR0): These bits determine the order of priority for channel execution when transfer requests are made for a number of channels simultaneously. DMAOR DMAOR Bit 9...
  • Page 601: Operation (Sh7751R)

    14.8 Operation (SH7751R) Operation specific to the SH7751R is described here. For details of operation, see section 14.3, Operation. 14.8.1 Channel Specification for a Normal DMA Transfer In normal DMA transfer mode, the DMAC always operates with eight channels, and external requests are only accepted on channel 0 (...
  • Page 602: Clearing Request Queues By Dtr Format

    Table 14.16 Notification of Transfer Channel in Eight-Channel DDT Mode ID[1:0] Transfer Channel Table 14.17 Function of Function of = High Bus available (data-bus enabled) = Low Notification of channel number ( 14.8.4 Clearing Request Queues by DTR Format In DDT mode, the request queues of any channel can be cleared by using DTR.ID, DTR.MD,...
  • Page 603: Interrupt-Request Codes

    Table 14.18 DTR Format for Clearing Request Queues DMAOR.DBL DTR.ID DTR.MD DTR.SZ DTR.COUNT[7:4] Description Clear the request queues of all channels (1–7). Clear the CH0 request-accepted flag Setting prohibited Clear the request queues of all channels (1–7). Clear the CH0 request-accepted flag. 0001 Clear the CH0 request-accepted flag 0010...
  • Page 604: Figure 14.55 Single Address Mode/Burst Mode/External Bus External Device 32-Byte Block Transfer/Channel 0 On-Demand Data Transfer

    CH4 transfer-end interrupt H'780 DMTE5 CH5 transfer-end interrupt H'7A0 DMTE6 CH6 transfer-end interrupt H'7C0 DMTE7 CH7 transfer-end interrupt H'7E0 DMAE Address error interrupt H'6C0 DMTE4–DMTE7: These codes are not used in the SH7751. Rev. 3.0, 04/02, page 565 of 1064...
  • Page 605: Figure 14.56 Single Address Mode/Cycle Steal Mode/External Bus External Device

    CKIO A25–A0 D63–D0 RAS, CAS, WE ID1, ID0 Figure 14.56 Single Address Mode/Cycle Steal Mode/External Bus External Device/32-Byte Block Transfer/On-Demand Data Transfer on Channel 4 Rev. 3.0, 04/02, page 566 of 1064...
  • Page 606: Usage Notes

    DMATCR transfer count will remain at the set value. If NMIF was set during the transfer, when the DE bit is 1 and the TE bit is 0 in CHCR0–CHCR3 in the SH7751 or CHCR0– CHCR7 in the SH7751R, the DMATCR value will indicate the remaining number of transfers.
  • Page 607 Rev. 3.0, 04/02, page 568 of 1064...
  • Page 608: Section 15 Serial Communication Interface (Sci)

    Section 15 Serial Communication Interface (SCI) 15.1 Overview The SH7751 Series is equipped with a single-channel serial communication interface (SCI) and a single-channel serial communication interface with built-in FIFO registers (SCI with FIFO: SCIF). The SCI can handle both asynchronous and synchronous serial communication.
  • Page 609 There is a single serial data transfer format. Data length: 8 bits Receive error detection: Overrun errors Full-duplex communication capability The transmitter and receiver are mutually independent, enabling transmission and reception to be executed simultaneously. Double-buffering is used in both the transmitter and the receiver, enabling continuous transmission and continuous reception of serial data.
  • Page 610: Block Diagram

    15.1.2 Block Diagram Figure 15.1 shows a block diagram of the SCI. Internal Module data bus data bus SCSSR1 SCBRR1 SCRDR1 SCTDR1 SCSCR1 Pφ SCSMR1 SCRSR1 SCTSR1 Baud rate Pφ/4 SCSPTR1 generator Transmission/ Pφ/16 reception control Pφ/64 Clock Parity generation Parity check External clock SCRSR1: Receive shift register...
  • Page 611: Pin Configuration

    15.1.3 Pin Configuration Table 15.1 shows the SCI pin configuration. Table 15.1 SCI Pins Pin Name Abbreviation Function Serial clock pin Clock input/output Receive data pin Input Receive data input Transmit data pin Output Transmit data output Note: They are made to function as serial pins by performing SCI operation settings with the TE, RE, CKEI, and CKE0 bits in SCSCR1 and the C/ bit in SCSMR1.
  • Page 612: Register Descriptions

    15.2 Register Descriptions 15.2.1 Receive Shift Register (SCRSR1) Bit: R/W: — — — — — — — — SCRSR1 is the register used to receive serial data. The SCI sets serial data input from the RxD pin in SCRSR1 in the order received, starting with the LSB (bit 0), and converts it to parallel data.
  • Page 613: Transmit Shift Register (Sctsr1)

    15.2.3 Transmit Shift Register (SCTSR1) Bit: R/W: — — — — — — — — SCTSR1 is the register used to transmit serial data. To perform serial data transmission, the SCI first transfers transmit data from SCTDR1 to SCTSR1, then sends the data to the TxD pin starting with the LSB (bit 0). When transmission of one byte is completed, the next transmit data is transferred from SCTDR1 to SCTSR1, and transmission started, automatically.
  • Page 614: Serial Mode Register (Scsmr1)

    15.2.5 Serial Mode Register (SCSMR1) Bit: STOP CKS1 CKS0 Initial value: R/W: SCSMR1 is an 8-bit register used to set the SCI’s serial transfer format and select the baud rate generator clock source. SCSMR1 can be read or written to by the CPU at all times. SCSMR1 is initialized to H'00 by a power-on reset or manual reset, in standby mode, and in the module standby state.
  • Page 615 Bit 4—Parity Mode (O/ ): Selects either even or odd parity for use in parity addition and checking. The O/ bit setting is only valid when the PE bit is set to 1, enabling parity bit addition and checking, in asynchronous mode. The O/ bit setting is invalid in synchronous mode, and when parity addition and checking is disabled in asynchronous mode.
  • Page 616: Serial Control Register (Scscr1)

    Bit 2—Multiprocessor Mode (MP): Selects a multiprocessor format. When a multiprocessor format is selected, the PE bit and O/ bit parity settings are invalid. The MP bit setting is only valid in asynchronous mode; it is invalid in synchronous mode. For details of the multiprocessor communication function, see section 15.3.3, Multiprocessor Communication Function.
  • Page 617 Bit 7—Transmit Interrupt Enable (TIE): Enables or disables transmit-data-empty interrupt (TXI) request generation when serial transmit data is transferred from SCTDR1 to SCTSR1 and the TDRE flag in SCSSR1 is set to 1. Bit 7: TIE Description Transmit-data-empty interrupt (TXI) request disabled* (Initial value) Transmit-data-empty interrupt (TXI) request enabled Note: * TXI interrupt requests can be cleared by reading 1 from the TDRE flag, then clearing it to 0,...
  • Page 618 Bit 4—Receive Enable (RE): Enables or disables the start of serial reception by the SCI. Bit 4: RE Description Reception disabled* (Initial value) Reception enabled* Notes: *1 Clearing the RE bit to 0 does not affect the RDRF, FER, PER, and ORER flags, which retain their states.
  • Page 619 Bits 1 and 0—Clock Enable 1 and 0 (CKE1, CKE0): These bits are used to select the SCI clock source and enable or disable clock output from the SCK pin. The combination of the CKE1 and CKE0 bits determines whether the SCK pin functions as the serial clock output pin or the serial clock input pin.
  • Page 620: Serial Status Register (Scssr1)

    15.2.7 Serial Status Register (SCSSR1) Bit: TDRE RDRF ORER TEND MPBT Initial value: — R/W: R/(W)* R/(W)* R/(W)* R/(W)* R/(W)* Note: * Only 0 can be written, to clear the flag. SCSSR1 is an 8-bit register containing status flags that indicate the operating status of the SCI, and multiprocessor bits.
  • Page 621 Bit 6—Receive Data Register Full (RDRF): Indicates that the received data has been stored in SCRDR1. Bit 6: RDRF Description There is no valid receive data in SCRDR1 (Initial value) [Clearing conditions] Power-on reset, manual reset, standby mode, or module standby When 0 is written to RDRF after reading RDRF = 1 When data in SCRDR1 is read by the DMAC There is valid receive data in SCRDR1...
  • Page 622 Bit 4—Framing Error (FER): Indicates that a framing error occurred during reception in asynchronous mode, causing abnormal termination. Bit 4: FER Description Reception in progress, or reception has ended normally* (Initial value) [Clearing conditions] Power-on reset, manual reset, standby mode, or module standby When 0 is written to FER after reading FER = 1 A framing error occurred during reception [Setting condition]...
  • Page 623 Bit 2—Transmit End (TEND): Indicates that there is no valid data in SCTDR1 when the last bit of the transmit character is sent, and transmission has been ended. The TEND flag is read-only and cannot be modified. Bit 2: TEND Description Transmission is in progress [Clearing conditions]...
  • Page 624: Serial Port Register (Scsptr1)

    15.2.8 Serial Port Register (SCSPTR1) Bit: — — — SPB1IO SPB1DT SPB0IO SPB0DT Initial value: — — R/W: — — — SCSPTR1 is an 8-bit readable/writable register that controls input/output and data for the port pins multiplexed with the serial communication interface (SCI) pins. Input data can be read from the RxD pin, output data written to the TxD pin, and breaks in serial transmission/reception controlled, by means of bits 1 and 0.
  • Page 625 Bit 2—Serial Port Clock Port Data (SPB1DT): Specifies the serial port SCK pin input/output data. Input or output is specified by the SPB1IO bit (see the description of bit 3, SPB1IO, for details). When output is specified, the value of the SPB1DT bit is output to the SCK pin. The SCK pin value is read from the SPB1DT bit regardless of the value of the SPB1IO bit.
  • Page 626: Figure 15.2 Sck Pin

    SCI I/O port block diagrams are shown in figures 15.2 to 15.4. Reset SPB1IO Internal data bus SPTRW Reset SPB1DT SPTRW Clock output enable signal Serial clock output signal Serial clock input signal Clock input enable signal SPTRR SPTRW: Write to SPTR SPTRR: Read SPTR Note: * Signals that set the SCK pin function as internal clock output or external clock input according to the CKE0 and CKE1 bits in SCSCR1 and the C/ bit in SCSMR1.
  • Page 627: Figure 15.3 Txd Pin

    Reset SPB0IO Internal data bus SPTRW Reset SPB0DT Transmit enable signal SPTRW Serial transmit data SPTRW: Write to SPTR Figure 15.3 TxD Pin Serial receive data Internal data bus SPTRR SPTRR: Read SPTR Figure 15.4 RxD Pin Rev. 3.0, 04/02, page 588 of 1064...
  • Page 628: Bit Rate Register (Scbrr1)

    15.2.9 Bit Rate Register (SCBRR1) Bit: Initial value: R/W: SCBRR1 is an 8-bit register that sets the serial transfer bit rate in accordance with the baud rate generator operating clock selected by bits CKS1 and CKS0 in SCSMR1. SCBRR1 can be read or written to by the CPU at all times. SCBRR1 is initialized to H'FF by a power-on reset or manual reset, in standby mode, and in the module standby state.
  • Page 629 The bit rate error in asynchronous mode is found from the following equation: P × 10 φ × 100 Error (%) = – 1 (N + 1) × B × 64 × 2 2n–1 Table 15.3 shows sample SCBRR1 settings in asynchronous mode, and table 15.4 shows sample SCBRR1 settings in synchronous mode.
  • Page 630: Table 15.3 Examples Of Bit Rates And Scbrr1 Settings In Asynchronous Mode

    Table 15.3 Examples of Bit Rates and SCBRR1 Settings in Asynchronous Mode P (MHz) 2.097152 2.4576 Bit Rate Error Error Error Error (bits/s) 0.03 –0.04 –0.26 0.03 0.16 0.21 0.00 0.16 0.16 0.21 0.00 0.16 0.16 0.21 0.00 0.16 1200 0.16...
  • Page 631 Table 15.3 Examples of Bit Rates and SCBRR1 Settings in Asynchronous Mode (cont) P (MHz) 6.144 7.37288 Bit Rate Error Error Error Error (bits/s) –0.44 0.08 –0.07 0.03 0.16 0.00 0.00 0.16 0.16 0.00 0.00 0.16 0.16 0.00 0.00 0.16 1200...
  • Page 632 Table 15.3 Examples of Bit Rates and SCBRR1 Settings in Asynchronous Mode (cont) P (MHz) 14.7456 19.6608 Bit Rate Error Error Error Error (bits/s) 0.70 0.03 0.31 –0.25 0.00 0.16 0.00 0.16 0.00 0.16 0.00 0.16 0.00 0.16 0.00 0.16 1200...
  • Page 633: Table 15.4 Examples Of Bit Rates And Scbrr1 Settings In Synchronous Mode

    Table 15.4 Examples of Bit Rates and SCBRR1 Settings in Synchronous Mode P (MHz) 28.7 Bit Rate (bits/s) — — — — — — — — — — — — — — 2.5k 100k 250k — — 500k —...
  • Page 634: Table 15.5 Maximum Bit Rate For Various Frequencies With Baud Rate Generator

    Table 15.5 shows the maximum bit rate for various frequencies in asynchronous mode. Tables 15.6 and 15.7 show the maximum bit rates with external clock input. Table 15.5 Maximum Bit Rate for Various Frequencies with Baud Rate Generator (Asynchronous Mode) Settings P (MHz) Maximum Bit Rate (bits/s)
  • Page 635: Table 15.6 Maximum Bit Rate With External Clock Input (Asynchronous Mode)

    Table 15.6 Maximum Bit Rate with External Clock Input (Asynchronous Mode) P (MHz) External Input Clock (MHz) Maximum Bit Rate (bits/s) 0.5000 31250 2.097152 0.5243 32768 2.4576 0.6144 38400 0.7500 46875 3.6864 0.9216 57600 1.0000 62500 4.9152 1.2288 76800 2.0000 125000...
  • Page 636: Operation

    15.3 Operation 15.3.1 Overview The SCI can carry out serial communication in two modes: asynchronous mode in which synchronization is achieved character by character, and synchronous mode in which synchronization is achieved with clock pulses. Selection of asynchronous or synchronous mode and the transmission format is made using SCSMR1 as shown in table 15.8.
  • Page 637: Table 15.8 Scsmr1 Settings For Serial Transfer Format Selection

    Table 15.8 SCSMR1 Settings for Serial Transfer Format Selection SCSMR1 Settings SCI Transfer Format Multi- Bit 7: Bit 6: Bit 2: Bit 5: Bit 3: Data processor Parity Stop Bit STOP Mode Length Length Asynchronous 8-bit data 1 bit mode 2 bits 1 bit 2 bits...
  • Page 638: Operation In Asynchronous Mode

    15.3.2 Operation in Asynchronous Mode In asynchronous mode, characters are sent or received, each preceded by a start bit indicating the start of communication and followed by one or two stop bits indicating the end of communication. Serial communication is thus carried out with synchronization established on a character-by- character basis.
  • Page 639: Table 15.10 Serial Transfer Formats (Asynchronous Mode)

    Table 15.10 Serial Transfer Formats (Asynchronous Mode) SCSMR1 Settings Serial Transfer Format and Frame Length CHR PE MP STOP 8-bit data STOP 8-bit data STOP STOP 8-bit data STOP 8-bit data STOP STOP 7-bit data STOP 7-bit data STOP STOP 7-bit data STOP 7-bit data...
  • Page 640: Figure 15.6 Relation Between Output Clock And Transfer Data Phase

    Clock Either an internal clock generated by the on-chip baud rate generator or an external clock input at the SCK pin can be selected as the SCI’s serial clock, according to the setting of the C/ bit in SCSMR1 and the CKE1 and CKE0 bits in SCSCR1. For details of SCI clock source selection, see table 15.9.
  • Page 641: Figure 15.7 Sample Sci Initialization Flowchart

    1. Set the clock selection in SCSCR1. Initialization Be sure to clear bits RIE, TIE, TEIE, and MPIE, and bits TE and RE, to 0. Clear TE and RE bits When clock output is selected in in SCSCR1 to 0 asynchronous mode, it is output immediately after SCSCR1 settings are made.
  • Page 642: Figure 15.8 Sample Serial Transmission Flowchart

    1. SCI status check and transmit data Start of transmission write: Read SCSSR1 and check that the TDRE flag is set to 1, then write transmit data to SCTDR1 and clear Read TDRE flag in SCSSR1 the TDRE flag to 0. 2.
  • Page 643 In serial transmission, the SCI operates as described below. 1. The SCI monitors the TDRE flag in SCSSR1. When TDRE is cleared to 0, the SCI recognizes that data has been written to SCTDR1, and transfers the data from SCTDR1 to SCTSR1. 2.
  • Page 644: Figure 15.9 Example Of Transmit Operation In Asynchronous Mode (Example With 8-Bit Data, Parity, One Stop Bit)

    Start Data Parity Stop Start Data Parity Stop Serial Idle state data (mark state) TDRE TEND TXI interrupt TXI interrupt request request TEI interrupt Data written to SCTDR1 request and TDRE flag cleared to 0 by TXI interrupt handler One frame Figure 15.9 Example of Transmit Operation in Asynchronous Mode (Example with 8-Bit Data, Parity, One Stop Bit) Serial Data Reception (Asynchronous Mode): Figure 15.10 shows a sample flowchart for serial...
  • Page 645: Figure 15.10 Sample Serial Reception Flowchart (1)

    1. Receive error handling and Start of reception break detection: If a receive error occurs, read the ORER, PER, and FER flags in Read ORER, PER, and FER flags SCSSR1 to identify the error. in SCSSR1 After performing the appropriate error handling, ensure that the ORER, PER, PER or FER and FER flags are all cleared to...
  • Page 646 Error handling ORER = 1? Overrun error handling FER = 1? Break? Framing error handling Clear RE bit in SCSCR1 to 0 PER = 1? Parity error handling Clear ORER, PER, and FER flags in SCSSR1 to 0 Figure 15.10 Sample Serial Reception Flowchart (2) Rev.
  • Page 647: Table 15.11 Receive Error Conditions

    In serial reception, the SCI operates as described below. 1. The SCI 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 SCRSR1 in LSB-to-MSB order. 3.
  • Page 648: Multiprocessor Communication Function

    Start Data Parity Stop Start Data Parity Stop Serial data RDRF RXI interrupt request SCRDR1 data read and ERI interrupt request RDRF flag cleared to 0 generated by framing One frame by RXI interrupt handler error Figure 15.11 Example of SCI Receive Operation (Example with 8-Bit Data, Parity, One Stop Bit) 15.3.3 Multiprocessor Communication Function...
  • Page 649: Figure 15.12 Example Of Inter-Processor Communication Using Multiprocessor Format (Transmission Of Data H'aa To Receiving Station A)

    Note: Even when this LSI has received data with a 0 multiprocessor bit that was meant to be sent to another station, the RDRF flag in SCSSR1 is set to 1. When the RDRF flag in SCSSR1 is set to 1, the exception handling routine reads the MPIE bit in SCSCR1, and skips the receive data if the MPIE bit is 1.
  • Page 650 Data Transfer Formats There are four data transfer formats. When the multiprocessor format is specified, the parity bit specification is invalid. For details, see table 15.10. Clock See the description under Clock in section 15.3.2. Data Transfer Operations Multiprocessor Serial Data Transmission: Figure 15.13 shows a sample flowchart for multiprocessor serial data transmission.
  • Page 651: Figure 15.13 Sample Multiprocessor Serial Transmission Flowchart

    Start of transmission 1. SCI status check and ID data write: Read SCSSR1 and check that the Read TEND flag in SCSSR1 TEND flag is set to 1, then set the MPBT bit in SCSSR1 to 1 and write ID data to SCTDR1. Finally, clear the TDRE flag to 0.
  • Page 652 In serial transmission, the SCI operates as described below. 1. The SCI monitors the TDRE flag in SCSSR1. When TDRE is cleared to 0, the SCI recognizes that data has been written to SCTDR1, and transfers the data from SCTDR1 to SCTSR1. 2.
  • Page 653: Figure 15.14 Example Of Sci Transmit Operation (Example With 8-Bit Data, Multiprocessor Bit, One Stop Bit)

    Multi- Multi- Multi- Start Data Stop Start Data Stop Start Data Stop proces- proces- proces- sor bit sor bit sor bit Serial Idle state D0 D1 D0 D1 D0 D1 data (mark state) TDRE TEND Data written to SCTDR1 TXI interrupt One frame and TDRE flag cleared request...
  • Page 654: Figure 15.15 Sample Multiprocessor Serial Reception Flowchart (1)

    1. ID reception cycle: Set the MPIE Start of reception bit in SCSCR1 to 1. 2. SCI status check, ID reception Set MPIE bit in SCSCR1 to 1 and comparison: Read SCSSR1 and SCSCR1, and check that the Read ORER and FER flags RDRF flag is set to 1 and the in SCSSR1 MPIE bit is set to 0, then read the...
  • Page 655 Error handling ORER = 1? Overrun error handling FER = 1? Break? Framing error handling Clear RE bit in SCSCR1 to 0 Clear ORER and FER flags in SCSSR1 to 0 Figure 15.15 Sample Multiprocessor Serial Reception Flowchart (2) Rev. 3.0, 04/02, page 616 of 1064...
  • Page 656: Figure 15.16 Example Of Sci Receive Operation (Example With 8-Bit Data, Multiprocessor Bit, One Stop Bit)

    Figure 15.16 shows an example of SCI operation for multiprocessor format reception. Data Start Stop Start Stop Data (ID1) (Data1) Serial Idle state data (mark state) MPIE RDRF SCRDR1 value The RDRF flag RXI interrupt request SCRDR1 data read As data is not RXI interrupt (multiprocessor and RDRF flag...
  • Page 657: Operation In Synchronous Mode

    In multiprocessor mode serial reception, the SCI operates as described below. 1. The SCI 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 SCRSR1 in LSB-to-MSB order. 3.
  • Page 658 In synchronous serial communication, data on the transmission line is output from one falling edge of the serial clock to the next. Data confirmation is guaranteed at the rising edge of the serial clock. In serial communication, one character consists of data output starting with the LSB and ending with the MSB.
  • Page 659: Figure 15.18 Sample Sci Initialization Flowchart

    1. Set the clock selection in SCSCR1. Initialization Be sure to clear bits RIE, TIE, TEIE, and MPIE, TE and RE, to 0. Clear TE and RE bits 2. Set the data transfer format in in SCSCR1 to 0 SCSMR1. 3.
  • Page 660: Figure 15.19 Sample Serial Transmission Flowchart

    Serial Data Transmission (Synchronous Mode): Figure 15.19 shows a sample flowchart for serial transmission. Use the following procedure for serial data transmission after enabling the SCI for transmission. 1. SCI status check and transmit Start of transmission data write: Read SCSSR1 and check that the TDRE flag is set to 1, then write transmit data to Read TDRE flag in SCSSR1...
  • Page 661: Figure 15.20 Example Of Sci Transmit Operation

    In serial transmission, the SCI operates as described below. 1. The SCI monitors the TDRE flag in SCSSR1. When TDRE is cleared to 0, the SCI recognizes that data has been written to SCTDR1, and transfers the data from SCTDR1 to SCTSR1. 2.
  • Page 662: Figure 15.21 Sample Serial Reception Flowchart (1)

    Serial Data Reception (Synchronous Mode): Figure 15.21 shows a sample flowchart for serial reception. Use the following procedure for serial data reception after enabling the SCI for reception. When changing the operating mode from asynchronous to synchronous, be sure to check that the ORER, PER, and FER flags are all cleared to 0.
  • Page 663 Error handling ORER = 1? Overrun error handling Clear ORER flag in SCSSR1 to 0 Figure 15.21 Sample Serial Reception Flowchart (2) In serial reception, the SCI operates as described below. 1. The SCI performs internal initialization in synchronization with serial clock input or output. 2.
  • Page 664: Figure 15.22 Example Of Sci Receive Operation

    Transfer direction Serial clock Bit 7 Bit 0 Bit 7 Bit 0 Bit 1 Bit 6 Bit 7 Serial data RDRF ORER Data read from RXI interrupt ERI interrupt RXI interrupt SCRDR1 and RDRF request request due to request flag cleared to 0 in RXI overrun error interrupt handler One frame...
  • Page 665: Figure 15.23 Sample Flowchart For Serial Data Transmission And Reception

    1. SCI status check and transmit data Start of transmission/reception write: Read SCSSR1 and check that the TDRE flag is set to 1, then write transmit data to SCTDR1 and clear Read TDRE flag in SCSSR1 the TDRE flag to 0. Transition of the TDRE flag from 0 to 1 can also be identified by a TXI interrupt.
  • Page 666: Sci Interrupt Sources And Dmac

    15.4 SCI Interrupt Sources and DMAC The SCI has four interrupt sources: the transmit-end interrupt (TEI) request, receive-error interrupt (ERI) request, receive-data-full interrupt (RXI) request, and transmit-data-empty interrupt (TXI) request. Table 15.12 shows the interrupt sources and their relative priorities. Individual interrupt sources can be enabled or disabled with the TIE, RIE, and TEIE bits in SCRSR1, and the EIO bit in SCSPTR1.
  • Page 667: Usage Notes

    15.5 Usage Notes The following points should be noted when using the SCI. SCTDR1 Writing and the TDRE Flag: The TDRE flag in SCSSR1 is a status flag that indicates that transmit data has been transferred from SCTDR1 to SCTSR1. When the SCI transfers data from SCTDR1 to SCTSR1, the TDRE flag is set to 1.
  • Page 668 Sending a Break Signal: The input/output condition and level of the TxD pin are determined by bits SPB0IO and SPB0DT in the serial port register (SCSPTR1). This feature can be used to send a break signal. After the serial transmitter is initialized, the TxD pin function is not selected and the value of the SPB0DT bit substitutes for the mark state until the TE bit is set to 1 (i.e.
  • Page 669: Figure 15.24 Receive Data Sampling Timing In Asynchronous Mode

    16 clocks 8 clocks 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 Base clock –7.5 clocks +7.5 clocks...
  • Page 670: Figure 15.25 Example Of Synchronous Transmission By Dmac

    When Using the DMAC: When an external clock source is used as the serial clock, the transmit clock should not be input until at least 5 peripheral operating clock cycles after SCTDR1 is updated by the DMAC. Incorrect operation may result if the transmit clock is input within 4 cycles after SCTDR1 is updated.
  • Page 671 Rev. 3.0, 04/02, page 632 of 1064...
  • Page 672: Section 16 Serial Communication Interface With Fifo (Scif)

    (SCIF) 16.1 Overview The SH7751 Series is equipped with a single-channel serial communication interface with built-in FIFO buffers (Serial Communication Interface with FIFO: SCIF). The SCIF can perform asynchronous serial communication. Sixteen-stage FIFO registers are provided for both transmission and reception, enabling fast, efficient, and continuous communication.
  • Page 673 Four interrupt sources There are four interrupt sources—transmit-FIFO-data-empty, break, receive-FIFO-data-full, and receive-error—that can issue requests independently. The DMA controller (DMAC) can be activated to execute a data transfer by issuing a DMA transfer request in the event of a transmit-FIFO-data-empty or receive-FIFO-data-full interrupt. When not in use, the SCIF can be stopped by halting its clock supply to reduce power consumption.
  • Page 674: Block Diagram

    16.1.2 Block Diagram Figure 16.1 shows a block diagram of the SCIF. Internal Module data bus data bus SCBRR2 SCFRDR2 SCSMR2 SCFTDR2 (16-stage) (16-stage) SCLSR2 SCFDR2 Pφ SCFCR2 RxD2 SCRSR2 SCTSR2 SCFSR2 Baud rate Pφ/4 generator SCSCR2 SCSPTR2 Pφ/16 Transmission/ reception Pφ/64 control...
  • Page 675: Pin Configuration

    16.1.3 Pin Configuration Table 16.1 shows the SCIF pin configuration. Table 16.1 SCIF Pins Pin Name Abbreviation Function Serial clock pin MD0/SCK2 Clock input/output Receive data pin MD2/RxD2 Input Receive data input Transmit data pin MD1/TxD2 Output Transmit data output Modem control pin MD7/...
  • Page 676: Register Descriptions

    16.2 Register Descriptions 16.2.1 Receive Shift Register (SCRSR2) Bit: R/W: — — — — — — — — SCRSR2 is the register used to receive serial data. The SCIF sets serial data input from the RxD2 pin in SCRSR2 in the order received, starting with the LSB (bit 0), and converts it to parallel data.
  • Page 677: Transmit Shift Register (Sctsr2)

    16.2.3 Transmit Shift Register (SCTSR2) Bit: R/W: — — — — — — — — SCTSR2 is the register used to transmit serial data. To perform serial data transmission, the SCIF first transfers transmit data from SCFTDR2 to SCTSR2, then sends the data to the TxD2 pin starting with the LSB (bit 0). When transmission of one byte is completed, the next transmit data is transferred from SCFTDR2 to SCTSR2, and transmission started, automatically.
  • Page 678: Serial Mode Register (Scsmr2)

    16.2.5 Serial Mode Register (SCSMR2) Bit: — — — — — — — — Initial value: R/W: Bit: — STOP — CKS1 CKS0 Initial value: R/W: SCSMR2 is a 16-bit register used to set the SCIF’s serial transfer format and select the baud rate generator clock source.
  • Page 679 Bit 4: O/ Description Even parity* (Initial value) Odd parity* Notes: *1 When even parity is set, parity bit addition is performed in transmission so that the total number of 1-bits in the transmit character plus the parity bit is even. In reception, a check is performed to see if the total number of 1-bits in the receive character plus the parity bit is even.
  • Page 680: Serial Control Register (Scscr2)

    16.2.6 Serial Control Register (SCSCR2) Bit: — — — — — — — — Initial value: R/W: Bit: REIE — CKE1 CKE0 Initial value: R/W: The SCSCR2 register performs enabling or disabling of SCIF transfer operations, serial clock output, and interrupt requests, and selection of the serial clock source. SCSCR2 can be read or written to by the CPU at all times.
  • Page 681 Bit 6: RIE Description Receive-data-full interrupt (RXI) request, receive-error interrupt (ERI) request, and break interrupt (BRI) request disabled* (Initial value) Receive-data-full interrupt (RXI) request, receive-error interrupt (ERI) request, and break interrupt (BRI) request enabled Note: * An RXI interrupt request can be cleared by reading 1 from the RDF or DR flag, then clearing the flag to 0, or by clearing the RIE bit to 0.
  • Page 682 Bit 3—Receive Error Interrupt Enable (REIE): Enables or disables generation of receive-error interrupt (ERI) and break interrupt (BRI) requests. The REIE bit setting is valid only when the RIE bit is 0. Bit 3: REIE Description Receive-error interrupt (ERI) and break interrupt (BRI) requests disabled* (Initial value) Receive-error interrupt (ERI) and break interrupt (BRI) requests enabled Note: * Receive-error interrupt (ERI) and break interrupt (BRI) requests can be cleared by reading 1...
  • Page 683: Serial Status Register (Scfsr2)

    16.2.7 Serial Status Register (SCFSR2) Bit: PER3 PER2 PER1 PER0 FER3 FER2 FER1 FER0 Initial value: R/W: Bit: TEND TDFE Initial value: R/W: R/(W)* R/(W)* R/(W)* R/(W)* R/(W)* R/(W)* Note: * Only 0 can be written, to clear the flag. SCFSR2 is a 16-bit register.
  • Page 684 Bit 7—Receive Error (ER): Indicates that a framing error or parity error occurred during reception.* Note: * The ER flag is not affected and retains its previous state when the RE bit in SCSCR2 is cleared to 0. When a receive error occurs, the receive data is still transferred to SCFRDR2, and reception continues.
  • Page 685 Bit 6—Transmit End (TEND): Indicates that there is no valid data in SCFTDR2 when the last bit of the transmit character is sent, and transmission has been ended. Bit 6: TEND Description Transmission is in progress [Clearing conditions] When transmit data is written to SCFTDR2, and 0 is written to TEND after reading TEND = 1 When data is written to SCFTDR2 by the DMAC Transmission has been ended...
  • Page 686 Bit 5—Transmit FIFO Data Empty (TDFE): Indicates that data has been transferred from SCFTDR2 to SCTSR2, the number of data bytes in SCFTDR2 has fallen to or below the transmit trigger data number set by bits TTRG1 and TTRG0 in the FIFO control register (SCFCR2), and new transmit data can be written to SCFTDR2.
  • Page 687 Bit 3—Framing Error (FER): Indicates whether or not a framing error has been found in the data that is to be read from the receive FIFO data register (SCFRDR2). Bit 3: FER Description There is no framing error in the receive data that is to be read from SCFRDR2 (Initial value) [Clearing conditions]...
  • Page 688 Bit 1—Receive FIFO Data Full (RDF): Indicates that the received data has been transferred from SCRSR2 to SCFRDR2, and the number of receive data bytes in SCFRDR2 is equal to or greater than the receive trigger number set by bits RTRG1 and RTRG0 in the FIFO control register (SCFCR2).
  • Page 689: Bit Rate Register (Scbrr2)

    Bit 0—Receive Data Ready (DR): Indicates that there are fewer than the receive trigger set number of data bytes in SCFRDR2, and no further data has arrived for at least 15 etu after the stop bit of the last data received. Bit 0: DR Description Reception is in progress or has ended normally and there is no receive data...
  • Page 690: Fifo Control Register (Scfcr2)

    The SCBRR2 setting is found from the following equation. Asynchronous mode: φ P × 10 – 1 64 × 2 × B 2n–1 Where B: Bit rate (bits/s) N: SCBRR2 setting for baud rate generator (0 255) : Peripheral module operating frequency (MHz) Baud rate generator input clock (n = 0 to 3) (See the table below for the relation between n and the clock.) SCSMR2 Setting...
  • Page 691 SCFCR2 is initialized to H'0000 by a power-on reset or manual reset. It is not initialized in standby mode or in the module standby state. Bits 15 to 11—Reserved: These bits are always read as 0, and should only be written with 0. Bits 10, 9 and 8—...
  • Page 692 Bits 5 and 4—Transmit FIFO Data Number Trigger (TTRG1, TTRG0): These bits are used to set the number of remaining transmit data bytes that sets the transmit FIFO data register empty (TDFE) flag in the serial status register (SCFSR2). The TDFE flag is set when the number of transmit data bytes in SCFTDR2 is equal to or less than the trigger set number shown in the following table.
  • Page 693: Fifo Data Count Register (Scfdr2)

    Bit 0—Loopback Test (LOOP): Internally connects the transmit output pin (TxD2) and receive input pin (RxD2), and the pin and pin, enabling loopback testing. Bit 0: LOOP Description Loopback test disabled (Initial value) Loopback test enabled 16.2.10 FIFO Data Count Register (SCFDR2) SCFDR2 is a 16-bit register that indicates the number of data bytes stored in SCFTDR2 and SCFRDR2.
  • Page 694: Serial Port Register (Scsptr2)

    16.2.11 Serial Port Register (SCSPTR2) Bit: — — — — — — — — Initial value: R/W: Bit: RTSIO RTSDT CTSIO CTSDT SCKIO SCKDT SPB2IO SPB2DT Initial value: — — — — R/W: SCSPTR2 is a 16-bit readable/writable register that controls input/output and data for the port pins multiplexed with the serial communication interface with FIFO (SCIF) pins.
  • Page 695 Bit 6: RTSDT Description Input/output data is low-level Input/output data is high-level Bit 5—Serial Port CTS Port I/O (CTSIO): Specifies the serial port pin input/output condition. When the pin is actually set as a port output pin and outputs the value set by the CTSDT bit, the MCE bit in SCFCR2 should be cleared to 0.
  • Page 696 Bit 2: SCKDT Description Shows I/O data level is LOW Shows I/O data level is HIGH Bit 1—Serial Port Break I/O (SPB2IO): Specifies the serial port TxD2 pin output condition. When the TxD2 pin is actually set as a port output pin and outputs the value set by the SPB2DT bit, the TE bit in SCSCR2 should be cleared to 0.
  • Page 697: Figure 16.2 Md8/Rts2 Pin

    SCIF I/O port block diagrams are shown in figures 16.2 to 16.6. Reset RTSIO Internal data bus SPTRW Reset MD8/RTS2 RTSDT SCIF Modem control SPTRW enable signal* RTS2 signal Mode setting register SPTRR SPTRW: Write to SPTR SPTRR: Read SPTR Note: * The RTS2 pin function is designated as modem control by the MCE bit in SCFCR2.
  • Page 698: Figure 16.3 Md7/Cts2 Pin

    Reset CTSIO Internal data bus SPTRW Reset MD7/CTS2 CTSDT SCIF SPTRW Mode setting register CTS2 signal Modem control enable signal* SPTRR SPTRW: Write to SPTR SPTRR: Read SPTR Note: * The CTS2 pin function is designated as modem control by the MCE bit in SCFCR2. Figure 16.3 MD7/CTS2 Pin Rev.
  • Page 699: Figure 16.4 Md1/Txd2 Pin

    Reset SPB2IO Internal data bus SPTRW Reset MD1/TxD2 SPB2DT SCIF Transmit enable SPTRW signal Mode setting register Serial transmit data SPTRW: Write to SPTR Figure 16.4 MD1/TxD2 Pin SCIF MD2/RxD2 Serial receive data Mode setting register Internal data bus SPTRR SPTRR: Read SPTR Figure 16.5 MD2/RxD2 Pin Rev.
  • Page 700: Figure 16.6 Md0/Sck2 Pin

    Reset SCKIO Internal data bus SPTRW Reset MD0/SCK2 SCKDT SCIF SPTRW Clock output enable signal Serial clock output signal Mode setting register Serial clock input signal Clock input enable signal SPTRR SPTRW: Write to SPTR SPTRR: Read SPTR Note: * Signals that set the SCK2 pin function as internal clock output or external clock input according to the CKE0 and CKE1 bits in SCSCR2.
  • Page 701: Line Status Register (Sclsr2)

    16.2.12 Line Status Register (SCLSR2) Bit: — — — — — — — — Initial value: R/W: Bit: — — — — — — — ORER Initial value: R/W: (R/W)* Note: * Only 0 can be written, to clear the flag. Bits 15 to 1—Reserved: These bits are always read as 0, and should only be written with 0.
  • Page 702: Operation

    16.3 Operation 16.3.1 Overview The SCIF can carry out serial communication in asynchronous mode, in which synchronization is achieved character by character. See section 15.3.2, Operation in Asynchronous Mode, for details. Sixteen-stage FIFO buffers are provided for both transmission and reception, reducing the CPU overhead and enabling fast, continuous communication to be performed.
  • Page 703: Serial Operation

    Table 16.4 SCSCR2 Settings for SCIF Clock Source Selection SCSCR2 Setting SCIF Transmit/Receive Clock Bit 1: CKE1 Bit 0: CKE0 Mode Clock Source SCK2 Pin Function Asynchronous Internal SCIF does not use mode SCK2 pin Output clock with frequency of 16 times the bit rate External Inputs clock with...
  • Page 704: Table 16.5 Serial Transfer Formats

    Table 16.5 Serial Transfer Formats SCSMR2 Settings Serial Transfer Format and Frame Length CHR PE STOP 8-bit data STOP 8-bit data STOP STOP 8-bit data STOP 8-bit data STOP STOP 7-bit data STOP 7-bit data STOP STOP 7-bit data STOP 7-bit data STOP STOP Start bit...
  • Page 705 Data Transfer Operations SCIF Initialization: Before transmitting and receiving data, it is necessary to clear the TE and RE bits in SCSCR2 to 0, then initialize the SCIF as described below. When the transfer format, etc., is changed, the TE and RE bits must be cleared to 0 before making the change using the following procedure.
  • Page 706: Figure 16.7 Sample Scif Initialization Flowchart

    1. Set the clock selection in SCSCR2. Initialization Be sure to clear bits RIE and TIE, and bits TE and RE, to 0. Clear TE and RE bits 2. Set the data transfer format in in SCSCR2 to 0 SCSMR2. 3.
  • Page 707: Figure 16.8 Sample Serial Transmission Flowchart

    Serial Data Transmission: Figure 16.8 shows a sample flowchart for serial transmission. Use the following procedure for serial data transmission after enabling the SCIF for transmission. 1. SCIF status check and transmit data Start of transmission write: Read SCFSR2 and check that the Read TDFE flag in SCFSR2 TDFE flag is set to 1, then write transmit data to SCFTDR2, read 1...
  • Page 708 In serial transmission, the SCIF operates as described below. 1. When data is written into SCFTDR2, the SCIF transfers the data from SCFTDR2 to SCTSR2 and starts transmitting. Confirm that the TDFE flag in the serial status register (SCFSR2) is set to 1 before writing transmit data to SCFTDR2.
  • Page 709: Figure 16.9 Example Of Transmit Operation (Example With 8-Bit Data, Parity, One Stop Bit)

    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 SCFTDR2 and TDFE flag read as 1 then cleared to 0 by TXI interrupt handler One frame Figure 16.9 Example of Transmit Operation (Example with 8-Bit Data, Parity, One Stop Bit)
  • Page 710: Figure 16.11 Sample Serial Reception Flowchart (1)

    Serial Data Reception: Figure 16.11 shows a sample flowchart for serial reception. Use the following procedure for serial data reception after enabling the SCIF for reception. Start of reception 1. Receive error handling and break detection: Read the DR, ER, and BRK flags in SCFSR2, and the ORER flag Read ER, DR, BRK flags in in SCLSR2, to identify any...
  • Page 711: Figure 16.11 Sample Serial Reception Flowchart (2)

    1. Whether a framing error or parity error Error handling has occurred in the receive data read from SCFRDR2 can be ascertained from the FER and PER bits in ORER = 1? SCFSR2. 2. When a break signal is received, receive data is not transferred to Overrun error handling SCFRDR2 while the BRK flag is set.
  • Page 712 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 SCRSR2 in LSB-to-MSB order. 3.
  • Page 713: Figure 16.12 Example Of Scif Receive Operation (Example With 8-Bit Data, Parity, One Stop Bit)

    Figure 16.12 shows an example of the operation for reception. Start Data Parity Stop Start Data Parity Stop Serial data RXI interrupt request Data read and RDF flag ERI interrupt request read as 1 then cleared to generated by receive One frame 0 by RXI interrupt handler error...
  • Page 714: Scif Interrupt Sources And The Dmac

    16.4 SCIF Interrupt Sources and the DMAC The SCIF has four interrupt sources: 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 16.6 shows the interrupt sources and their order of priority. The interrupt sources are enabled or disabled by means of the TIE, RIE, and REIE bits in SCSCR2.
  • Page 715: Usage Notes

    See section 5, Exceptions, for priorities and the relationship with non-SCIF interrupts. 16.5 Usage Notes Note the following when using the SCIF. SCFTDR2 Writing and the TDFE Flag: The TDFE flag in the serial status register (SCFSR2) is set when the number of transmit data bytes written in the transmit FIFO data register (SCFTDR2) has fallen to or below the transmit trigger number set by bits TTRG1 and TTRG0 in the FIFO control register (SCFCR2).
  • Page 716: Figure 16.14 Receive Data Sampling Timing In Asynchronous Mode

    After the serial transmitter is initialized, the TxD2 pin function is not selected and the value of the SPB2DT bit substitutes for the mark state until the TE bit is set to 1 (i.e. transmission is enabled). The SPB2IO and SPB2DT bits should therefore be set to 1 (designating output and high level) beforehand.
  • Page 717 From equation (1), if F = 0 and D = 0.5, the receive margin is 46.875%, as given by equation (2). When D = 0.5 and F = 0: M = (0.5 – 1 / (2 16) ) 100% = 46.875% ..........(2) This is a theoretical value.
  • Page 718: Section 17 Smart Card Interface

    Section 17 Smart Card Interface 17.1 Overview An IC card (smart card) interface subset conforming to ISO/IEC 7816-3 (Identification Card) is supported as a serial communication interface (SCI) extension function. Switching between the normal serial communication interface and the smart card interface is carried out by means of a register setting.
  • Page 719: Block Diagram

    17.1.2 Block Diagram Figure 17.1 shows a block diagram of the smart card interface. Internal Module data bus data bus SCSCMR1 SCBRR1 SCRDR1 SCTDR1 SCSSR1 Pφ SCSCR1 SCRSR1 SCTSR1 Baud rate SCSMR1 Pφ/4 generator SCSPTR1 Pφ/16 Transmission/ reception control Pφ/64 Clock Parity generation Parity check...
  • Page 720: Pin Configuration

    17.1.3 Pin Configuration Table 17.1 shows the smart card interface pin configuration. Table 17.1 Smart Card Interface Pins Pin Name Abbreviation Function Serial clock pin Clock input/output Receive data pin Input Receive data input Transmit data pin Output Transmit data output 17.1.4 Register Configuration The smart card interface has the internal registers shown in table 17.2.
  • Page 721: Register Descriptions

    17.2 Register Descriptions Only registers that have been added, and bit functions that have been modified, for the smart card interface are described here. 17.2.1 Smart Card Mode Register (SCSCMR1) SCSCMR1 is an 8-bit readable/writable register that selects the smart card interface function. SCSCMR1 is initialized to H'00 by a power-on reset or manual reset, in standby mode, and in the module standby state.
  • Page 722: Serial Mode Register (Scsmr1)

    Bit 0—Smart Card Interface Mode Select (SMIF): Enables or disables the smart card interface function. Bit 0: SMIF Description Smart card interface function is disabled (Initial value) Smart card interface function is enabled 17.2.2 Serial Mode Register (SCSMR1) Bit 7 of SCSMR1 has a different function in smart card interface mode. Bit: GM(C/ STOP...
  • Page 723: Serial Control Register (Scscr1)

    17.2.3 Serial Control Register (SCSCR1) Bits 1 and 0 of SCSCR1 have a different function in smart card interface mode. Bit: — — CKE1 CKE0 Initial value: R/W: Bits 7 to 4: Operate in the same way as for the normal SCI. See section 15, Serial Communication Interface (SCI), for details.
  • Page 724: Serial Status Register (Scssr1)

    17.2.4 Serial Status Register (SCSSR1) Bit 4 of SCSSR1 has a different function in smart card interface mode. Coupled with this, the setting conditions for bit 2 (TEND) are also different. Bit: TDRE RDRF ORER FER/ TEND — — Initial value: R/W: R/(W)* R/(W)*...
  • Page 725: Operation

    Bit 2—Transmit End (TEND): The setting conditions for the TEND flag are as follows. Bit 2: TEND Description Transmission in progress [Clearing condition] When 0 is written to TDRE after reading TDRE = 1 Transmission has been ended (Initial value) [Setting conditions] Power-on reset, manual reset, standby mode, or module standby When the TE bit in SCSCR1 is 0 and the FER/ERS bit is also 0...
  • Page 726: Pin Connections

    Note: If an IC card is not connected, and both TE and RE are set to 1, closed transmission/reception is possible, enabling self-diagnosis to be carried out. Data line Clock line Reset line Px (port) SH7751 Series IC card Figure 17.2 Schematic Diagram of Smart Card Interface Pin Connections Rev. 3.0, 04/02, page 687 of 1064...
  • Page 727: Data Format

    17.3.3 Data Format Figure 17.3 shows the smart card interface data format. In reception in this mode, a parity check is carried out on each frame, and if an error is detected an error signal is sent back to the transmitting side to request retransmission of the data.
  • Page 728: Register Settings

    If a parity error occurs, however, the receiving station outputs an error signal (DE, low-level) to request retransmission of the data. After outputting the error signal for the prescribed length of time, the receiving station places the signal line in the high-impedance state again. The signal line is pulled high again by a pull-up resistor.
  • Page 729: Figure 17.4 Tend Generation Timing

    I/O data Ds Da Db Dc Dd De Dg Dh Dp Guard time 12.5 etu GM = 0 (TEND interrupt) 11.0 etu GM = 1 etu: Elementary Time Unit (time for transfer of 1 bit) Figure 17.4 TEND Generation Timing Bit Rate Register (SCBRR1) Setting: SCBRR1 is used to set the bit rate.
  • Page 730: Clock

    State (a) Direct convention (SDIR = SINV = O/ = 0) State (b) Inverse convention (SDIR = SINV = O/ = 1) Figure 17.5 Sample Start Character Waveforms 17.3.5 Clock Only an internal clock generated by the on-chip baud rate generator can be used as the transmit/receive clock for the smart card interface.
  • Page 731: Table 17.5 Examples Of Bit Rate B (Bits/S) For Various Scbrr1 Settings (When N = 0)

    Table 17.5 Examples of Bit Rate B (bits/s) for Various SCBRR1 Settings (When n = 0) (MHz) 7.1424 10.00 10.7136 14.2848 25.0 33.0 50.0 9600.0 13440.9 14400.0 19200.0 33602.2 44354.8 67204.3 4800.0 6720.4 7200.0 9600.0 16801.1 22177.4 33602.2 3200.0 4480.3 4800.0 6400.0 11200.7...
  • Page 732: Figure 17.6 Difference In Clock Output According To Gm Bit Setting

    The bit rate error is given by the following equation: P φ × 10 – 1 × 100 Error (%) = 1488 × 2 × B × (N + 1) 2n–1 Table 17.8 shows the relationship between the smart card interface transmit/receive clock register settings and the output state.
  • Page 733: Data Transfer Operations

    17.3.6 Data Transfer Operations Initialization: Before transmitting and receiving data, the smart card interface must be initialized as described below. Initialization is also necessary when switching from transmit mode to receive mode, or vice versa. Figure 17.7 shows a sample initialization processing flowchart. 1.
  • Page 734: Figure 17.7 Sample Initialization Flowchart

    Initialization Clear TE and RE bits in SCSCR1 to 0 Clear FER/ERS, PER, and ORER flags in SCSCR1 to 0 In SCSMR1, set parity in O/ bit, clock in CKS1 and CKS0 bits, and set GM Set SMIF, SDIR, and SINV bits in SCSCMR1 Set value in SCBRR1 In SCSCR1, set clock in CKE1...
  • Page 735 Serial Data Transmission: As data transmission in smart card mode involves error signal sampling and retransmission processing, the processing procedure is different from that for the normal SCI. Figure 17.8 shows a sample transmission processing flowchart. 1. Perform smart card interface mode initialization as described in Initialization above. 2.
  • Page 736: Figure 17.8 Sample Transmission Processing Flowchart

    Start Initialization Start of transmission FER/ERS = 0? Error handling TEND = 1? Write transmit data to SCTDR1, and clear TDRE flag in SCSSR1 to 0 All data transmitted? FER/ERS = 0? Error handling TEND = 1? Clear TE bit in SCSCR1 to 0 End of transmission Figure 17.8 Sample Transmission Processing Flowchart Rev.
  • Page 737 Serial Data Reception: Data reception in smart card mode uses the same processing procedure as for the normal SCI. Figure 17.9 shows a sample reception processing flowchart. 1. Perform smart card interface mode initialization as described in Initialization above. 2. Check that the ORER flag and PER flag in SCSSR1 are cleared to 0. If either is set, perform the appropriate receive error handling, then clear both the ORER and the PER flag to 0.
  • Page 738: Figure 17.9 Sample Reception Processing Flowchart

    Start Initialization Start of reception ORER = 0 and PER = 0? Error handling RDRF = 1? Read receive data from SCRDR1 and clear RDRF flag in SCSSR1 to 0 All data received? Clear RE bit in SCSCR1 to 0 End of reception Figure 17.9 Sample Reception Processing Flowchart Mode Switching Operation: When switching from receive mode to transmit mode, first confirm...
  • Page 739: Table 17.9 Smart Card Mode Operating States And Interrupt Sources

    Interrupt Operation: There are three interrupt sources in smart card interface mode, generating transmit-data-empty interrupt (TXI) requests, transmit/receive-error interrupt (ERI) requests, and receive-data-full interrupt (RXI) requests. The transmit-end interrupt (TEI) request cannot be used in this mode. When the TEND flag in SCSSR1 is set to 1, a TXI interrupt request is generated. When the RDRF flag in SCSSR1 is set to 1, an RXI interrupt request is generated.
  • Page 740: Usage Notes

    17.4 Usage Notes The following points should be noted when using the SCI as a smart card interface. (1) Receive Data Sampling Timing and Receive Margin In asynchronous mode, the SCI operates on a base clock with a frequency of 372 times the transfer rate.
  • Page 741: Figure 17.11 Retransfer Operation In Sci Receive Mode

    From the above equation, if F = 0 and D = 0.5, the receive margin is 49.866%, as given by the following equation. When D = 0.5 and F = 0: M = (0.5 – 1/2 372) 100% = 49.866% (2) Retransfer Operations Retransfer operations are performed by the SCI in receive mode and transmit mode as described below.
  • Page 742: Figure 17.12 Retransfer Operation In Sci Transmit Mode

    Retransfer Operation when SCI is in Transmit Mode: Figure 17.12 illustrates the retransfer operation when the SCI is in transmit mode. 1. If an error signal is sent back from the receiving side after transmission of one frame is completed, the FER/ERS bit in SCSSR1 is set to 1. If the RIE bit in SCSCR1 is enabled at this time, an ERI interrupt request is generated.
  • Page 743: Figure 17.13 Procedure For Stopping And Restarting The Clock

    (3) Standby Mode and Clock When switching between smart card interface mode and standby mode, the following procedures should be used to maintain the clock duty cycle. Switching from Smart Card Interface Mode to Standby Mode: 1. Set the SBP1IO and SBP1DT bits in SCSPTR1 to the values for the fixed output state in standby mode.
  • Page 744 (4) Power-On and Clock The following procedure should be used to secure the clock duty cycle after powering on. 1. The initial state is port input and high impedance. Use pull-up or pull-down resistors to fix the potential. 2. Fix at the output specified by the CKE1 bit in the serial control register (SCSCR1). 3.
  • Page 745 Rev. 3.0, 04/02, page 706 of 1064...
  • Page 746: Section 18 I/O Ports

    Section 18 I/O Ports 18.1 Overview The SH7751 Series has a 32-bit general-purpose I/O port, SCI I/O port, and SCIF I/O port. 18.1.1 Features The features of the general-purpose I/O port are as follows: Available only in PCI-disabled mode. 32-bit I/O port with input/output direction independently specifiable for each bit.
  • Page 747: Block Diagrams

    18.1.2 Block Diagrams Figure 18.1 is a block diagram of the 16-bit general-purpose I/O port A with interrupt function. PBnPUP Pull-up resistor PORTEN Internal bus Port 15 (input/ ADn output data output)/AD15 Port 0 (input/ output)/AD0 PDTRW ADnDIR PBnIO Data input strobe Interrupt PTIRENn controller...
  • Page 748: Figure 18.2 16-Bit Port B

    Figure 18.2 is a block diagram of the 16-bit general-purpose I/O port B, which has no interrupt function. PBnPUP Pull-up resistor PORTEN Internal bus Port 31 (input/ ADn output data output)/AD31 Port 16 (input/ PDTRW output)/AD16 ADnDIR PBnIO Data input strobe PORTEN 0: Port not available 1: Port available PBnPuP...
  • Page 749: Figure 18.3 Sck Pin

    SCI I/O port block diagrams are shown in figures 18.3 to 18.5. Reset SPB1IO Internal data bus SPTRW Reset SPB1DT SPTRW Clock output enable signal Serial clock output signal Serial clock input signal Clock input enable signal SPTRR SPTRW: Write to SPTR SPTRR: Read SPTR Note: * Signals that set the SCK pin function as internal clock output or external clock input according to the CKE0 and CKE1 bits in SCSCR1 and the C/ bit in SCSMR1.
  • Page 750: Figure 18.4 Txd Pin

    Reset SPB0IO Internal data bus SPTRW Reset SPB0DT Transmit enable signal SPTRW Serial transmit data SPTRW: Write to SPTR Figure 18.4 TxD Pin Serial receive data Internal data bus SPTRR SPTRR: Read SPTR Figure 18.5 RxD Pin Rev. 3.0, 04/02, page 711 of 1064...
  • Page 751: Figure 18.6 Md1/Txd2 Pin

    SCIF I/O port block diagrams are shown in figures 18.6 to 18.10. Reset SPB2IO Internal data bus SPTRW Reset MD1/TxD2 SPB2DT SCIF Transmit enable SPTRW signal Mode setting register Serial transmit data SPTRW: Write to SPTR Figure 18.6 MD1/TxD2 Pin SCIF MD2/RxD2 Serial receive...
  • Page 752: Figure 18.8 Md0/Sck2 Pin

    Reset SCKIO Internal data bus SPTRW Reset MD0/SCK2 SCKDT SCIF SPTRW Clock output enable signal Mode setting Serial clock output signal register Serial clock input signal Clock input enable signal SPTRR SPTRW: Write to SPTR SPTRR: Read SPTR Note: * Signals that set the SCK2 pin function as internal clock output or external clock input according to the CKE0 and CKE1 bits in SCSCR2.
  • Page 753: Figure 18.9 Md7/Cts2 Pin

    Reset CTSIO Internal data bus SPTRW Reset MD7/CTS2 CTSDT SCIF SPTRW Mode setting register CTS2 signal Modem control enable signal* SPTRR SPTRW: Write to SPTR SPTRR: Read SPTR Note: * MCE bit in SCFCR2: signal that designates modem control as the CTS2 pin function. Figure 18.9 MD7/CTS2 Pin Rev.
  • Page 754: Pin Configuration

    Reset RTSIO Internal data bus SPTRW Reset MD8/RTS2 RTSDT SCIF Modem control SPTRW enable signal* Mode setting register RTS2 signal SPTRR SPTRW: Write to SPTR SPTRR: Read SPTR Note: * MCE bit in SCFCR2: signal that designates modem control as the RTS2 pin function. Figure 18.10 MD8/RTS2 Pin 18.1.3 Pin Configuration...
  • Page 755 Table 18.1 32-Bit General-Purpose I/O Port Pins (cont) Pin Name Signal Function Port 23 pin AD23/PORT23 I/O port Port 22 pin AD22/PORT22 I/O port Port 21 pin AD21/PORT21 I/O port Port 20 pin AD20/PORT20 I/O port Port 19 pin AD19/PORT19 I/O port Port 18 pin AD18/PORT18...
  • Page 756: Table 18.2 Sci I/O Port Pins

    Table 18.2 shows the SCI I/O port pin configuration. Table 18.2 SCI I/O Port Pins Pin Name Abbreviation Function Serial clock pin Clock input/output Receive data pin Input Receive data input Transmit data pin Output Transmit data output Note: They are made to function as serial pins by performing SCI operation settings with the TE, RE, CKEI, and CKE0 bits in SCSCR1 and the C/ bit in SCSMR1.
  • Page 757: Register Configuration

    18.1.4 Register Configuration The 32-bit general-purpose I/O port, SCI I/O port, and SCIF I/O port have seven registers, as shown in table 18.4. Table 18.4 I/O Port Registers Area 7 Access Name Abbreviation R/W Initial Value* P4 Address Address Size Port control register A PCTRA H'00000000...
  • Page 758: Register Descriptions

    18.2 Register Descriptions 18.2.1 Port Control Register A (PCTRA) Port control register A (PCTRA) is a 32-bit readable/writable register that controls the input/output direction and pull-up for each bit in the 16-bit port A (port 15 pin to port 0 pin). As the initial value of port data register A (PDTRA) is undefined, all the bits in the 16-bit port A should be set to output with PCTRA after writing a value to the PDTRA register.
  • Page 759: Port Data Register A (Pdtra)

    Bit 2n (n = 0–15)—Port I/O Control (PBnIO): Specifies whether each bit in the 16-bit port A is an input or an output. Bit 2n: PBnIO Description Bit m (m = 0–15) of 16-bit port A is an input (Initial value) Bit m (m = 0–15) of 16-bit port A is an output 18.2.2 Port Data Register A (PDTRA)
  • Page 760 Bit: PB31PUP PB31IO PB30PUP PB30IO PB29PUP PB29IO PB28PUP PB28IO Initial value: R/W: Bit: PB27PUP PB27IO PB26PUP PB26IO PB25PUP PB25IO PB24PUP PB24IO Initial value: R/W: Bit: PB23PUP PB23IO PB22PUP PB22IO PB21PUP PB21IO PB20PUP PB20IO Initial value: R/W: Bit: PB19PUP PB19IO PB18PUP PB18IO PB17PUP PB17IO...
  • Page 761: Port Data Register B (Pdtrb)

    18.2.4 Port Data Register B (PDTRB) Port data register B (PDTRB) is a 16-bit readable/writable register used as a data latch for each bit in the 16-bit port B. When a bit is set as an output, the value written to the PDTRB register is output from the external pin.
  • Page 762: Serial Port Register (Scsptr1)

    Bit: PTIREN15 PTIREN14 PTIREN13 PTIREN12 PTIREN11 PTIREN10 PTIREN9 PTIREN8 Initial value: R/W: Bit: PTIREN7 PTIREN6 PTIREN5 PTIREN4 PTIREN3 PTIREN2 PTIREN1 PTIREN0 Initial value: R/W: Bit n (n = 0–15)—Port Interrupt Enable (PTIRENn): Specifies whether interrupt input is performed for each bit. Bit n: PTIRENn Description Port m (m = 0–15) of 16-bit port A is used as a normal I/O port...
  • Page 763 Bit 3—Serial Port Clock Port I/O (SPB1IO): Specifies serial port SCK pin input/output. When the SCK pin is actually set as a port output pin and outputs the value set by the SPB1DT bit, the bit in SCSMR1 and the CKE1 and CKE0 bits in SCSCR1 should be cleared to 0. Bit 3: SPB1IO Description SPB1DT bit value is not output to the SCK pin...
  • Page 764: Serial Port Register (Scsptr2)

    18.2.7 Serial Port Register (SCSPTR2) Bit: — — — — — — — — Initial value: R/W: Bit: RTSIO RTSDT CTSIO CTSDT SCKIO SCKDT SPB2IO SPB2DT Initial value: — — — — R/W: The serial port register (SCSPTR2) is a 16-bit readable/writable register that controls input/output and data for the port pins multiplexed with the serial communication interface with FIFO (SCIF) pins.
  • Page 765 Bit 6—Serial Port RTS Port Data (RTSDT): Specifies the serial port pin input/output data. Input or output is specified by the RTSIO pin (see the description of bit 7, RTSIO, for details). When the pin is designated as an output, the value of the RTSDT bit is output to the pin.
  • Page 766 SCKIO bit, the value of the SCK2 pin is fetched from the SCKDT bit. The initial value after a power-on reset or manual reset is undefined. Bit 2: SCKDT Description Shows I/O data level is LOW Shows I/O data level is HIGH Bit 1—Serial Port Break I/O (SPB2IO): Specifies the serial port TxD2 pin output condition.
  • Page 767 Rev. 3.0, 04/02, page 728 of 1064...
  • Page 768: Section 19 Interrupt Controller (Intc)

    Section 19 Interrupt Controller (INTC) 19.1 Overview The interrupt controller (INTC) ascertains the priority of interrupt sources and controls interrupt requests to the CPU. The INTC registers set the order of priority of each interrupt, allowing the user to handle interrupt requests according to user-set priority. 19.1.1 Features The INTC has the following features.
  • Page 769: Figure 19.1 Block Diagram Of Intc

    WDT: Watchdog timer REF: Memory refresh controller section of the bus state controller DMAC: Direct memory access controller H-UDI: Hitachi user debug interface unit GPIO: I/O port PCIC: PCI bus controller ICR: Interrupt control register IPRA–IPRD: Interrupt priority registers A–D...
  • Page 770: Pin Configuration

    19.1.3 Pin Configuration Table 19.1 shows the INTC pin configuration. Table 19.1 INTC Pins Pin Name Abbreviation Function Nonmaskable interrupt Input Input of nonmaskable interrupt request input pin signal Interrupt input pins Input Input of interrupt request signals – (maskable by I3–I0 in SR) 19.1.4...
  • Page 771: Interrupt Sources

    19.2 Interrupt Sources There are three types of interrupt sources: NMI, IRL, and on-chip peripheral modules. Each interrupt has a priority level (16–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. 19.2.1 NMI Interrupt The NMI interrupt has the highest priority level of 16.
  • Page 772: Irl Interrupts

    (interrupt priority level 15). A value of 15 (1111) indicates no interrupt request (interrupt priority level 0). SH7751 Series Priority Interrupt encoder requests Figure 19.2 Example of IRL Interrupt Connection Rev. 3.0, 04/02, page 733 of 1064...
  • Page 773: Table 19.3 - Pins And Interrupt Levels

    Table 19.3 – Pins and Interrupt Levels Interrupt Priority Level Interrupt Request Level 15 interrupt request Level 14 interrupt request Level 13 interrupt request Level 12 interrupt request Level 11 interrupt request Level 10 interrupt request Level 9 interrupt request...
  • Page 774: On-Chip Peripheral Module Interrupts

    19.2.3 On-Chip Peripheral Module Interrupts On-chip peripheral module interrupts are generated by the following ten modules: Hitachi user debug interface unit (H-UDI) Direct memory access controller (DMAC) Timer unit (TMU) Realtime clock (RTC) Serial communication interface (SCI) Serial communication interface with FIFO (SCIF)
  • Page 775: Interrupt Exception Handling And Priority

    19.2.4 Interrupt Exception Handling and Priority Table 19.4 lists the codes for the interrupt event register (INTEVT), and the order of interrupt priority. Each interrupt source is assigned a unique INTEVT code. The start address of the interrupt handler is common to each interrupt source. This is why, for instance, the value of INTEVT is used as an offset at the start of the interrupt handler and branched to in order to identify the interrupt source.
  • Page 776: Table 19.4 Interrupt Exception Handling Sources And Priority Order

    Table 19.4 Interrupt Exception Handling Sources and Priority Order INTEVT Interrupt Priority IPR (Bit Priority within Default Interrupt Source Code (Initial Value) Numbers) IPR Setting Unit Priority H'1C0 — — High – 0 H'200 — — – 1 H'220 —...
  • Page 777 Table 19.4 Interrupt Exception Handling Sources and Priority Order (cont) INTEVT Interrupt Priority IPR (Bit Priority within Default Interrupt Source Code (Initial Value) Numbers) IPR Setting Unit Priority PCIC (0) PCISERR H'A00 15–0 (0) INTPRI00 — High (3–0) PCIC (1) PCIERR H'AE0 15–0 (0) INTPRI00...
  • Page 778: Register Descriptions

    ATI: Alarm interrupt PRI: Periodic interrupt CUI: Carry-up interrupt ERI: Receive-error interrupt RXI: Receive-data-full interrupt TXI: Transmit-data-empty interrupt TEI: Transmit-end interrupt BRI: Break interrupt request ITI: Interval timer interrupt RCMI: Compare-match interrupt ROVI: Refresh counter overflow interrupt H-UDI: H-UDI interrupt GPIOI: I/O port interrupt DMTE0–DMTE7: DMAC transfer end interrupts DMAE:...
  • Page 779: Interrupt Control Register (Icr)

    IPRD Bit: Initial value: R/W: Bit: Initial value: R/W: Table 19.5 shows the relationship between the interrupt request sources and the IPRA–IPRD register bits. Table 19.5 Interrupt Request Sources and IPRA–IPRD Registers Bits Register 15–12 11–8 7–4 3–0 Interrupt priority register A TMU0 TMU1 TMU2...
  • Page 780 Bit: Bit name: NMIL — — — — NMIB NMIE Initial value: 0/1* R/W: — — — — Bit: Bit name: IRLM — — — — — — — Initial value: R/W: — — — — — — — Note: * 1 when NMI pin input is high, 0 when low. Bit 15—NMI Input Level (NMIL): Sets the level of the signal input at the NMI pin.
  • Page 781: Interrupt Priority Level Settting Register 00 (Intpri00)

    Bit 8—NMI Edge Select (NMIE): Specifies whether the falling or rising edge of the interrupt request signal to the NMI pin is detected. Bit 8: NMIE Description Interrupt request detected on falling edge of NMI input (Initial value) Interrupt request detected on rising edge of NMI input Bit 7—IRL Pin Mode (IRLM): Specifies whether pins –...
  • Page 782: Interrupt Factor Register 00 (Intreq00)

    Table 19.6 Interrupt Request Sources and INTPRI00 Register Bits Register 31 to 28 27 to 24 23 to 20 19 to 16 15 to 12 11 to 8 7 to 4 3 to 0 Interrupt priority Reserved Reserved Reserved Reserved TMU ch4 TMU ch3 PCI (1) PCI (0) level setting register...
  • Page 783: Interrupt Mask Register 00 (Intmsk00)

    19.3.5 Interrupt Mask Register 00 (INTMSK00) The interrupt mask register 00 (INTMSK00) specifies whether or not to mask individual interrupts each time they are requested. The INTMSK00 register is a 32-bit register. It is initialized to H'000003FF at a reset. The values are retained in standby mode. To clear each interrupt mask, write 1 to the corresponding bit of the INTMSKCLR00 register.
  • Page 784: Interrupt Mask Clear Register 00 (Intmskclr00)

    19.3.6 Interrupt Mask Clear Register 00 (INTMSKCLR00) The interrupt mask clear register 00 (INTMSKCLR00) clears the masks for each request of the corresponding interrupt. INTMSKCLR00 is a 32-bit write-only register. Bit: ..Initial value: — —...
  • Page 785: Intreq00, Intmsk00, And Intmskclr00 Bit Allocation

    19.3.7 INTREQ00, INTMSK00, and INTMSKCLR00 bit allocation The following shows the relationship between individual bits in the register and interrupt factors. Table 19.7 Bit Allocation Bit No. Module Interrupt 31 to 10 Reserved Reserved TUNI4 TUNI3 PCIERR PCIPWDWN PCIPWON PCIDMA0 PCIDMA1 PCIDMA2 PCIDMA3...
  • Page 786: Intc Operation

    Notes: 1. The interrupt mask bits (I3–I0) in the status register (SR) are not changed by acceptance of an interrupt in the SH7751 Series. 2. The interrupt source flag should be cleared in the exception handling routine. To ensure that an interrupt request that should have been cleared is not inadvertently accepted again, read the interrupt source flag after it has been cleared, then wait for the interval shown in table 19.8 (Time for priority decision and SR mask bit comparison)
  • Page 787: Figure 19.3 Interrupt Operation Flowchart

    Program execution state Interrupt generated? (BL bit in SR = 0) or (sleep or standby mode)? NMIB in ICR = 1 and NMI? NMI? Level 15 interrupt? Level 14 interrupt? I3–I0* = level 14 or lower? Level 1 interrupt? I3–I0 = level 13 or Set interrupt source lower?
  • Page 788: Multiple Interrupts

    19.4.2 Multiple Interrupts When handling multiple interrupts, interrupt handling should include the following procedures: 1. Branch to a specific interrupt handler corresponding to a code set in the INTEVT register. The code in INTEVT can be used as a branch-offset for branching to the specific handler. 2.
  • Page 789: Interrupt Response Time

    One cycle of internal clock supplied to CPU, etc. Bcyc: One CKIO cycle Latency of instruction Note: * In the SH7751, this includes the case where the mask bit (IMASK) in SR is changed and a new interrupt is generated. Rev. 3.0, 04/02, page 750 of 1064...
  • Page 790: Section 20 User Break Controller (Ubc)

    Section 20 User Break Controller (UBC) 20.1 Overview The user break controller (UBC) provides functions that simplify program debugging. When break conditions are set in the UBC, a user break interrupt is generated according to the contents of the bus cycle generated by the CPU. This function makes it easy to design an effective self- monitoring debugger, enabling programs to be debugged with the chip alone, without using an in- circuit emulator.
  • Page 791: Block Diagram

    20.1.2 Block Diagram Figure 20.1 shows a block diagram of the UBC. Access Address Data control Channel A Access BBRA comparator BARA Address BASRA comparator BAMRA Channel B Access BBRB comparator BARB Address BASRB comparator BAMRB BDRB Data comparator BDMRB BBRA: Break bus cycle register A BARA:...
  • Page 792: Table 20.1 Ubc Registers

    Table 20.1 shows the UBC registers. Table 20.1 UBC Registers Area 7 Access Name Abbreviation Initial Value P4 Address Address Size Break address BARA Undefined H'FF200000 H'1F200000 register A Break address BAMRA Undefined H'FF200004 H'1F200004 mask register A Break bus BBRA H'0000 H'FF200008...
  • Page 793: Register Descriptions

    2. Execute instructions requiring 5 states for execution after the memory store instruction that updated the register. As the SH7751 Series executes two instructions in parallel and a minimum of 0.5 state is required for execution of one instruction, 11 instructions must be inserted.
  • Page 794: Break Address Register A (Bara)

    20.2.2 Break Address Register A (BARA) Bit: BAA31 BAA30 BAA29 BAA28 BAA27 BAA26 BAA25 BAA24 Initial value: R/W: Bit: BAA23 BAA22 BAA21 BAA20 BAA19 BAA18 BAA17 BAA16 Initial value: R/W: Bit: BAA15 BAA14 BAA13 BAA12 BAA11 BAA10 BAA9 BAA8 Initial value: R/W: Bit: BAA7...
  • Page 795: Break Asid Register A (Basra)

    20.2.3 Break ASID Register A (BASRA) Bit: BASA7 BASA6 BASA5 BASA4 BASA3 BASA2 BASA1 BASA0 Initial value: R/W: Note: *: Undefined Break ASID register A (BASRA) is an 8-bit readable/writable register that specifies the ASID used in the channel A break conditions. BASRA is not initialized by a power-on reset or manual reset.
  • Page 796: Break Bus Cycle Register A (Bbra)

    Bits 3, 1, and 0—Break Address Mask A2 to A0 (BAMA2–BAMA0): These bits specify which bits of the channel A break address (BAA31–BAA0) set in BARA are to be masked. Bit 3: BAMA2 Bit 1: BAMA1 Bit 0: BAMA0 Description All BARA bits are included in break conditions Lower 10 bits of BARA are masked, and not included in break conditions...
  • Page 797 Bits 5 and 4—Instruction Access/Operand Access Select A (IDA1, IDA0): These bits specify whether an instruction access cycle or an operand access cycle is used as the bus cycle in the channel A break conditions. Bit 5: IDA1 Bit 4: IDA0 Description Condition comparison is not performed (Initial value)
  • Page 798: Break Address Register B (Barb)

    20.2.6 Break Address Register B (BARB) BARB is the channel B break address register. The bit configuration is the same as for BARA. 20.2.7 Break ASID Register B (BASRB) BASRB is the channel B break ASID register. The bit configuration is the same as for BASRA. 20.2.8 Break Address Mask Register B (BAMRB) BAMRB is the channel B break address mask register.
  • Page 799: Break Data Mask Register B (Bdmrb)

    Bits 31 to 0—Break Data B31 to B0 (BDB31–BDB0): These bits hold the data (bits 31–0) to be used in the channel B break conditions. 20.2.10 Break Data Mask Register B (BDMRB) Bit: BDMB31 BDMB30 BDMB29 BDMB28 BDMB27 BDMB26 BDMB25 BDMB24 Initial value: R/W: Bit:...
  • Page 800: Break Bus Cycle Register B (Bbrb)

    Bits 31 to 0—Break Data Mask B31 to B0 (BDMB31–BDMB0): These bits specify whether the corresponding bit of the channel B break data (BDB31–BDB0) set in BDRB is to be masked. Bit 31–0: BDMBn Description Channel B break data bit BDBn is included in break conditions Channel B break data bit BDBn is masked, and not included in break conditions n = 31 to 0...
  • Page 801 Bit 15—Condition Match Flag A (CMFA): Set to 1 when a break condition set for channel A is satisfied. This flag is not cleared to 0 (to confirm that the flag is set again after once being set, it should be cleared with a write). Bit 15: CMFA Description Channel A break condition is not matched...
  • Page 802: Operation

    Bit 6—PC Break Select B (PCBB): Specifies whether a channel B instruction access cycle break is to be effected before or after the instruction is executed. This bit is not initialized by a power-on reset or manual reset. Bit 6: PCBB Description Channel B PC break is effected before instruction execution Channel B PC break is effected after instruction execution...
  • Page 803: Explanation Of Terms Relating To Instruction Intervals

    The operand accesses for the PREF, OCBP, OCBWB, and OCBI instructions are accesses with no access data. The SH7751 Series handles all operand accesses as having a data size. The data size can be byte, word, longword, or quadword. The operand data size for the PREF, OCBP, OCBWB, MOVCA.L, and OCBI instructions is treated as longword.
  • Page 804: User Break Operation Sequence

    20.3.3 User Break Operation Sequence The sequence of operations from setting of break conditions to user break exception handling is described below. 1. Specify pre- or post-execution breaking in the case of an instruction access, inclusion or exclusion of the data bus value in the break conditions in the case of an operand access, and use of independent or sequential channel A and B break conditions, in the break control register (BRCR).
  • Page 805: Instruction Access Cycle Break

    20.3.4 Instruction Access Cycle Break 1. When an instruction access/read/word setting is made in the break bus cycle register (BBRA/BBRB), an instruction access cycle can be used as a break condition. In this case, breaking before or after execution of the relevant instruction can be selected with the PCBA/PCBB bit in the break control register (BRCR).
  • Page 806: Operand Access Cycle Break

    20.3.5 Operand Access Cycle Break 1. In the case of an operand access cycle break, the bits included in address bus comparison vary as shown below according to the data size specification in the break bus cycle register (BBRA/BBRB). Data Size Address Bits Compared Quadword (100) Address bits A31–A3...
  • Page 807: Condition Match Flag Setting

    20.3.6 Condition Match Flag Setting 1. Instruction access with post-execution condition, or operand access The flag is set when execution of the instruction that causes the break is completed. As an exception to this, however, in the case of an instruction with more than one operand access the flag may be set on detection of the match condition alone, without waiting for execution of the instruction to be completed.
  • Page 808: Contiguous A And B Settings For Sequential Conditions

    4. When operand access (address only) is set as a break condition, the address of the instruction to be executed after the instruction at which the condition match occurred is saved to SPC. 5. When operand access (address + data) is set as a break condition, execution of the instruction at which the condition match occurred is completed.
  • Page 809: Usage Notes

    3. Operand access match on channel A, instruction access match on channel B Instruction B is 0 to 3 instructions after Sequential operation is not guaranteed instruction A Instruction B is 4 or more instructions Sequential operation is guaranteed after instruction A 4.
  • Page 810: User Break Debug Support Function

    e. In the case of an RTE delay slot The BL bit value before execution of a delay slot instruction is the same as the BL bit value before execution of an RTE instruction. The BL bit value after execution of a delay slot instruction is the same as the first BL bit value for the first instruction executed on returning by means of an RTE instruction (the same as the value of the BL bit in SSR before execution of the RTE instruction).
  • Page 811: Figure 20.2 User Break Debug Support Function Flowchart

    Exception/interrupt generation Hardware operation SPC ← PC SSR ← SR SR.BL ← B'1 SR.MD ← B'1 SR.RB ← B'1 Exception Trap Exception/ interrupt/trap? Interrupt EXPEVT ← H'160 EXPEVT ← exception code INTEVT ← interrupt code TRA ← TRAPA (imm) SGR ← R15 Reset exception? (BRCR.UBDE == 1) &&...
  • Page 812: Examples Of Use

    20.5 Examples of Use Instruction Access Cycle Break Condition Settings Register settings: BASRA = H'80 / BARA = H'00000404 / BAMRA = H'00 / BBRA = H'0014 / BASRB = H'70 / BARB = H'00008010 / BAMRB = H'01 / BBRB = H'0014 / BDRB = H'00000000 / BDMRB = H'00000000 / BRCR = H'0400 Conditions set: Independent channel A/channel B mode Channel A: ASID: H'80 / address: H'00000404 / address mask: H'00...
  • Page 813 Channel B: ASID: H'70 / address: H'00031415 / address mask: H'00 Data: H'00000000 / data mask: H'00000000 Bus cycle: CPU, instruction access (pre-instruction-execution), read (operand size not included in conditions) A user break interrupt is not generated on channel A since the instruction access is not a write cycle.
  • Page 814: User Break Controller Stop Function

    20.6 User Break Controller Stop Function This function stops the clock supplied to the user break controller and is used to minimize power dissipation when the chip is operating. Note that, if you use this function, you cannot use the user break controller.
  • Page 815: Examples Of Stopping And Restarting The User Break Controller

    20.6.3 Examples of Stopping and Restarting the User Break Controller The following are example programs: ; Transition to user break controller stopped state ; (1) Initialize BBRA and BBRB to 0. #0, R0 mov.l #BBRA, R1 mov.w R0, @R1 mov.l #BBRB, R1 mov.w R0, @R1...
  • Page 816: Section 21 Hitachi User Debug Interface (H-Udi)

    21.1.1 Features The Hitachi user debug interface (H-UDI) is a serial input/output interface conforming to JTAG, IEEE 1149.1, and IEEE Standard Test Access Port and Boundary-Scan Architecture. The SH7751 Series H-UDI support boundary-scan, and is used for emulator connection. The functions of this interface should not be used when using an emulator.
  • Page 817: Figure 21.1 Block Diagram Of H-Udi Circuit

    Interrupt/reset Break etc. /BRKACK control Decoder controller SDIR SDINT SDBPR SDDRH SDDRL AUDSYNC AUDCK Trace control AUDATA3–0 Figure 21.1 Block Diagram of H-UDI Circuit Rev. 3.0, 04/02, page 778 of 1064...
  • Page 818: Pin Configuration

    21.1.3 Pin Configuration Table 21.1 shows the H-UDI pin configuration. Table 21.1 H-UDI Pins Pin Name Abbreviation Function When Not Used Clock pin Input Same as the JTAG serial clock input Open* pin. Data is transferred from data input pin TDI to the H-UDI circuit, and data is read from data output pin TDO, in synchronization with this signal.
  • Page 819: Register Configuration

    This current does not affect the operation of the chip; however, it consumes unnecessary power. The maximum frequency of TCK (TMS, TDI, TDO) is 20 MHz. Make the TCK or SH7751 Series CPG setting so that the TCK frequency is lower than that of the SH7751 Series peripheral module clock.
  • Page 820: Register Descriptions

    21.2 Register Descriptions 21.2.1 Instruction Register (SDIR) The instruction register (SDIR) is a 16-bit register that can only be read by the CPU. In the initial state, bypass mode is set. The value (command) is set from the serial input pin (TDI). SDIR is initialized by the pin or in the TAP Test-Logic-Reset state.
  • Page 821: Data Register (Sddr)

    21.2.2 Data Register (SDDR) The data register (SDDR) is a 32-bit register, comprising the two 16-bit registers SDDRH and SDDRL, that can be read and written to by the CPU. The value in this register is initialized by , but not by a CPU reset. Bit: Initial value: R/W:...
  • Page 822: Interrupt Factor Register (Sdint)

    The boundary scan register (SDBSR) is a shift register on the PAD for controlling the chip’s I/O pins. Using the EXTEST and SAMPLE/PRELOAD commands, it can perform a JTAG (IEEE Std 1149.1)-compatible boundary scan test. Table 21.3 shows the relationship between SH7751 Series pins and the boundary scan register.
  • Page 823: Table 21.3 Structure Of Boundary Scan Register

    Table 21.3 Structure of Boundary Scan Register Pin name Type from TDI STATUS1 STATUS1 STATUS0 STATUS0 DRAK1 DRAK1 DRAK0 DRAK0 DACK1 DACK1 DACK0 DACK0 MD4/ MD4/ MD4/ MD3/ MD3/ MD3/ AUDATA3 AUDATA3 AUDATA2 AUDATA2 AUDATA1...
  • Page 824 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type AUDATA0 AUDATA0 AUDCK AUDCK AUDSYNC AUDSYNC MD7/ MD7/ MD7/ MD0/SCK2 MD0/SCK2 MD0/SCK2 MD1/TXD2 MD1/TXD2 MD1/TXD2 /MD8 /MD8 /MD8 TCLK TCLK TCLK MD2/RXD2 Note: CTL is a low-active signal. The relevant pin is driven to the OUT state when CTL is set LOW.
  • Page 825 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type MD6/ Note: CTL is a low-active signal. The relevant pin is driven to the OUT state when CTL is set LOW.
  • Page 826 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type AD10 AD10 AD10 AD11 AD11 AD11 AD12 AD12 AD12 AD13 AD13 AD13 AD14 AD14 AD14 AD15 AD15 AD15 Note: CTL is a low-active signal. The relevant pin is driven to the OUT state when CTL is set LOW.
  • Page 827 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type Note: CTL is a low-active signal. The relevant pin is driven to the OUT state when CTL is set LOW.
  • Page 828 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type AD16 AD16 AD16 AD17 AD17 AD17 AD18 AD18 AD18 AD19 AD19 AD19 AD20 AD20 AD20 AD21 AD21 AD21 AD22 AD22 AD22 AD23 AD23 AD23 AD24 AD24 AD24 Note: CTL is a low-active signal. The relevant pin is driven to the OUT state when CTL is set LOW.
  • Page 829 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type AD25 AD25 AD25 AD26 AD26 AD26 AD27 AD27 AD27 AD28 AD28 AD28 AD29 AD29 AD29 AD30 AD30 AD30 AD31 AD31 AD31 ...
  • Page 830 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type IDSEL /MD9 /MD9 /MD9 /MD10 /MD10 /MD10 Note: CTL is a low-active signal.
  • Page 831 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type Note: CTL is a low-active signal. The relevant pin is driven to the OUT state when CTL is set LOW. Rev. 3.0, 04/02, page 792 of 1064...
  • Page 832 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type /DQM3 Note: CTL is a low-active signal. The relevant pin is driven to the OUT state when CTL is set LOW. Rev. 3.0, 04/02, page 793 of 1064...
  • Page 833 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type /DQM3 /DQM2 /DQM2 Note: CTL is a low-active signal. The relevant pin is driven to the OUT state when CTL is set LOW. Rev. 3.0, 04/02, page 794 of 1064...
  • Page 834 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type /DQM1 /DQM1 /DQM0 /DQM0 Note: CTL is a low-active signal. The relevant pin is driven to the OUT state when CTL is set LOW.
  • Page 835 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type Note: CTL is a low-active signal. The relevant pin is driven to the OUT state when CTL is set LOW. Rev. 3.0, 04/02, page 796 of 1064...
  • Page 836 Table 21.3 Structure of Boundary Scan Register (cont) Pin name Type to TDO Note: CTL is a low-active signal. The relevant pin is driven to the OUT state when CTL is set LOW. Rev. 3.0, 04/02, page 797 of 1064...
  • Page 837: Operation

    21.3 Operation 21.3.1 TAP Control Figure 21.2 shows the internal states of the TAP control circuit. These conform to the state transitions specified by JTAG. The transition condition is the TMS value at the rising edge of TCK. The TDI value is sampled at the rising edge of TCK, and shifted at the falling edge. The TDO value changes at the falling edge of TCK.
  • Page 838: H-Udi Reset

    21.3.2 H-UDI Reset A power-on reset is effected by an SDIR command. A reset is effected by sending a H-UDI reset assert command, and then sending a H-UDI reset negate command, from the H-UDI pin (see figure 21.3). The interval required between the H-UDI reset assert command and the H-UDI reset negate command is the same as the length of time the reset pin is held low in order to effect a power-on reset.
  • Page 839: Boundary Scan (Extest, Sample/Preload, Bypass)

    (the power-on oscillation-stabilization time), see section 23, Electrical OSC1 Characteristics. 6. When the SH7751 is in bypass mode, the bypass register (SDBPR) is not fixed in the Capture- DR state. (It is cleared to 0 in the SH7751R.) 21.4 Usage Notes 1.
  • Page 840: Section 22 Pci Controller (Pcic)

    Support for big endian and little endian local bus (PCI bus operates with little endian, while internal bus for peripheral modules operates with big endian). Notes: *1 The PCIC of the SH7751 series does not completely conform to version 2.1 of the PCI specifications. When configuring a PCI system in which an SH7751-series device is used, take the necessary steps and confirm the system’s operation before using it.
  • Page 841 [3:0] as being ignored on the acceptance of a configuration access and that access is in longword (DWORD) units only. *2 MPX is only supported by the SH7751R and is not supported by the SH7751. Rev. 3.0, 04/02, page 802 of 1064...
  • Page 842: Block Diagram

    22.1.2 Block Diagram Figure 22.1 is a block diagram of the PCIC. PCI bus PCIC module Interrupt PCI bus interface Interrupts control Local configuration register register Internal peripheral Data transfer FIFO module bus control × × 2 sides interface Internal peripheral Local module bus register...
  • Page 843: Pin Configuration

    22.1.3 Pin Configuration Table 22.1 shows the configuration of I/O pins of the PCIC. Table 22.1 Pin Configuration I/O Status in Operating Modes Standard Pull-up No. Pin Name Function Remarks Signal Type Resistor* Host Non-host Name Master Target Master Target PCICLK PCI input clock (33 MHz/66 MHz)
  • Page 844: Register Configuration

    Table 22.1 Pin Configuration (cont) I/O Status in Operating Modes Standard Pull-up No. Pin Name Function Remarks Signal Type Resistor* Host Non-host Name Master Target Master Target Bus request (host — — MD10 function) Host bridge function ON/OFF Bus request —...
  • Page 845: Table 22.2 List Of Pci Configuration Registers

    R (other) Reserved — H'00000000 H'48 H'FE200048 H'1E200048 H'FC H'FE2000FC H'1E2000FC Notes: x: Undefined value *1 Varies with the logic versions of the chip. *2 H'35051054 for the SH7751; H'350E1054 for the SH7751R. Rev. 3.0, 04/02, page 806 of 1064...
  • Page 846: Table 22.3 Pci Configuration Register Configuration

    Table 22.3 PCI Configuration Register Configuration PCI Configuration Register Configu- ration Area 7 PP-Bus Address Address Address 31 to 24 23 to 16 15 to 8 7 to 0 H'00 H'FE200000 H'1E200000 Device ID Device ID Vendor ID Vendor ID H'04 H'FE200004 H'1E200004 Status...
  • Page 847: Table 22.4 List Of Pcic Local Registers

    Table 22.4 List of PCIC Local Registers PCI I/O Address Abbre- PP-Bus (SH7751/ Area 7 Access Name viation Initial Value SH7751R) Address Address Size PCI control register PCICR H'000000*0 H'100/ H'FE200100 H'1E200100 H'00 Local space register 0 PCILSRO H'00000000 H'104/...
  • Page 848 Table 22.4 List of PCIC Local Registers (cont) PCI I/O Address Abbre- PP-Bus (SH7751/ Area 7 Access Name viation Initial Value SH7751R) Address Address Size DMA control register 0 PCIDCR0 H'00000000 H'18C/ H'FE20018C H'1E20018C for PCI H'8C DMAPCI address PCIDPA1...
  • Page 849 Notes: * The values of some external pins are sampled in a power-on reset by means of the pin. x indicates “undefined.” *1: PCIC bus control register 3 is provided only in the SH7751R. The relevant areas of the SH7751 are reserved areas. Rev. 3.0, 04/02, page 810 of 1064...
  • Page 850: Pcic Register Descriptions

    ID PCI configuration registers stipulated in the PCI local bus specifications. The SH7751 ID (H'3505) or the SH7751R ID (H'350E) is read from bits 31 to 16; the Hitachi ID (H'1054) is read from bits 15 to 0.
  • Page 851: Pci Configuration Register 1 (Pciconf1)

    Bits 31 to 16—DEVID15 to 0: These bits specify the device ID of the SH7751 or SH7751R allocated by the PCI device vendor. H'3505 (fixed in hardware) for the SH7751, and H'350E (fixed in hardware) for the SH7751R. Bits 15 to 0—DNVID15 to 0: These bits specify Hitachi as the PCI device maker (vendor ID).
  • Page 852 Bits 31 to 27, 24, 8 to 6, and 2 to 0 can be written to from both the PP and PCI buses. However, bits 31 to 27 and 24 are write-clear bits that are cleared when 1 is written to them. Bits 22 and 21 can be written to from the PP bus.
  • Page 853 Bit 27: STA Description No transaction termination using target abort by target device (Initial value) Transaction termination by target abort by target device. Notification by target device Bits 26 and 25— Timing Status (DEV1 and 0): These bits indicate the response timing when the PCIC is operating as a target.
  • Page 854 Bit 21: 66M Description This device supports 33 MHz operation (Initial value) This device supports 66 MHz operation Bit 20—PCI Power Management (PM): Shows whether the PCI power management is supported. Bit 20: PM Description Power management not supported Power management supported (Initial value) Bits 19 to 10—Reserved: These bits always return 0 when read.
  • Page 855 Bit 6: PER Description Ignore detected parity errors (Initial value) Respond to detected parity error Bit 5—VGA Pallet Snoop Control (VPS) Bit 5: VPS Description VGA-compatible device (Initial value) The device does not respond to pallet register writes (not supported) Bit 4—Memory Write and Invalidate Control (MWIE): Controls the issuance of memory and invalidate command when the PCIC is operating as the master.
  • Page 856: Pci Configuration Register 2 (Pciconf2)

    Bit 0—I/O Space Control (IOS): Controls the access to the I/O space when the PCIC is operating as a target. When this bit is 0, all I/O transfers to the PCIC are terminated by master abort. Bit 0: IOS Description Disable access to I/O space (Initial value) Enable access to I/O space...
  • Page 857: Table 22.5 List Of Class23 To 16 Base Class Codes (Class23 To 16)

    specifications. Bits 31 to 8 (class code) set the device functions. The chip logic version can be read from bits 7 to 0 (revision ID). Bits 31 to 8 can be written to from the PP bus. Bits 7 to 0 are fixed in hardware. The PCICONF2 register class codes are not initialized at a reset.
  • Page 858: Pci Configuration Register 3 (Pciconf3)

    22.2.4 PCI Configuration Register 3 (PCICONF3) Bit: BIST7 BIST6 BIST5 BIST4 BIST3 BIST2 BIST1 BIST0 Initial value: PCI-R/W: PP Bus-R/W: Bit: HEAD7 HEAD6 HEAD5 HEAD4 HEAD3 HEAD2 HEAD1 HEAD0 Initial value: PCI-R/W: PP Bus-R/W: Bit: LAT7 LAT6 LAT5 LAT4 LAT3 LAT2 LAT1 LAT0...
  • Page 859 Bit 31—BIST7: BIST function support Bit 31: BIST7 Description Function not supported (Initial value) Function supported (not supported) Bit 30—BIST6: Used to control the BIST starting. Bit 30: BIST6 Description Execution completed (Initial value) Executing (not supported) Bits 29 and 28—BIST5 and 4: These bits always return 0 when read. Bits 27 to 24—BIST3 to 0: BIST status on completion of operation.
  • Page 860: Pci Configuration Register 4 (Pciconf4)

    Initial value: PCI-R/W: PP Bus-R/W: Note: * These bits are read-only in the SH7751 and can be read from and written to in the SH7751R. PCI configuration register 4 (PCICONF4) is a 32-bit read/partial-write register that accommodates the I/O-space base address register, which is one of the PCI configuration registers that are stipulated in the PCI’s local-bus specifications.
  • Page 861 In the SH7751, the 12 higher-order bits (bits 31 to 8) are set; in the SH7751R, the 24 higher-order bits are set. As the I/O space for the PCI bus, allocate 1 Mbyte of space for the SH7751 and 256 bytes of space for the SH7751R.
  • Page 862: Pci Configuration Register 5 (Pciconf5)

    22.2.6 PCI Configuration Register 5 (PCICONF5) Bit: BASE031 BASE030 BASE029 BASE028 BASE027 BASE026 BASE025 BASE024 Initial value: PCI-R/W: PP Bus-R/W: Bit: BASE023 BASE022 BASE021 BASE020 BASE019 BASE018 BASE017 BASE016 Initial value: PCI-R/W: PP Bus-R/W: Bit: BASE015 BASE014 BASE013 BASE012 BASE011 BASE010 BASE09 BASE08 Initial value: PCI-R/W: PP Bus-R/W:...
  • Page 863: Table 22.6 Memory Space Base Address Register (Base0)

    Bits 31 to 20—Base Address of the Memory Space 0 (BASE0 31 to 20): These bits specify the base address of the local address space 0 (SH7751 Series external bus space). Bits 19 to 4—Base Address of the Memory Space 0 (BASE0 19 to 4): Fixed at H'0000 in hardware.
  • Page 864: Pci Configuration Register 6 (Pciconf6)

    Bit 0—LA0ASI: Shows whether the base address specified by this register is an I/O space or memory space. Bit 0: LA0ASI Description Memory space (Initial value) I/O space 22.2.7 PCI Configuration Register 6 (PCICONF6) Bit: BASE131 BASE130 BASE129 BASE128 BASE127 BASE126 BASE125 BASE124 Initial value: PCI-R/W: PP Bus-R/W:...
  • Page 865: Table 22.7 Memory Space Base Address Register (Base1)

    Bits 31 to 20—Base Address of the Memory Space 1 (BASE1 31 to 20): Specifies the base address of the local address space 1 (SH7751 Series external bus space). Bits 19 to 4—Base Address of the Memory Space 1 (BASE1 19 to 4): Fixed at H'0000 in hardware.
  • Page 866: Pci Configuration Register 7 (Pciconf7) To Pci Configuration Register 10

    Bits 2 and 1—Memory Type (LA1TYPE1 to 0): These bits indicate the memory type of the local address space 1. Bit 2: LA1TYPE1 Bit 1: LA1TYPE0 Description The base address can be set to 32-bit width, 32-bit space (Initial value) The base address can be set to 32-bit width, but less than 1MB (not supported) The base address has 64-bit width (not supported)
  • Page 867: Pci Configuration Register 11 (Pciconf11)

    ID and subsystem vendor ID PCI configuration registers stipulated in the PCI local bus specifications. The register contains the ID of the add-in board that SH7751 Series is installed on its subsystem (bits 31 to 16) as well as the subsystem vendor ID (bits 15 to 0).
  • Page 868: Pci Configuration Register 12 (Pciconf12)

    22.2.10 PCI Configuration Register 12 (PCICONF12) Bit: . . . — — — . . . — — — — Initial value: . . . PCI-R/W: . . . PP Bus-R/W: . . . Bit: — — — — — —...
  • Page 869: Pci Configuration Register 13 (Pciconf13)

    22.2.11 PCI Configuration Register 13 (PCICONF13) Bit: . . . — — — . . . — — — — Initial value: . . . PCI-R/W: . . . PP Bus-R/W: . . . Bit: CAPPTR7 CAPPTR6 CAPPTR5 CAPPTR4 CAPPTR3 CAPPTR2 CAPPTR1 CAPPTR0 Initial value: PCI-R/W: PP Bus-R/W:...
  • Page 870: Pci Configuration Register 14 (Pciconf14)

    22.2.12 PCI Configuration Register 14 (PCICONF14) Bit: . . . — — — . . . — — — — Initial value: . . . PCI-R/W: . . . PP Bus-R/W: . . . Bit: — — — — — —...
  • Page 871: Pci Configuration Register 15 (Pciconf15)

    PCI local bus specifications. The interrupt pins used by the SH7751/SH7751R are read from bits 15 to 8. Bits 7 to 0 indicate to which of the interrupt request signal lines of an interrupt controller the interrupt line is connected.
  • Page 872 Bits 23 to 16—Minimum Latency Specification (MGNT 7 to 0): Specify the burst interval required by the PCI device (not supported). Bits 15 to 8—Interrupt Pin Specification (IPIN7 to 0) Bits 15 to 8: IPIN7 to 0 Description H'01 used (Initial value) ...
  • Page 873: Pci Configuration Register 16 (Pciconf16)

    22.2.14 PCI Configuration Register 16 (PCICONF16) Bit: D2SPT D1SPT — PMESPT4 PMESPT3 PMESPT2 PMESPT1 PMESPT0 Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — PMECLK VER2 VER1 VER0 Initial value: PCI-R/W: PP Bus-R/W: Bit: NIP7 NIP6 NIP5 NIP4 NIP3 NIP2 NIP1 NIP0 Initial value:...
  • Page 874 Bits 31 to 27—PME Support (PMESPT4 to 0): Not supported. Defines the function state supporting output. Bit 26—D2 Support (D2SPT): Not supported. Specifies whether D2 state is supported. Bit 25—D1 Support (D1SPT): Not supported. Specifies whether D1 state is supported. Bits 24 to 22—Reserved: These bits always return 0 when read.
  • Page 875: Pci Configuration Register 17 (Pciconf17)

    22.2.15 PCI Configuration Register 17 (PCICONF17) Bit: DATA7 DATA6 DATA5 DATA4 DATA3 DATA2 DATA1 DATA0 Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — — — — — — Initial value: PCI-R/W: PP Bus-R/W: Bit: PMEST DTATSCL1 DTATSCL0 DATASEL3 DATASEL2 DATASEL1 DATASEL0 PMEEN Initial value: PCI-R/W: PP Bus-R/W:...
  • Page 876 When B'11 is written to bits 1 and 0 and a transition is made to power state D3 (power down mode), PCIC operation as a master target is disabled, regardless of the setting of bits 2 to 0 of the PCICONF1 (bus master control, memory and I/O space access control) (these bits are masked).
  • Page 877: 22.2.16 Reserved Area

    22.2.16 Reserved Area Reserved area. Bit: . . . — — — . . . — — — — Initial value: . . . PCI-R/W: . . . PP Bus-R/W: . . . Bit: — — — — — — —...
  • Page 878: Pci Control Register (Pcicr)

    22.2.17 PCI Control Register (PCICR) Bit: — — — — — — — — Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — — — — — — Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — — — — TRDSGL BYTESWAP Initial value:...
  • Page 879 This register can be written to only when bits 31 to 24 are H'A5. Always set bit 0 (CFINIT) to 1 on completion of PCIC register initialization. Bits 31 to 10—Reserved: These bits are always read as 0. When writing, write H'A5 to bits 31 to 24, and 0 to others.
  • Page 880 1 clock. This bit always returns “0” when read. Used when the PCIC is not the host. If used when the PCIC is the host, an assert interrupt is generated for the SH7751 Series. Bit 3: SERR Description ...
  • Page 881: Pci Local Space Register [1:0] (Pcilsr [1:0])

    Bit 0—PCIC Internal Register Initialization Control Bit (CFINIT): After the SH initializes the PCI registers, setting this bit enables access from the PCI bus. During initialization, no bus privileges are granted to other devices on the PCI bus while operating as the host. When operating not as the host, a retry is returned without the access from the PCI bus being accepted.
  • Page 882 memory read/memory write of the PCIC using target transfers. This is a 32-bit register that can be read and written from the PP bus, or read only from the PCI bus. The PCILSR [1:0] register is initialized to H'00000000 at a power-on reset and software reset. Always write to this register before performing target transfers to specify the capacity of the address space being used.
  • Page 883: Pci Local Address Register [1:0] (Pcilar [1:0])

    22.2.19 PCI Local Address Register [1:0] (PCILAR [1:0]) Bit: — — — LAR28 LAR27 LAR26 LAR25 LAR24 Initial value: PCI-R/W: PP Bus-R/W: Bit: LAR23 LAR22 LAR21 LAR20 — — — — Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — —...
  • Page 884 Always write to this register prior to target transfers. Specify the starting address (physical address) of the memory installed on the local bus according to the address space being used. Bits 28 to 26 of the PCI local address register 0 select the local address area. Bits 25 to 20 show the address within that area.
  • Page 885: Pci Interrupt Register (Pciint)

    22.2.20 PCI Interrupt Register (PCIINT) Bit: — — — — — — — — Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — — — — — — Initial value: PCI-R/W: PP Bus-R/W: Bit: M_LOCK T_TGT_A — — — — TGT_RET MST_DIS BORT...
  • Page 886 Note that the error detection bits can be set even when the interrupt is masked. The error source holding circuit can only store one error source. For this reason, any second or subsequent error factors are not stored if errors occur consecutively. Bits 31 to 16—Reserved: These bits always return 0 when read.
  • Page 887: Pci Interrupt Mask Register (Pciintm)

    Bit 1—Master Write Detection Interrupt (M_DPERR_WT): When the PCIC is master. received from the target while writing data to the target. Detects only when bit 6 (PER) of the PCICONF1 is 1. Bit 0—Master Read Data Parity Error Interrupt (M_DPERR_RD): When the PCIC is master, a parity error was detected during a data read from the target.
  • Page 888 from both the PP bus and PCI bus. When set to 0, the respective interrupt is disabled, and enabled when set to 1. The PCIINTM register is initialized to H'00000000 at a power-on reset and software reset. Bits 31 to 16—Reserved: These bits always return 0 when read. Always write 0 to these bits. Bit 15—Unlocked Transfer Detection Interrupt Mask (M_LOCKON) Bit 14—Target Target Abort Interrupt Mask (T_TGT_ABORT) Bits 13 to 10—Reserved: These bits always return 0 when read.
  • Page 889: Pci Address Data Register At Error (Pcialr)

    22.2.22 PCI Address Data Register at Error (PCIALR) Bit: ALOG31 ALOG30 ALOG29 ALOG28 ALOG27 ALOG26 ALOG25 ALOG24 Initial value: — — — — — — — — PCI-R/W: PP Bus-R/W: Bit: ALOG23 ALOG22 ALOG21 ALOG20 ALOG19 ALOG18 ALOG17 ALOG16 Initial value: —...
  • Page 890: Pci Command Data Register At Error (Pciclr)

    22.2.23 PCI Command Data Register at Error (PCICLR) Bit: — — MSTPIO MSTDMA0 MSTDMA1 MSTDMA2 MSTDMA3 Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — — — — — — Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — — —...
  • Page 891 Bit 31—PIO Error (MSTPIO): Error occurred in PIO transfer. Bit 30—DMA0 Error (MSTDMA0): Error occurred in DMA channel 0 transfer. Bit 29—DMA1 Error (MSTDMA1): Error occurred in DMA channel 1 transfer. Bit 28—DMA2 Error (MSTDMA2): Error occurred in DMA channel 2 transfer. Bit 27—DMA3 Error (MSTDMA3): Error occurred in DMA channel 3 transfer.
  • Page 892: Pci Arbiter Interrupt Register (Pciaint)

    22.2.24 PCI Arbiter Interrupt Register (PCIAINT) Bit: — — — — — — — — Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — — — — — — Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — — — MST_BRKN TGT_BUSTO MST_BUSTO Initial value:...
  • Page 893 Bits 31 to 14—Reserved: These bits always return 0 when read. Always write 0 to these bits when writing. Bit 13—Master Broken Interrupt (MST_BRKN): Detects when the master granted with bus privileges does not start a transaction ( not asserted) within 16 clocks. Bit 12—Target Bus Timeout Interrupt (TGT_BUSTO): Neither...
  • Page 894: Pci Arbiter Interrupt Mask Register (Pciaintm)

    22.2.25 PCI Arbiter Interrupt Mask Register (PCIAINTM) Bit: — — — — — — — — Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — — — — — — Initial value: PCI-R/W: PP Bus-R/W: Bit: — — — — —...
  • Page 895: Pci Error Bus Master Data Register (Pcibmlr)

    Bit 11—Master Bus Timeout Interrupt Mask (MST_BUSTO) Bits 10 to 4—Reserved: These bits always return 0 when read. Always write 0 to these bits when writing. Bit 3—Target Abort Interrupt Mask (TGT_ABORT) Bit 2—Master Abort interrupt Mask (MST_ABORT) Bit 1—Read Data Parity Error Interrupt Mask (DPERR_WT) Bit 0—Write Data Parity Error Interrupt Mask (DPERR_RD) 22.2.26 PCI Error Bus Master Data Register (PCIBMLR) Bit:...
  • Page 896: Pci Dma Transfer Arbitration Register (Pcidmabt)

    Bit 3—REQ3 Error (REQ3ID): Error occurred when device 3 (REQ3) was bus master. Bit 2—REQ2 Error (REQ2ID): Error occurred when device 2 (REQ2) was bus master. Bit 1—REQ1 Error (REQ1ID): Error occurred when device 1 (REQ1) was bus master. Bit 0—REQ0 Error (REQ0ID): Error occurred when device 0 (REQ0) was bus master. 22.2.27 PCI DMA Transfer Arbitration Register (PCIDMABT) Bit: .
  • Page 897: Pci Dma Transfer Pci Address Register [3:0] (Pcidpa [3:0])

    22.2.28 PCI DMA Transfer PCI Address Register [3:0] (PCIDPA [3:0]) Bit: PDPA31 PDPA30 PDPA29 PDPA28 PDPA27 PDPA26 PDPA25 PDPA24 Initial value: PCI-R/W: PP Bus-R/W: Bit: PDPA23 PDPA22 PDPA21 PDPA20 PDPA19 PDPA18 PDPA17 PDPA16 Initial value: PCI-R/W: PP Bus-R/W: Bit: PDPA15 PDPA14 PDPA13 PDPA12 PDPA11 PDPA10 PDPA9 PDPA8 Initial value:...
  • Page 898: Pci Dma Transfer Local Bus Start Address Register [3:0] (Pcidla [3:0])

    Bits 31 to 0—DMA Transfer PCI Starting Address (PDPA31 to 0): Set the PCI starting address for DMA transfer. 22.2.29 PCI DMA Transfer Local Bus Start Address Register [3:0] (PCIDLA [3:0]) Bit: — — — PDLA28 PDLA27 PDLA26 PDLA25 PDLA24 Initial value: PCI-R/W: PP Bus-R/W:...
  • Page 899: Pci Dma Transfer Counter Register [3:0] (Pcidtc [3:0])

    The transfer address of a byte boundary or character boundary can be set, but the 2 least significant bits of the register are ignored, and the data of the longword boundary is transferred. Note that the local bus starting address set in this register is the external address of the SH. Always write to this register prior to starting DMA transfers.
  • Page 900 The DMA transfer counter register [3:0] (PCIDTC [3:0]) specifies the number of bytes for DMA transfers. This 32-bit read/write register can be accessed from both the PP bus and PCI bus. When read during a DMA transfer, it returns the remaining number of bytes in the DMA transfer. The PCIDTC register is initialized to H'00000000 at a power-on reset and a software reset.
  • Page 901: Pci Dma Control Register [3:0] (Pcidcr [3:0])

    22.2.31 PCI DMA Control Register [3:0] (PCIDCR [3:0]) Bit: . . . — — — . . . — — — — Initial value: . . . PCI-R/W: . . . PP Bus-R/W: . . . Bit: — — — —...
  • Page 902 Bits 10 and 9—Alignment Mode (ALNMD): Sets data alignment when local bus is big endian Bit 10: ALNMD10 Bit 9: ALNMD9 Description Byte boundary mode (Initial value) W/LW boundary mode 1 (LW data is sent as byte W/LW boundary mode 2 (LW data is sent as word W/LW boundary mode 3 (LW data is sent as longword) Notes: W: Word LW: Longword...
  • Page 903 Bit 4—Reserved: This bit always returns 0 when read. Always write 0 to this bit. Bit 3—PCI Address Space Type (IOSEL): Type of PCI address space during transfer Bit 3: IOSEL Description Memory space (Initial value) I/O space Bit 2—Transfer Direction (DIR): Transfer direction during DMA transfer Bit 2: DIR Description Transfer from PCI bus to local bus (SH bus)
  • Page 904: Pio Address Register (Pcipar)

    22.2.32 PIO Address Register (PCIPAR) Bit: — — — — — — — CFGEN Initial value: PCI-R/W: — — — — — — — — PP Bus-R/W: Bit: BUSNO23 BUSNO22 BUSNO21 BUSNO20 BUSNO19 BUSNO18 BUSNO17 BUSNO16 Initial value: — — —...
  • Page 905 Always write to this register prior to accessing the PCI configuration space. After setting a value in this register, generate the configuration cycle by reading or writing to the PIO data register (PCIPDR). Also, a special cycle is issued by setting H'8000FF00 in this register and writing to the PCIPDR. Bit 31—Configuration Cycle Generate Enable (CFGEN): Indicates the configuration cycle generation enable.
  • Page 906: Memory Space Base Register (Pcimbr)

    22.2.33 Memory Space Base Register (PCIMBR) Bit: MBR31 MBR30 MBR29 MBR28 MBR27 MBR26 MBR25 MBR24 Initial value: PCI-R/W: — — — — — — — — PP Bus-R/W: Bit: — — — — — — — — Initial value: PCI-R/W: —...
  • Page 907: I/O Space Base Register (Pciiobr)

    Bits 31 to 24—Memory Space Base Address (MBR31 to 24): Sets the base address for the PCI memory space in PIO transfers. (Initial value is undefined.) Bits 23 to 1—Reserved: These bits always return 0 when read. Always write 0 to these bits when writing.
  • Page 908 The I/O space base register (PCIIOBR) species the most significant 14 bits of the address of the PCI I/O space when performing I/O read and I/O write operations by PIO transfer. It also specifies locked transfers. This 32-bit read/write register can be accessed from the PP bus. All bits of the PCII0BR register are initialized to 0 at a power-on reset.
  • Page 909: Pci Power Management Interrupt Register (Pcipint)

    Bit 1—Power state D3 (PWRST_D3): Transition request to power-down mode interrupt for SH7751 and SH7751R. Bit 0—Power state D0 (PWRST_D0): Restore from power-down mode interrupt for SH7751 and SH7751R. Note: The power states D3, D0 are not masked even when the interrupt mask bit is set ON.
  • Page 910: Pci Power Management Interrupt Mask Register (Pcipintm)

    Bits 31 to 2—Reserved: These bits always return 0 when read. Always write 0 to these bits when writing. Bit 1—Power State D3 (PWRST_D3): Transition request to power-down mode interrupt mask for SH7751 and SH7751R. Bit 0—Power State D0 (PWRST_D0): Restore from power-down mode interrupt mask for SH7751 and SH7751R.
  • Page 911: Pci Clock Control Register (Pciclkr)

    22.2.37 PCI Clock Control Register (PCICLKR) Bit: . . . — — — . . . — — — — Initial value: . . . PCI-R/W: — — — . . . — — — — PP Bus-R/W: . . . Bit: —...
  • Page 912: 22.2.38 Pcic-Bsc Registers

    Bit 0—BCLK Stop Control (BCLKSTOP): Controls the stopping of the B input clock and CKIO input clock in the PCIC. Bit 0: BCLKSTOP Description B input enabled (Initial value) Stop B input 22.2.38 PCIC-BSC Registers PCIC Bus Control Register 1 (PCIBCR1) PCIC Bus Control Register 2 (PCIBCR2) PCIC Bus Control Register 3 (PCIBCR3)* PCIC Wait Control Register 1 (PCIWCR1)
  • Page 913: Port Control Register (Pcipctr)

    These registers are initialized at a power-on reset, but not by a software reset. Notes: *1 This register is provided only in the SH7751R, not provided in the SH7751. *2 MPX is supported only in the SH7751R, not supported in the SH7751.
  • Page 914 The port control register (PCIPCTR) selects whether to enable or disable port function allocation for pins for unwanted PCI bus arbitration when the PCIC is used in non-host mode. It also specifies the swithing ON/OFF of pin pull-up resistances and between input and output. This 32- bit read/write register can be accessed from the PP bus.
  • Page 915 Bit 4—Port 2 Input/Output Control (PB2IO): Controls input or output when is used as a port. Bit 4: PB2IO Description pin for input (Initial value) pin for output Bit 3—Port 1 Pull-up Resistance Control (PB1PUP): Controls pull-up resistance when pin is used as port.
  • Page 916: Port Data Register (Pcipdtr)

    22.2.40 Port Data Register (PCIPDTR) Bit: . . . — — — . . . — — — — Initial value: . . . PCI-R/W: — — — . . . — — — — PP Bus-R/W: . . . Bit: —...
  • Page 917: Pio Data Register (Pcipdr)

    Bit 0—Port 0 Input/Output Data (PB0DT): Receives input data and sets output data when the pin is used as a port. 22.2.41 PIO Data Register (PCIPDR) Bit: PPDA31 PPDA30 PPDA29 PPDA28 PPDA27 PPDA26 PPDA25 PPDA24 Initial value: — — —...
  • Page 918: Description Of Operation

    The PCIC host functions are enabled and the external input via the PCICLK pin is the operating clock for the PCI bus The PCIC host functions are enabled and the SH7751 Series bus clock (feedback input clock from CKIO pin) is the operating clock for the PCI bus...
  • Page 919: Pci Commands

    22.3.2 PCI Commands Table 22.9 lists the PCI commands and shows the PCIC support. Table 22.9 PCI Command Support Non-Host Host Operation Operation Command Master Target Master Target Remarks Memory read Memory read line When the target, operates as memory read Memory read multiple When the target, operates as memory read...
  • Page 920: Pcic Initialization

    22.3.3 PCIC Initialization After a power-on reset, the configuration 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, the bus privileges are permanently granted to the PCIC, and no device arbitration is performed on the PCI bus.
  • Page 921: Local Register Access

    22.3.4 Local Register Access Only longword (32-bit) access of the PCIC's internal local registers and configuration registers from the CPU is supported. (It is possible to use PIO transfers to perform byte, word, and longword access of the memory space and I/O space on the PCI bus.) If an attempt is made to access these registers using other than the prescribed access size, zero is returned when reading and writing is ignored.
  • Page 922 If multiple bus privilege requests are made simultaneously by the PCI devices, the bus privilege is grated in the predetermined order of priority. There are two orders of priority: fixed, and pseudo round robin. The mode is selected by setting the bus master arbitration mode control bit (BMABT) of the PCI control register (PCICR).
  • Page 923 Initial order of priority PCIC > device 1 > device 2 > device 3 > device 4 (transfer by device 1) Order of priority after transfer PCIC > device 2 > device 3 > device 4 > device 1 (transfer by PCIC) Order of priority after transfer device 2 >...
  • Page 924: Pci Bus Arbitration In Non-Host Mode

    electrical characteristics in section 10, Clock Oscillation Circuits, and section 23, Electrical Characteristics. 22.3.6 PCI Bus Arbitration in Non-host Mode When operating in non-host mode, the PCI bus arbitration function in the PCIC is disabled and PCI bus arbitration is performed according to the specifications of the externally connected PCI bus arbiter.
  • Page 925 Memory Transfers: This section describes how PIO transfers are used to access memory space. 16MB between H'FD000000 and H'FDFFFFFF of area P4 (H'1D000000 to H'1DFFFFFF in area 7) is allocated as PCI memory address space. This space is used as the least significant 24 bits of the PCI address.
  • Page 926: Figure 22.2 Pio Memory Space Access

    H'FD000000 PCI memory 16 Mbytes space H'FDFFFFFF 24 23 PCI memory H'FD space address 24 23 PCI address 24 23 PIOMBR LOCK identifier Figure 22.2 PIO Memory Space Access I/O Transfers: This section describes how to access I/O space using PIO transfers. The 256kB from H'FE240000 to H'FE27FFFF of area P4 (H'1E240000 to H'1E27FFFF in area 7) is allocated as PCI I/O address space.
  • Page 927: Target Transfers

    H'FE200000 PCI register space 256 kbytes H'FE23FFFF H'FE240000 PIC I/O space 256 kbytes H'FE27FFFF 18 17 PCI I/O space H'FE24–H'FE27 address 18 17 PCI address 18 17 PIOIOBR LOCK identifier Figure 22.3 PIO I/O Space Access PIO Transfer Error: An error on the PCI bus that occurs in a transfer during a PIO write operation is not detected.
  • Page 928: Figure 22.4 Local Address Space Accessing Method

    local bus. Only the linear mode is supported for addressing for burst transfers, and the 2 least significant bits of the PCI address are regarded as B'00. If a memory read line command or memory read multiple command is received, they operate as memory reads.
  • Page 929 I/O-Read and I/O-Write Commands: The local registers of the PCIC are accessed by means of a target transfer triggered by an I/O-read or I/O-write command. In the SH7751, accessing the local registers by means of I/O transfer is made possible by setting a base address that specifies 1 Mbyte of I/O space* in PCI configuration register 4 (PCICONF4).
  • Page 930: Dma Transfers

    I/O space for PCI devices is defined as being no more than 256 bytes. When the SH7751 is used in a PCI non-host device, such as on a PCI card, it may be recognized as a device that cannot be used during device configuration, because it requires an I/O space that is larger than 256 bytes.
  • Page 931 Starting DMA Transfer: The following registers exist to control DMA transfers: DMA transfer arbitration register (PCIDMABT) and, for four channels, the DMA transfer PCI address register [3:0] (PCIDPA [3:0]), DMA transfer local bus starting address register [3:0] (PCIDLA [3:0]), DMA transfer count register [3:0] (PCIDTC [3:0]), and DMA control register [3:0] (PCIDCR [3:0]).
  • Page 932: Figure 22.5 Example Of Dma Transfer Control Register Settings

    0: Fixed priority PCIDMABT Arbitration mode 1: Pseudo round-robin External memory space H'0000 0000 Area 0: H'00000000 to H'0000 0004 H'03FFFFFF Area 1: H'04000000 to 31 28 H'07FFFFFF Local address PCIDLA Area 2: H'0800 0000 to H'0BFFFFFF Area 3: H'0C000000 to H'0FFFFFFF Area 4: H'10000000 to H'13FFFFFF...
  • Page 933 DMA Transfer End: The following describes the status on termination of a DMA transfer. Normal termination DMA transfer ends after the set number of bytes has been transferred. In the case of normal termination, the DMA end status bit (DMAST) of the PCIDCR and the DMA transfer start control bit (DMASTART) are cleared, and the DMA transfer termination interrupt status bit (DMAIS) is set.
  • Page 934: Figure 22.6 Example Of Dma Transfer Flowchart

    DMA transfer starts when 1 is set in the DMASTRT DMA transfer start bit of the PCIDCR register. DMA transfer (⇔ FIFO) The PCIDPA and PCIDLA registers are updated Transfer address update (increment/fixed) by the LAHOLD bit of the PCIDCR register. The PCIDTC decrements at a rate equaling the Transfer count decrement number of transfer bytes (4 bytes).
  • Page 935 DMA Arbitration: If transfer requests are made simultaneously on multiple DMA channels in the PCI, transfer arbitration is required. There are two modes that can be selected to determine order of priority of the DMA transfers on the four channels: fixed order of priority and pseudo round- robin.
  • Page 936: 22.3.10 Transfer Contention Within Pcic

    If data has been written to both buffers of the channel 1 FIFO, the channel 1 FIFO is busy while data is output from one of those buffers to the PCI bus. While it is busy, data is written from the local bus to the channel 2 FIFO, which has the next highest order of priority.
  • Page 937: 22.3.11 Pci Bus Basic Interface

    22.3.11 PCI Bus Basic Interface The PCI interface of this LSI conforms to the PCI version 2.1 stipulations and can be connected to a device with a PCI bus interface. While the PCIC is set in host mode, or while set in non-host 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.
  • Page 938: Figure 22.7 Master Write Cycle In Host Mode (Single)

    PCICLK Addr AD31–AD0 –C/ LOCKed IDSEL – – Addr: PCI space address nth data Address parity DPn: nth data parity Com: Command BEn: nth data byte enable Figure 22.7 Master Write Cycle in Host Mode (Single) Rev. 3.0, 04/02, page 899 of 1064...
  • Page 939: Figure 22.8 Master Read Cycle In Host Mode (Single)

    PCICLK Addr AD31–AD0 –C/ LOCKed IDSEL – – Addr: PCI space address nth data Address parity DPn: nth data parity Com: Command BEn: nth data byte enable Figure 22.8 Master Read Cycle in Host Mode (Single) Rev. 3.0, 04/02, page 900 of 1064...
  • Page 940: Figure 22.9 Master Memory Write Cycle In Non-Host Mode (Burst)

    PCICLK Addr AD31–AD0 –C/ IDSEL Addr: PCI space address nth data Address parity DPn: nth data parity Com: Command BEn: nth data byte enable Figure 22.9 Master Memory Write Cycle in Non-Host Mode (Burst) Rev. 3.0, 04/02, page 901 of 1064...
  • Page 941: Figure 22.10 Master Memory Read Cycle In Non-Host Mode (Burst)

    PCICLK Addr AD31–AD0 –C/ IDSEL Addr: PCI space address nth data Address parity DPn: nth data parity Com: Command BEn: nth data byte enable Figure 22.10 Master Memory Read Cycle in Non-Host Mode (Burst) Rev. 3.0, 04/02, page 902 of 1064...
  • Page 942 The following restrictions apply to the SH7751. In a system in which access is made to the same address in local memory by two or more PCI devices, the data cannot be guaranteed when a target read is performed immediately after a target write.
  • Page 943: Figure 22.11 Target Read Cycle In Non-Host Mode (Single)

    PCICLK Addr AD31–AD0 –C/ Disconnect LOCKed IDSEL At Config Access Addr: PCI space address nth data Address parity DPn: nth data parity Com: Command BEn: nth data byte enable Figure 22.11 Target Read Cycle in Non-Host Mode (Single) Rev. 3.0, 04/02, page 904 of 1064...
  • Page 944: Figure 22.12 Target Write Cycle In Non-Host Mode (Single)

    PCICLK Addr AD31–AD0 –C/ Disconnect LOCKed IDSEL At Config Access Addr: PCI space address nth data Address parity DPn: nth data parity Com: Command BEn: nth data byte enable Figure 22.12 Target Write Cycle in Non-Host Mode (Single) Rev. 3.0, 04/02, page 905 of 1064...
  • Page 945: Figure 22.13 Target Memory Read Cycle In Host Mode (Burst)

    PCICLK Addr AD31–AD0 DPn-1 –C/ Disconnect LOCKed IDSEL Addr: PCI space address nth data Address parity DPn: nth data parity Com: Command BEn: nth data byte enable Figure 22.13 Target Memory Read Cycle in Host Mode (Burst) Rev. 3.0, 04/02, page 906 of 1064...
  • Page 946: Figure 22.14 Target Memory Write Cycle In Host Mode (Burst)

    PCICLK Addr AD31–AD0 –C/ Disconnect LOCKed IDSEL Addr: PCI space address nth data Address parity DPn: nth data parity Com: Command BEn: nth data byte enable Figure 22.14 Target Memory Write Cycle in Host Mode (Burst) Rev. 3.0, 04/02, page 907 of 1064...
  • Page 947: Figure 22.15 Master Memory Write Cycle In Host Mode (Burst, With Stepping)

    Address/Data Stepping Timing: By writing 1 to the WCC bit (bit 7 of the PCICONF1), 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.
  • Page 948: Figure 22.16 Target Memory Read Cycle In Host Mode (Burst, With Stepping)

    PCICLK Addr AD31–AD0 DPn-1 –C/ Addr: PCI space address nth data Address parity DPn: nth data parity Com: Command BEn: nth data byte enable Figure 22.16 Target Memory Read Cycle in Host Mode (Burst, With Stepping) Rev. 3.0, 04/02, page 909 of 1064...
  • Page 949: Endians

    22.4 Endians 22.4.1 Internal Bus (Peripheral Bus) Interface for Peripheral Modules The internal bus (peripheral bus) for the peripheral modules that write data from CPU to the PCIC registers operates in big endians. On the other hand, PCI bus operates in little endian. Therefore, big/little endian conversion is required in PIO transfer, as shown in figure 22.17.
  • Page 950: Figure 22.18 Peripheral Bus Pci Bus Data Alignment

    Table 22.10 Access Size Transfer Mode W/LW Boundary Byte Data Access Destination Access Size Mode Boundary Mode PCI external Memory space B, W, LW device I/O space B, W, LW Configuration register PCIC register W/LW boundary mode Notes: B: Byte W: Word LW: Longword Memory/I/O space access (Peripheral bus ↔...
  • Page 951: Endian Control For Local Bus

    22.4.2 Endian Control for Local Bus Big and little endians are supported on the local bus, determined at power-on reset by the external endian specification pin (MD5). Therefore, when transferring data between the local bus and the PCI bus, when the local bus is set for big endian, big/little endian conversion is therefore required. Figure 22.19 shows the block diagram of the local bus endian control.
  • Page 952: Figure 22.20 Data Alignment At Dma Transfer

    Only longword access size is supported in the case of DMA transfers. Figure 22.20 shows the data alignment in the respective boundary modes in DMA transfers. Table 22.11 DMA Transfer Access Size and Endian Conversion Mode Endian Conversion Mode Local Bus Data Transfer Access W/LW Boundary...
  • Page 953: Endian Control In Target Transfers (Memory Read/Memory Write)

    22.4.4 Endian Control in Target Transfers (Memory Read/Memory Write) In target transfers, for memory read and memory write that perform data transfer between the local bus and the PCI bus, big/little endian conversion is required in the same way as for DMA transfers when the local bus is set for big endians.
  • Page 954: Figure 22.21(1) Data Alignment At Target Memory Transfer (Big-Endian Local Bus)

    Target memory read transfers (local bus → PCI bus) when local bus is big endian Size Local bus PCI bus H'0 to H'F B0 B1 B2 B3 B3 B2 B1 B0 Target memory write transfers (local bus ← PCI bus) when local bus is big endian Size Local bus PCI bus...
  • Page 955: Figure 22.21(2) Data Alignment At Target Memory Transfer (Little-Endian Local Bus)

    Target memory read transfers (local bus → PCI bus) when local bus is little endian Size Local bus PCI bus H'0 to H'F B3 B2 B1 B0 B3 B2 B1 B0 Target memory write transfers (local bus ← PCI bus) when local bus is little endian Size Local bus PCI bus...
  • Page 956: Endian Control In Target Transfers (I/O Read/I/O Write)

    The data alignment when accessing the PCIC configuration register using the target configuration read and configuration write commands is shown in figure 22.23. In the SH7751 the access size is fixed at longword. The BE[3:0] value is ignored. In the SH7751R all BE combinations are valid.
  • Page 957: Figure 22.23 Data Alignment At Target Configuration Transfer (Both Big Endian And Little Endian)

    PCI bus) Configuration register PCI bus H’0 to H’F B3 B2 B1 B0 B3 B2 B1 B0 SH7751 target configuration write transfer data alignment (PCI bus configuration register) Configuration register PCI bus H’0 to H’F B3 B2 B1 B0 B3 B2 B1 B0...
  • Page 958: Resetting

    1msec, check the time required for the power-on reset of the SH7751/SH7751R (see section 23, Electrical Characteristics), and design the timing of power-on resets so that it satisfies the conditions of the reset period for both.
  • Page 959: Interrupts

    22.6 Interrupts 22.6.1 Interrupts from PCIC to CPU There are 8 interrupts, as shown in the following, that can be generated by the PCIC for the CPU. The interrupt controller also controls the individual interrupt priority levels and interrupt masks, etc.
  • Page 960: Interrupts From External Pci Devices

    The following are also set in relation to error interrupts: of the PCI configuration register 1 (PCICONF1), the parity error output status (DPE) the system error output status (SSE), the master abort reception status (RMA), the target abort reception status (RTA), the target abort execution status (STA) and the data parity status (DPD).
  • Page 961: Error Detection

    22.7 Error Detection The PCIC can store error information generated on the PCI bus. The address information (ALOG [31:0]) at the time of the error is stored in the PCI error address data register (PCIALR). The PCI error command information register (PCICLR) stores the type of transfer (MSTPIO, MSTDMA0, MSTDMA1, MSTDMA2, MSTDMA3, TGT) at the time of the error, and the PCI command (CMDLOG [3:0]).
  • Page 962: Power Management

    When using this mode, note the CKIO load capacitance and only use it within the prescribed load stated in the manual. Note, too, that the clock frequency of CKIO cannot be guaranteed until the PLL oscillation stabilizes after a power-on reset or the clock frequency is changed. Also, in standby mode, the clock stops.
  • Page 963: Stopping The Clock

    (PCIPINT) and PCI power management interrupt mask register (PCIPINTM). Of the power management interrupts, the power state D3 (PWRS_D3) interrupt detects a transition from the power state D0 to D3, while power state D0 (PWRS_D0) interrupt detects a transition from the power state D3 to D0.
  • Page 964: Table 22.14 Method Of Stopping Clock Per Operating Mode

    Table 22.14 Method of Stopping Clock per Operating Mode PCIC Master Slave SH (Other PCICLK BCLK PCICLK than PCIC) Operation Operation Operation Clock Normal BCLK Normal Normal Normal Normal operating operation/ operation operation operation operation status sleep PCLK Normal Normal Normal Normal operation...
  • Page 965 Table 22.14 Method of Stopping Clock per Operating Mode (cont) PCIC Master Slave SH (Other PCICLK BCLK PCICLK than PCIC) Operation Operation Operation Transition/ Standby Transition Standby Standby PCICLK PCI command Recovery command command stopped from + interrupt SH + standby (PCIC SH) + command...
  • Page 966: Compatibility With Standby And Sleep

    When operating as host device The clock must be stopped only after stopping the operation of external PCI devices connected to the PCI bus. If you stop the clock prior to stopping the external devices, access from those external devices will cause a hang-up. Stop the clock only after checking that there is no problem in respect to the system configuration.
  • Page 967: Version Management

    22.11 Version Management The PCIC version management is written in the revision ID (8 bits) of the PCI configuration register 2 (PCICONF2). Rev. 3.0, 04/02, page 928 of 1064...
  • Page 968: Section 23 Electrical Characteristics

    Section 23 Electrical Characteristics 23.1 Absolute Maximum Ratings Table 23.1 Absolute Maximum Ratings Item Symbol Value Unit I/O, RTC, CPG power supply voltage –0.3 to 4.2 –0.3 to 4.6* DD-RTC DD-CPG Internal power supply voltage –0.3 to 2.5 DD-PLL1/2 –0.3 to 2.1* Input voltage –0.3 to V + 0.3...
  • Page 969: Dc Characteristics

    23.2 DC Characteristics Table 23.2 DC Characteristics (HD6417751RBP240) Ta = –20 to +75 Item Symbol Unit Test Conditions Power supply voltage Normal mode, sleep mode, DD-CPG deep-sleep mode, standby mode DD-RTC Normal mode, sleep mode, DD-PLL1/2 deep-sleep mode, standby mode I = 240 MHz Current Normal...
  • Page 970 Item Symbol Unit Test Conditions Input –0.3 — 0.1 V voltage NMI, BRKACK, , CA PCICLK –0.3 — Other PCI input –0.3 — pins Other input –0.3 — pins Input leak All input |Iin| — —...
  • Page 971: Table 23.3 Dc Characteristics (Hd6417751Rf240)

    Table 23.3 DC Characteristics (HD6417751RF240) Ta = –20 to +75 Item Symbol Unit Test Conditions Power supply voltage Normal mode, sleep mode, DD-CPG deep-sleep mode, standby mode DD-RTC Normal mode, sleep mode, DD-PLL1/2 deep-sleep mode, standby mode I = 240 MHz Current Normal —...
  • Page 972 Item Symbol Unit Test Conditions Input –0.3 — 0.1 V voltage NMI, BRKACK, , CA PCICLK –0.3 — Other PCI input –0.3 — pins Other input –0.3 — pins Input leak All input |Iin| — —...
  • Page 973: Table 23.4 Dc Characteristics (Hd6417751Rbp200)

    Table 23.4 DC Characteristics (HD6417751RBP200) Ta = –20 to +75 Item Symbol Unit Test Conditions Power supply voltage Normal mode, sleep mode, DD-CPG deep-sleep mode, standby mode DD-RTC 1.35 Normal mode, sleep mode, DD-PLL1/2 deep-sleep mode, standby mode I = 200 MHz Current Normal —...
  • Page 974 Item Symbol Unit Test Conditions Input –0.3 — 0.1 V voltage NMI, BRKACK, , CA PCICLK –0.3 — Other PCI input –0.3 — pins Other input –0.3 — pins Input leak All input |Iin| — —...
  • Page 975: Table 23.5 Dc Characteristics (Hd6417751Rf200)

    Table 23.5 DC Characteristics (HD6417751RF200) Ta = –20 to +75 Item Symbol Unit Test Conditions Power supply voltage Normal mode, sleep mode, DD-CPG deep-sleep mode, standby mode DD-RTC 1.35 Normal mode, sleep mode, DD-PLL1/2 deep-sleep mode, standby mode I = 200 MHz Current Normal —...
  • Page 976 Item Symbol Unit Test Conditions Input –0.3 — 0.1 V voltage NMI, BRKACK, , CA PCICLK –0.3 — Other PCI input –0.3 — pins Other input –0.3 — pins Input leak All input |Iin| — —...
  • Page 977: Table 23.6 Dc Characteristics (Hd6417751Bp167)

    Table 23.6 DC Characteristics (HD6417751BP167) Ta = –20 to +75 Item Symbol Unit Test Conditions Power supply voltage Normal mode, sleep mode, DD-CPG standby mode DD-RTC Normal mode, sleep mode, DD-PLL1/2 standby mode I = 167 MHz Current Normal —...
  • Page 978 Item Symbol Unit Test Conditions Input –0.3 — 0.1 V voltage NMI, BRKACK, , CA PCICLK –0.3 — Other PCI input –0.3 — pins Other input –0.3 — pins Input leak All input |Iin| — —...
  • Page 979: Table 23.7 Dc Characteristics (Hd6417751Bp167I)

    Table 23.7 DC Characteristics (HD6417751BP167I) Ta = –40 to +85 Item Symbol Unit Test Conditions Power supply voltage Normal mode, sleep mode, DD-CPG standby mode DD-RTC Normal mode, sleep mode, DD-PLL1/2 standby mode I = 167 MHz Current Normal —...
  • Page 980 Item Symbol Unit Test Conditions Input –0.3 — 0.1 V voltage NMI, BRKACK, , CA PCICLK –0.3 — Other PCI input –0.3 — pins Other input –0.3 — pins Input leak All input |Iin| — —...
  • Page 981: Table 23.8 Dc Characteristics (Hd6417751F167)

    Table 23.8 DC Characteristics (HD6417751F167) Ta = –20 to +75 Item Symbol Unit Test Conditions Power supply voltage Normal mode, sleep mode, DD-CPG standby mode DD-RTC Normal mode, sleep mode, DD-PLL1/2 standby mode I = 167 MHz Current Normal —...
  • Page 982 Item Symbol Unit Test Conditions Input –0.3 — 0.1 V voltage NMI, BRKACK, , CA PCICLK –0.3 — Other PCI input –0.3 — pins Other input –0.3 — pins Input leak All input |Iin| — —...
  • Page 983: Table 23.9 Dc Characteristics (Hd6417751F167I)

    Table 23.9 DC Characteristics (HD6417751F167I) Ta = –40 to +85 Item Symbol Unit Test Conditions Power supply voltage Normal mode, sleep mode, DD-CPG standby mode DD-RTC Normal mode, sleep mode, DD-PLL1/2 standby mode I = 167 MHz Current Normal —...
  • Page 984 Item Symbol Unit Test Conditions Input –0.3 — 0.1 V voltage NMI, BRKACK, , CA PCICLK –0.3 — Other PCI input –0.3 — pins Other input –0.3 — pins Input leak All input |Iin| — —...
  • Page 985: Table 23.10 Dc Characteristics (Hd6417751Vf133)

    Table 23.10 DC Characteristics (HD6417751VF133) Ta = –20 to +75 Item Symbol Unit Test Conditions Power supply Normal mode, voltage sleep mode, DD-CPG standby mode DD-RTC Normal mode, sleep mode, DD-PLL1/2 standby mode Current Normal — = 133 MHz dissipation operation Sleep mode —...
  • Page 986 Item Symbol Unit Test Conditions Input –0.3 — 0.1 V voltage NMI, BRKACK, , CA PCICLK –0.3 — Other PCI input –0.3 — pins Other input pins –0.3 — Input leak All input |Iin| — —...
  • Page 987: Ac Characteristics

    Table 23.11 Permissible Output Currents Item Symbol Unit Permissible output low current — — (per pin; other than PCI pins) Permissible output low current — — (per pin; PCI pins) Permissible output low current — — (total) Permissible output high current –I —...
  • Page 988: Table 23.14 Clock Timing (Hd6417751Rbp200)

    Table 23.14 Clock Timing (HD6417751RBP200) Item Symbol Unit Notes Operating CPU, FPU, cache, TLB — frequency External bus — Peripheral modules — Table 23.15 Clock Timing (HD6417751RF200) Item Symbol Unit Notes Operating CPU, FPU, cache, TLB — frequency External bus —...
  • Page 989: Clock And Control Signal Timing

    23.3.1 Clock and Control Signal Timing Table 23.18 Clock and Control Signal Timing (HD6417751RBP240) = 3.0 to 3.6 V, V = 1.5 V, Ta = –20 to 75 C, C = 30 pF Item Symbol Unit Figure EXTAL PLL1 6-times/PLL2 operation clock input PLL1 12-times/PLL2 operation frequency...
  • Page 990: Table 23.19 Clock And Control Signal Timing (Hd6417751Rf240)

    Table 23.19 Clock and Control Signal Timing (HD6417751RF240) = 3.0 to 3.6 V, V = 1.5 V, Ta = –20 to 75 C, C = 30 pF Item Symbol Unit Figure EXTAL PLL1 6-times/PLL2 operation clock input PLL1 12-times/PLL2 operation 20.0 frequency PLL1/PLL2 not operating...
  • Page 991: Table 23.20 Clock And Control Signal Timing (Hd6417751Rbp200)

    Table 23.20 Clock and Control Signal Timing (HD6417751RBP200) = 3.0 to 3.6 V, V = 1.5 V, Ta = –20 to 75 C, C = 30 pF Item Symbol Unit Figure EXTAL PLL1 6-times/PLL2 operation clock input PLL1 12-times/PLL2 operation frequency PLL1/PLL2 not operating EXTAL clock input cycle time...
  • Page 992: Table 23.21 Clock And Control Signal Timing (Hd6417751Rf200)

    Table 23.21 Clock and Control Signal Timing (HD6417751RF200) = 3.0 to 3.6 V, V = 1.5 V, Ta = –20 to 75 C, C = 30 pF Item Symbol Unit Figure EXTAL PLL1 6-times/PLL2 operation clock input PLL1 12-times/PLL2 operation frequency PLL1/PLL2 not operating EXTAL clock input cycle time...
  • Page 993: Table 23.22 Clock And Control Signal Timing

    Table 23.22 Clock and Control Signal Timing (HD6417751BP167, HD6417751F167, HD6417751BP167I, HD6417751F167I) HD6417751BP167, HD6417751F167: V = 3.0 to 3.6 V, V = 1.8 V, Ta = –20 to 75 = 30 pF HD6417751BP167I, HD6417751F167I: V = 3.0 to 3.6 V, V = 1.8 V, Ta = –40 to 85 = 30 pF Item...
  • Page 994: Table 23.23 Clock And Control Signal Timing (Hd6417751Vf133)

    Table 23.23 Clock and Control Signal Timing (HD6417751VF133) = 3.0 to 3.6 V, V = typ. 1.5 V, T = –20 to +75 C, C = 30 pF Item Symbol Unit Figure EXTAL PLL1/PLL2 1/2 divider clock input operating operating frequency 1/2 divider not operating...
  • Page 995: Figure 23.1 Extal Clock Input Timing

    EXcyc 1/2V 1/2V Note: When the clock is input from the EXTAL pin Figure 23.1 EXTAL Clock Input Timing CKOL1 CKOH1 1/2V 1/2V CKOf CKOr Figure 23.2(1) CKIO Clock Output Timing CKOH2 CKOL2 1.5 V 1.5 V 1.5 V Figure 23.2(2) CKIO Clock Output Timing Rev.
  • Page 996: Figure 23.3 Power-On Oscillation Settling Time

    Stable oscillation CKIO, internal clock RESW OSC1 OSCMD MDRH MD10 to MD0 TRSTRH TRST (High) Notes: 1. Oscillation settling time when on-chip resonator is used 2. PLL2 not operating Figure 23.3 Power-On Oscillation Settling Time Standby Stable oscillation CKIO, internal clock RESW OSC2 Notes: 1.
  • Page 997: Figure 23.5 Power-On Oscillation Settling Time

    Stable oscillation Internal clock RESW OSC1 OSCMD MDRH MD10 to MD0 TRSTRH CKIO Notes: 1. Oscillation settling time when on-chip resonator is used 2. PLL2 operating Figure 23.5 Power-On Oscillation Settling Time Stable oscillation Standby Internal clock RESW OSC2 CKIO Notes: 1.
  • Page 998: Figure 23.7 Standby Return Oscillation Settling Time (Return By Nmi)

    Standby Stable oscillation CKIO, internal clock OSC3 Note: Oscillation settling time when on-chip resonator is used Figure 23.7 Standby Return Oscillation Settling Time (Return by NMI) Stable oscillation Standby CKIO, internal clock OSC4 – Note: Oscillation settling time when on-chip resonator is used ...
  • Page 999: Figure 23.10 Pll Synchronization Settling Time In Case Of Irl Interrupt

    Reset or NMI interrupt request Stable input clock Stable input clock EXTAL input × 2 PLL synchronization PLL synchronization PLL output, CKIO output Internal clock STATUS1– Normal Standby Normal STATUS0 Note: When an external clock is input from EXTAL. Figure 23.9 PLL Synchronization Settling Time in Case of...
  • Page 1000: Control Signal Timing

    23.3.2 Control Signal Timing Table 23.24 Control Signal Timing (1) HD6417751R HD6417751R HD6417751R HD6417751R BP240 BP200 F240 F200 Item Symbol Unit Figure setup time — — — — 23.11 BREQS hold time — — — — 23.11 BREQH delay time —...

This manual is also suitable for:

Sh7751r

Table of Contents