MCF5407 ColdFire(R) Integrated Microprocessor User's Manual MCF5407UM/D Rev. 0.1, 11/2001 ColdFire is a registered trademark and DigitalDNA is a trademark of Motorola, Inc. I2C is a registered trademark of Philips Semiconductors Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "Typical" parameters which may be provided in Motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including "Typicals" must be validated for each customer application by customer's technical experts. Motorola does not convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part. Motorola and are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer. How to reach us: USA/EUROPE/Locations Not Listed: Motorola Literature Distribution; P.O. Box 5405, Denver, Colorado 80217. 1-303-675-2140 or 1-800-441-2447 JAPAN: Motorola Japan Ltd.; SPS, Technical Information Center, 3-20-1, Minami-Azabu. Minato-ku, Tokyo 106-8573 Japan. 81-3-3440-3569 ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd.; Silicon Harbour Centre, 2 Dai King Street, Tai Po Industrial Estate, Tai Po, N.T., Hong Kong. 852-26668334 Technical Information Center: 1-800-521-6274 HOME PAGE: http://www.motorola.com/semiconductors Document Comments: FAX (512) 895-2638, Attn: TECD Applications Engineering (c) Motorola Inc., 2001. All rights reserved. Overview Part I: MCF5407 Processor Core 1 Part I ColdFire Core 2 Hardware Multiply/Accumulate (MAC) Unit 3 Local Memory 4 Debug Support 5 Part II: System Integration Module (SIM) Part II SIM Overview 6 Phase-Locked Loop (PLL) 7 I2C Module 8 Interrupt Controller 9 Chip-Select Module 10 Synchronous/Asynchronous DRAM Controller Module 11 Part III: Peripheral Module Part III DMA Controller Module 12 Timer Module 13 UART Modules 14 Parallel Port (General-Purpose I/O) 15 Part IV: Hardware Interface Part IV Mechanical Data 16 Signal Descriptions 17 Bus Operation 18 IEEE 1149.1 Test Access Port (JTAG) 19 Electrical Specifications 20 Appendix A: Migration A Appendix B: Memory Map B Glossary of Terms and Abbreviations GLO Index IND IND B GLO IND 1 Part I Overview Part I: MCF5407 Processor Core 2 ColdFire Core 3 Hardware Multiply/Accumulate (MAC) Unit 4 Local Memory 5 Debug Support Part II Part II: System Integration Module (SIM) 6 SIM Overview 7 Phase-Locked Loop (PLL) 8 I2C Module 9 Interrupt Controller 10 Chip-Select Module 11 Synchronous/Asynchronous DRAM Controller Module Part III Part III: Peripheral Module 12 DMA Controller Module 13 Timer Module 14 UART Modules 15 Parallel Port (General-Purpose I/O) Part IV Part IV: Hardware Interface 16 Mechanical Data 17 Signal Descriptions 18 Bus Operation 19 IEEE 1149.1 Test Access Port (JTAG) 20 Electrical Specifications A Appendix A: Migration B Appendix B: Memory Map GLO Glossary of Terms and Abbreviations IND Index CONTENTS Paragraph Number Title Page Number Chapter 1 Overview 1.1 1.2 1.2.1 1.3 1.3.1 1.3.1.1 1.3.1.2 1.3.1.3 1.3.1.4 1.3.2 1.3.2.1 1.3.2.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.8.1 1.3.8.2 1.3.8.3 1.3.8.4 1.3.8.5 1.3.9 1.3.10 1.4 1.4.1 1.4.2 Features ............................................................................................................... 1-1 MCF5407 Features.............................................................................................. 1-4 Process ............................................................................................................ 1-7 ColdFire Module Description ............................................................................. 1-7 ColdFire Core ................................................................................................. 1-7 Instruction Fetch Pipeline (IFP).................................................................. 1-7 Operand Execution Pipeline (OEP) ............................................................ 1-8 MAC Module.............................................................................................. 1-8 Integer Divide Module................................................................................ 1-8 Harvard Architecture ...................................................................................... 1-8 16-Kbyte Instruction Cache/8-Kbyte Data Cache ...................................... 1-9 Internal 2-Kbyte SRAMs ............................................................................ 1-9 DRAM Controller ........................................................................................... 1-9 DMA Controller.............................................................................................. 1-9 UART Modules............................................................................................. 1-10 Timer Module ............................................................................................... 1-11 I2C Module ................................................................................................... 1-11 System Interface ........................................................................................... 1-11 External Bus Interface .............................................................................. 1-11 Chip Selects .............................................................................................. 1-11 16-Bit Parallel Port Interface .................................................................... 1-12 Interrupt Controller ................................................................................... 1-12 JTAG......................................................................................................... 1-12 System Debug Interface................................................................................ 1-12 PLL Module.................................................................................................. 1-13 Programming Model, Addressing Modes, and Instruction Set......................... 1-13 Programming Model ..................................................................................... 1-15 User Registers ............................................................................................... 1-15 Contents v CONTENTS Paragraph Number 1.4.3 1.4.4 Title Page Number Supervisor Registers ..................................................................................... 1-16 Instruction Set ............................................................................................... 1-16 Part I MCF5407 Processor Core Chapter 2 ColdFire Core 2.1 2.1.1 2.1.2 2.1.2.1 2.1.2.1.1 2.1.2.2 2.1.2.2.1 2.1.2.2.2 2.1.2.2.3 2.1.2.3 2.1.3 2.2 2.2.1 2.2.1.1 2.2.1.2 2.2.1.3 2.2.1.4 2.2.1.5 2.2.1.6 2.2.2 2.2.2.1 2.2.2.2 2.2.2.3 2.2.2.4 2.2.2.5 2.2.2.6 2.3 2.4 2.4.1 2.4.2 2.5 2.6 2.6.1 vi Features and Enhancements................................................................................ 2-1 Clock-Multiplied Microprocessor Core.......................................................... 2-2 Enhanced Pipelines ......................................................................................... 2-2 Instruction Fetch Pipeline (IFP).................................................................. 2-4 Branch Acceleration ............................................................................... 2-4 Operand Execution Pipeline (OEP) ............................................................ 2-4 Illegal Opcode Handling......................................................................... 2-5 Hardware Multiply/Accumulate (MAC) Unit ........................................ 2-5 Hardware Divide Unit............................................................................. 2-6 Harvard Memory Architecture ................................................................... 2-6 Debug Module Enhancements ........................................................................ 2-6 Programming Model ........................................................................................... 2-7 User Programming Model .............................................................................. 2-8 Data Registers (D0-D7) ............................................................................. 2-8 Address Registers (A0-A6) ........................................................................ 2-9 Stack Pointer (A7, SP) ................................................................................ 2-9 Program Counter (PC) ................................................................................ 2-9 Condition Code Register (CCR) ................................................................. 2-9 MAC Programming Model....................................................................... 2-10 Supervisor Programming Model................................................................... 2-10 Status Register (SR).................................................................................. 2-11 Vector Base Register (VBR) .................................................................... 2-12 Cache Control Register (CACR) .............................................................. 2-12 Access Control Registers (ACR0-ACR3)................................................ 2-12 RAM Base Address Registers (RAMBAR0 and RAMBAR1) ................ 2-12 Module Base Address Register (MBAR) ................................................. 2-12 Integer Data Formats......................................................................................... 2-13 Organization of Data in Registers..................................................................... 2-13 Organization of Integer Data Formats in Registers ...................................... 2-13 Organization of Integer Data Formats in Memory ....................................... 2-14 Addressing Mode Summary ............................................................................. 2-15 Instruction Set Summary................................................................................... 2-15 Additions to the Instruction Set Architecture ............................................... 2-18 MCF5407 User's Manual CONTENTS Paragraph Number 2.6.2 2.7 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8 2.8.1 2.8.2 2.9 Title Page Number Instruction Set Summary .............................................................................. Execution Timings ............................................................................................ MOVE Instruction Execution Timing .......................................................... Execution Timings--One-Operand Instructions .......................................... Execution Timings--Two-Operand Instructions.......................................... Miscellaneous Instruction Execution Times................................................. Branch Instruction Execution Times ............................................................ Exception Processing Overview ....................................................................... Exception Stack Frame Definition................................................................ Processor Exceptions .................................................................................... ColdFire Instruction Set Architecture Enhancements....................................... 2-19 2-23 2-25 2-26 2-27 2-29 2-30 2-31 2-32 2-34 2-36 Chapter 3 Hardware Multiply/Accumulate (MAC) Unit 3.1 3.1.0.1 3.1.0.2 3.1.0.3 3.1.0.4 3.2 Overview............................................................................................................. MAC Programming Model......................................................................... General Operation....................................................................................... MAC Instruction Set Summary .................................................................. Data Representation.................................................................................... MAC Instruction Execution Timings.................................................................. 3-1 3-2 3-3 3-4 3-4 3-5 Chapter 4 Local Memory 4.1 4.2 4.3 4.4 4.4.1 4.5 4.5.1 4.6 4.7 4.8 4.8.1 4.8.2 4.9 4.9.1 4.9.1.1 4.9.1.2 4.9.1.3 Interactions between Local Memory Modules ................................................... 4-1 SRAM Overview ................................................................................................ 4-1 SRAM Operation ................................................................................................ 4-2 SRAM Programming Model............................................................................... 4-3 SRAM Base Address Registers (RAMBAR0/RAMBAR1)........................... 4-3 SRAM Initialization............................................................................................ 4-4 SRAM Initialization Code .............................................................................. 4-5 Power Management ............................................................................................ 4-6 Cache Overview.................................................................................................. 4-6 Cache Organization............................................................................................. 4-8 Cache Line States: Invalid, Valid-Unmodified, and Valid-Modified............. 4-8 The Cache at Start-Up..................................................................................... 4-9 Cache Operation................................................................................................ 4-11 Caching Modes ............................................................................................. 4-13 Cacheable Accesses .................................................................................. 4-14 Write-Through Mode (Data Cache Only)................................................. 4-14 Copyback Mode (Data Cache Only)......................................................... 4-14 Contents vii CONTENTS Paragraph Number 4.9.2 4.9.3 4.9.3.1 4.9.3.2 4.9.3.3 4.9.3.4 4.9.4 4.9.5 4.9.5.1 4.9.5.2 4.9.5.2.1 4.9.5.2.2 4.9.6 4.10 4.10.1 4.10.2 4.11 4.12 4.12.1 4.12.2 4.13 Title Page Number Cache-Inhibited Accesses ............................................................................. Cache Protocol.............................................................................................. Read Miss ................................................................................................. Write Miss (Data Cache Only) ................................................................. Read Hit .................................................................................................... Write Hit (Data Cache Only) .................................................................... Cache Coherency (Data Cache Only)........................................................... Memory Accesses for Cache Maintenance................................................... Cache Filling............................................................................................. Cache Pushes ............................................................................................ Push and Store Buffers ......................................................................... Push and Store Buffer Bus Operation................................................... Cache Locking .............................................................................................. Cache Registers................................................................................................. Cache Control Register (CACR) .................................................................. Access Control Registers (ACR0-ACR3).................................................... Cache Management........................................................................................... Cache Operation Summary ............................................................................... Instruction Cache State Transitions .............................................................. Data Cache State Transitions........................................................................ Cache Initialization Code.................................................................................. 4-14 4-15 4-16 4-16 4-16 4-17 4-17 4-17 4-17 4-18 4-18 4-18 4-19 4-21 4-21 4-23 4-24 4-27 4-27 4-28 4-32 Chapter 5 Debug Support 5.1 5.2 5.2.1 5.3 5.3.1 5.3.2 5.3.3 5.4 5.4.1 5.4.2 5.4.3 5.4.4 5.4.5 5.4.6 5.4.7 5.4.8 viii Overview............................................................................................................. 5-1 Signal Descriptions ............................................................................................. 5-2 Processor Status/Debug Data (PSTDDATA[7:0]) ......................................... 5-3 Real-Time Trace Support.................................................................................... 5-4 Begin Execution of Taken Branch (PST = 0x5) ............................................. 5-6 Processor Stopped or Breakpoint State Change (PST = 0xE) ........................ 5-7 Processor Halted (PST = 0xF) ........................................................................ 5-7 Programming Model ........................................................................................... 5-8 Address Attribute Trigger Registers (AATR, AATR1)................................ 5-10 Address Breakpoint Registers (ABLR/ABLR1, ABHR/ABHR1) ............. 5-12 BDM Address Attribute Register (BAAR)................................................... 5-12 Configuration/Status Register (CSR)............................................................ 5-13 Data Breakpoint/Mask Registers (DBR/DBR1, DBMR/DBMR1) ............ 5-15 Program Counter Breakpoint/Mask Registers (PBR, PBR1, PBR2, PBR3, PBMR) ........................................................ 5-16 Trigger Definition Register (TDR) ............................................................... 5-18 Extended Trigger Definition Register (XTDR) ............................................ 5-19 MCF5407 User's Manual CONTENTS Paragraph Number 5.4.9 5.5 5.5.1 5.5.2 5.5.2.1 5.5.2.2 5.5.3 5.5.3.1 5.5.3.1.1 5.5.3.2 5.5.3.3 5.5.3.3.1 5.5.3.3.2 5.5.3.3.3 5.5.3.3.4 5.5.3.3.5 5.5.3.3.6 5.5.3.3.7 5.5.3.3.8 5.5.3.3.9 5.5.3.3.10 5.5.3.3.11 5.5.3.3.12 5.5.3.3.13 5.6 5.6.1 5.6.1.1 5.6.2 5.7 5.8 5.8.1 5.8.2 Title Page Number Resulting Set of Possible Trigger Combinations.......................................... Background Debug Mode (BDM) .................................................................... CPU Halt....................................................................................................... BDM Serial Interface.................................................................................... Receive Packet Format ............................................................................. Transmit Packet Format............................................................................ BDM Command Set...................................................................................... ColdFire BDM Command Format............................................................ Extension Words as Required............................................................... Command Sequence Diagrams................................................................. Command Set Descriptions ...................................................................... Read A/D Register (RAREG/RDREG) ..................................................... Write A/D Register (WAREG/WDREG)................................................... Read Memory Location (READ)............................................................ Write Memory Location (WRITE) ......................................................... Dump Memory Block (DUMP) .............................................................. Fill Memory Block (FILL) ..................................................................... Resume Execution (GO)........................................................................ No Operation (NOP) .............................................................................. Synchronize PC to the PSTDDATA Lines (SYNC_PC) ........................ Read Control Register (RCREG) ............................................................ Write Control Register (WCREG) .......................................................... Read Debug Module Register (RDMREG) ............................................. Write Debug Module Register (WDMREG) ........................................... Real-Time Debug Support ................................................................................ Theory of Operation...................................................................................... Emulator Mode ......................................................................................... Concurrent BDM and Processor Operation .................................................. Motorola-Recommended BDM Pinout............................................................. Debug C Definition of PSTDDATA Outputs................................................... User Instruction Set ...................................................................................... Supervisor Instruction Set............................................................................. 5-21 5-22 5-22 5-24 5-25 5-26 5-26 5-27 5-28 5-28 5-30 5-30 5-31 5-32 5-33 5-35 5-37 5-39 5-40 5-41 5-42 5-43 5-44 5-45 5-45 5-46 5-48 5-48 5-49 5-49 5-50 5-53 Part II System Integration Module (SIM) Chapter 6 SIM Overview 6.1 6.2 6.2.1 Features ............................................................................................................... 6-1 Programming Model ........................................................................................... 6-3 SIM Register Memory Map............................................................................ 6-3 Contents ix CONTENTS Paragraph Number 6.2.2 6.2.3 6.2.4 6.2.5 6.2.6 6.2.7 6.2.8 6.2.9 6.2.10 6.2.10.1 6.2.10.1.1 6.2.10.1.2 Title Page Number Module Base Address Register (MBAR) ....................................................... 6-4 Reset Status Register (RSR) ........................................................................... 6-5 Software Watchdog Timer.............................................................................. 6-6 System Protection Control Register (SYPCR) ............................................... 6-8 Software Watchdog Interrupt Vector Register (SWIVR)............................... 6-9 Software Watchdog Service Register (SWSR)............................................... 6-9 PLL Clock Control for CPU STOP Instruction ............................................ 6-10 Pin Assignment Register (PAR) ................................................................... 6-10 Bus Arbitration Control ................................................................................ 6-11 Default Bus Master Park Register (MPARK) .......................................... 6-11 Arbitration for Internally Generated Transfers (MPARK[PARK])...... 6-12 Arbitration between Internal and External Masters for Accessing Internal Resources ......................................................... 6-14 Chapter 7 Phase-Locked Loop (PLL) 7.1 7.1.1 7.2 7.2.1 7.2.2 7.2.3 7.2.4 7.3 7.4 7.4.1 7.4.2 7.5 Overview............................................................................................................. PLL:PCLK Ratios........................................................................................... PLL Operation .................................................................................................... Reset/Initialization .......................................................................................... Normal Mode.................................................................................................. Reduced-Power Mode..................................................................................... PLL Control Register (PLLCR)...................................................................... PLL Port List....................................................................................................... Timing Relationships .......................................................................................... PCLK, PSTCLK, and BCLKO ....................................................................... RSTI Timing ................................................................................................... PLL Power Supply Filter Circuit ........................................................................ 7-1 7-2 7-2 7-2 7-2 7-3 7-3 7-4 7-4 7-4 7-5 7-6 Chapter 8 I2C Module 8.1 8.2 8.3 8.4 8.4.1 8.4.2 8.4.3 8.4.4 8.5 x Overview............................................................................................................. Interface Features................................................................................................ I2C System Configuration................................................................................... I2C Protocol ........................................................................................................ Arbitration Procedure ..................................................................................... Clock Synchronization.................................................................................... Handshaking ................................................................................................... Clock Stretching ............................................................................................. Programming Model ........................................................................................... MCF5407 User's Manual 8-1 8-1 8-3 8-3 8-4 8-5 8-5 8-5 8-6 CONTENTS Paragraph Number 8.5.1 8.5.2 8.5.3 8.5.4 8.5.5 8.6 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.6.6 8.6.7 Title Page Number I2C Address Register (IADR) ......................................................................... 8-6 I2C Frequency Divider Register (IFDR)......................................................... 8-6 I2C Control Register (I2CR) ........................................................................... 8-7 I2C Status Register (I2SR).............................................................................. 8-8 I2C Data I/O Register (I2DR) ......................................................................... 8-9 I2C Programming Examples ............................................................................. 8-10 Initialization Sequence.................................................................................. 8-10 Generation of START................................................................................... 8-10 Post-Transfer Software Response................................................................. 8-11 Generation of STOP...................................................................................... 8-12 Generation of Repeated START................................................................... 8-12 Slave Mode ................................................................................................... 8-13 Arbitration Lost............................................................................................. 8-13 Chapter 9 Interrupt Controller 9.1 9.2 9.2.1 9.2.2 9.2.3 9.2.4 Overview............................................................................................................. Interrupt Controller Registers ............................................................................. Interrupt Control Registers (ICR0-ICR9) ...................................................... Autovector Register (AVR) ............................................................................ Interrupt Pending and Mask Registers (IPR and IMR)................................... Interrupt Port Assignment Register (IRQPAR) .............................................. 9-1 9-2 9-3 9-5 9-6 9-7 Chapter 10 Chip-Select Module 10.1 10.2 10.3 10.3.1 10.3.1.1 10.3.1.2 10.4 10.4.1 10.4.1.1 10.4.1.2 10.4.1.3 10.4.1.4 Overview........................................................................................................... Chip-Select Module Signals ............................................................................. Chip-Select Operation....................................................................................... General Chip-Select Operation..................................................................... 8-, 16-, and 32-Bit Port Sizing.................................................................. Global Chip-Select Operation................................................................... Chip-Select Registers........................................................................................ Chip-Select Module Registers ...................................................................... Chip-Select Address Registers (CSAR0-CSAR7) ................................... Chip-Select Mask Registers (CSMR0-CSMR7)...................................... Chip-Select Control Registers (CSCR0-CSCR7) .................................... Code Example........................................................................................... 10-1 10-1 10-2 10-3 10-4 10-4 10-5 10-6 10-6 10-7 10-8 10-9 Chapter 11 Synchronous/Asynchronous DRAM Controller Module Contents xi CONTENTS Paragraph Number 11.1 11.1.1 11.1.2 11.2 11.2.1 11.3 11.3.1 11.3.2 11.3.2.1 11.3.2.2 11.3.2.3 11.3.3 11.3.3.1 11.3.3.2 11.3.3.3 11.3.3.4 11.3.3.5 11.4 11.4.1 11.4.2 11.4.3 11.4.3.1 11.4.3.2 11.4.3.3 11.4.4 11.4.4.1 11.4.4.2 11.4.4.3 11.4.4.4 11.4.4.5 11.4.4.6 11.4.5 11.4.5.1 11.5 11.5.1 11.5.2 11.5.3 11.5.4 11.5.5 11.5.6 xii Title Page Number Overview........................................................................................................... 11-1 Definitions .................................................................................................... 11-2 Block Diagram and Major Components ....................................................... 11-2 DRAM Controller Operation ............................................................................ 11-3 DRAM Controller Registers ......................................................................... 11-3 Asynchronous Operation .................................................................................. 11-4 DRAM Controller Signals in Asynchronous Mode...................................... 11-4 Asynchronous Register Set........................................................................... 11-4 DRAM Control Register (DCR) in Asynchronous Mode ........................ 11-4 DRAM Address and Control Registers (DACR0/DACR1) ..................... 11-5 DRAM Controller Mask Registers (DMR0/DMR1) ................................ 11-7 General Asynchronous Operation Guidelines .............................................. 11-8 Non-Page-Mode Operation..................................................................... 11-11 Burst Page-Mode Operation ................................................................... 11-12 Continuous Page Mode........................................................................... 11-13 Extended Data Out (EDO) Operation..................................................... 11-15 Refresh Operation ................................................................................... 11-16 Synchronous Operation................................................................................... 11-16 DRAM Controller Signals in Synchronous Mode...................................... 11-17 Using Edge Select (EDGESEL) ................................................................. 11-18 Synchronous Register Set ........................................................................... 11-19 DRAM Control Register (DCR) in Synchronous Mode......................... 11-19 DRAM Address and Control Registers (DACR0/DACR1) in Synchronous Mode ......................................................................... 11-20 DRAM Controller Mask Registers (DMR0/DMR1) .............................. 11-22 General Synchronous Operation Guidelines............................................... 11-23 Address Multiplexing ............................................................................. 11-23 Interfacing Example................................................................................ 11-27 Burst Page Mode..................................................................................... 11-27 Continuous Page Mode........................................................................... 11-29 Auto-Refresh Operation.......................................................................... 11-31 Self-Refresh Operation ........................................................................... 11-32 Initialization Sequence................................................................................ 11-32 Mode Register Settings........................................................................... 11-33 SDRAM Example ........................................................................................... 11-34 SDRAM Interface Configuration................................................................ 11-34 DCR Initialization....................................................................................... 11-35 DACR Initialization.................................................................................... 11-35 DMR Initialization...................................................................................... 11-37 Mode Register Initialization ....................................................................... 11-38 Initialization Code....................................................................................... 11-39 MCF5407 User's Manual CONTENTS Paragraph Number Title Page Number Part III Peripheral Module Chapter 12 DMA Controller Module 12.1 12.1.1 12.2 12.3 12.4 12.4.1 12.4.2 12.4.3 12.4.4 12.4.5 12.4.6 12.5 12.5.1 12.5.2 12.5.2.1 12.5.2.2 12.5.3 12.5.3.1 12.5.3.2 12.5.4 12.5.4.1 12.5.4.2 12.5.4.3 12.5.5 Overview........................................................................................................... 12-1 DMA Module Features ................................................................................. 12-2 DMA Signal Description .................................................................................. 12-2 DMA Transfer Overview.................................................................................. 12-4 DMA Controller Module Programming Model................................................ 12-5 Source Address Registers (SAR0-SAR3) .................................................... 12-7 Destination Address Registers (DAR0-DAR3) ........................................... 12-7 Byte Count Registers (BCR0-BCR3)........................................................... 12-7 DMA Control Registers (DCR0-DCR3)...................................................... 12-8 DMA Status Registers (DSR0-DSR3) ....................................................... 12-10 DMA Interrupt Vector Registers (DIVR0-DIVR3) ................................... 12-11 DMA Controller Module Functional Description........................................... 12-11 Transfer Requests (Cycle-Steal and Continuous Modes) ........................... 12-12 Data Transfer Modes .................................................................................. 12-12 Dual-Address Transfers .......................................................................... 12-12 Single-Address Transfers........................................................................ 12-13 Channel Initialization and Startup .............................................................. 12-13 Channel Prioritization ............................................................................. 12-13 Programming the DMA Controller Module ........................................... 12-13 Data Transfer .............................................................................................. 12-14 External Request and Acknowledge Operation ...................................... 12-14 Auto-Alignment ...................................................................................... 12-17 Bandwidth Control.................................................................................. 12-18 Termination................................................................................................. 12-18 Chapter 13 Timer Module 13.1 13.1.1 13.2 13.3 13.3.1 13.3.2 13.3.3 13.3.4 Overview........................................................................................................... Key Features ................................................................................................. General-Purpose Timer Units ........................................................................... General-Purpose Timer Programming Model .................................................. Timer Mode Registers (TMR0/TMR1) ........................................................ Timer Reference Registers (TRR0/TRR1) ................................................... Timer Capture Registers (TCR0/TCR1)....................................................... Timer Counters (TCN0/TCN1) .................................................................... Contents 13-1 13-2 13-2 13-2 13-3 13-4 13-4 13-5 xiii CONTENTS Paragraph Number 13.3.5 13.4 13.5 Title Page Number Timer Event Registers (TER0/TER1)........................................................... 13-5 Code Example................................................................................................... 13-6 Calculating Time-Out Values ........................................................................... 13-7 Chapter 14 UART Modules 14.1 14.2 14.3 14.3.1 14.3.2 14.3.3 14.3.4 14.3.5 14.3.6 14.3.7 14.3.8 14.3.9 14.3.10 14.3.11 14.3.12 14.3.13 14.3.14 14.3.15 14.3.16 14.3.17 14.3.18 14.3.19 14.4 14.5 14.5.1 14.5.1.1 14.5.1.2 14.5.1.2.1 14.5.1.2.2 14.5.2 14.5.2.1 14.5.2.2 14.5.2.2.1 14.5.2.3 14.5.2.4 xiv Overview........................................................................................................... 14-1 Serial Module Overview ................................................................................... 14-2 Register Descriptions ........................................................................................ 14-3 UART Mode Registers 1 (UMR1n).............................................................. 14-5 UART Mode Register 2 (UMR2n) ............................................................... 14-7 Rx FIFO Threshold Register (RXLVL)........................................................ 14-8 Modem Control Register (MODCTL).......................................................... 14-9 Tx FIFO Threshold Register (TXLVL) ...................................................... 14-10 UART Status Registers (USRn) ................................................................. 14-10 UART Clock-Select Registers (UCSRn).................................................... 14-12 Receive Samples Available Register (RSMP)............................................ 14-12 Transmit Space Available Register (TSPC) ............................................... 14-13 UART Command Registers (UCRn) .......................................................... 14-13 UART Receiver Buffers (URBn) ............................................................... 14-15 UART Transmitter Buffers (UTBn) ........................................................... 14-16 UART Input Port Change Registers (UIPCRn).......................................... 14-17 UART Auxiliary Control Register (UACRn)............................................. 14-17 UART Interrupt Status/Mask Registers (UISRn/UIMRn).......................... 14-18 UART Divider Upper/Lower Registers (UDUn/UDLn) ............................ 14-19 UART Interrupt Vector Register (UIVRn)................................................. 14-20 UART Input Port Register (UIPn) .............................................................. 14-20 UART Output Port Data Registers (UOP1n/UOP0n)................................. 14-21 UART Module Signal Definitions .................................................................. 14-21 Operation......................................................................................................... 14-23 Transmitter/Receiver Clock Source............................................................ 14-23 Programmable Divider............................................................................ 14-24 Calculating Baud Rates........................................................................... 14-24 CLKIN Baud Rates............................................................................. 14-24 External Clock .................................................................................... 14-25 Transmitter and Receiver Operating Modes............................................... 14-25 Transmitting in UART Mode ................................................................. 14-26 Transmitter in Modem Mode (UART1) ................................................. 14-27 AC `97 Low-Power Mode .................................................................. 14-29 Receiver .................................................................................................. 14-29 UART1 in UART Mode ......................................................................... 14-31 MCF5407 User's Manual CONTENTS Paragraph Number 14.5.2.4.1 14.5.2.5 14.5.2.6 14.5.3 14.5.3.1 14.5.3.2 14.5.3.3 14.5.4 14.5.5 14.5.5.1 14.5.5.2 14.5.5.3 14.5.6 14.5.6.1 Title Page Number Receiver in Modem Mode (UART1).................................................. FIFO Stack in UART0............................................................................ FIFOs in UART1 .................................................................................... Looping Modes ........................................................................................... Automatic Echo Mode ............................................................................ Local Loop-Back Mode .......................................................................... Remote Loop-Back Mode....................................................................... Multidrop Mode.......................................................................................... Bus Operation ............................................................................................. Read Cycles ............................................................................................ Write Cycles ........................................................................................... Interrupt Acknowledge Cycles ............................................................... Programming .............................................................................................. UART Module Initialization Sequence .................................................. 14-31 14-32 14-33 14-34 14-34 14-34 14-35 14-35 14-37 14-37 14-37 14-37 14-37 14-38 Chapter 15 Parallel Port (General-Purpose I/O) 15.1 15.1.1 15.1.2 15.1.3 15.1.4 Parallel Port Operation...................................................................................... Pin Assignment Register (PAR) ................................................................... Port A Data Direction Register (PADDR).................................................... Port A Data Register (PADAT) .................................................................... Code Example............................................................................................... 15-1 15-1 15-2 15-2 15-4 Part IV Hardware Interface Chapter 16 Mechanical Data 16.1 16.2 16.3 16.4 Package ............................................................................................................. Pinout ................................................................................................................ Mechanical Diagram......................................................................................... Case Drawing.................................................................................................... 16-1 16-1 16-8 16-9 Chapter 17 Signal Descriptions 17.1 17.2 17.2.1 Overview........................................................................................................... 17-1 MCF5407 Bus Signals ...................................................................................... 17-7 Address Bus .................................................................................................. 17-7 Contents xv CONTENTS Paragraph Number 17.2.1.1 17.2.1.2 17.2.2 17.2.3 17.2.4 17.2.5 17.2.6 17.2.7 17.2.8 17.2.9 17.2.10 17.3 17.3.1 17.4 17.4.1 17.4.2 17.4.3 17.5 17.5.1 17.5.2 17.5.3 17.5.4 17.5.5 17.5.5.1 17.5.5.2 17.5.5.3 17.5.5.4 17.5.6 17.5.6.1 17.6 17.6.1 17.6.2 17.6.3 17.7 17.7.1 17.7.2 17.7.3 17.7.4 17.7.5 17.7.6 17.7.7 17.8 17.8.1 xvi Title Page Number Address Bus (A[23:0]).............................................................................. 17-7 Address Bus (A[31:24]/PP[15:8]) ............................................................ 17-7 Data Bus (D[31:0]) ....................................................................................... 17-8 Read/Write (R/W)......................................................................................... 17-8 Size (SIZ[1:0]) .............................................................................................. 17-8 Transfer Start (TS) ........................................................................................ 17-9 Address Strobe (AS) ..................................................................................... 17-9 Transfer Acknowledge (TA) ......................................................................... 17-9 Transfer In Progress (TIP/PP7)................................................................... 17-10 Transfer Type (TT[1:0]/PP[1:0]) ................................................................ 17-10 Transfer Modifier (TM[2:0]/PP[4:2]/DACK[1:0])..................................... 17-10 Interrupt Control Signals................................................................................. 17-12 Interrupt Request (IRQ1/IRQ2, IRQ3/IRQ6, IRQ5/IRQ4, and IRQ7)....... 17-12 Bus Arbitration Signals................................................................................... 17-12 Bus Request (BR) ....................................................................................... 17-12 Bus Grant (BG).......................................................................................... 17-12 Bus Driven (BD)......................................................................................... 17-13 Clock and Reset Signals.................................................................................. 17-13 Reset In (RSTI)........................................................................................... 17-13 Clock Input (CLKIN).................................................................................. 17-13 Bus Clock Output (BCLKO) ...................................................................... 17-13 Reset Out (RSTO)....................................................................................... 17-13 Data/Configuration Pins (D[7:0]) ............................................................... 17-14 D[7:5,3]--Boot Chip-Select (CS0) Configuration ................................. 17-14 D7--Auto Acknowledge Configuration (AA_CONFIG) ...................... 17-14 D[6:5]--Port Size Configuration (PS_CONFIG[1:0]) ........................... 17-14 D3--Byte-Enable Configuration (BE_CONFIG) .................................. 17-15 D4--Address Configuration (ADDR_CONFIG) ....................................... 17-15 D[2:0]--Divide Control (DIVIDE[2:0]) ................................................ 17-15 Chip-Select Module Signals ........................................................................... 17-15 Chip-Select (CS[7:0]) ................................................................................. 17-15 Byte Enables/Byte Write Enables (BE[3:0]/BWE[3:0]) ............................ 17-16 Output Enable (OE) .................................................................................... 17-16 DRAM Controller Signals .............................................................................. 17-16 Row Address Strobes (RAS[1:0])............................................................... 17-16 Column Address Strobes (CAS[3:0]) ......................................................... 17-16 DRAM Write (DRAMW)........................................................................... 17-16 Synchronous DRAM Column Address Strobe (SCAS) ............................. 17-17 Synchronous DRAM Row Address Strobe (SRAS)................................... 17-17 Synchronous DRAM Clock Enable (SCKE) .............................................. 17-17 Synchronous Edge Select (EDGESEL) ...................................................... 17-17 DMA Controller Module Signals.................................................................... 17-17 DMA Request (DREQ[1:0]/PP[6:5]).......................................................... 17-17 MCF5407 User's Manual CONTENTS Paragraph Number 17.8.2 17.9 17.9.1 17.9.2 17.9.3 17.9.4 17.10 17.10.1 17.10.2 17.11 17.12 17.12.1 17.12.2 17.13 17.13.1 17.13.2 17.13.3 17.13.4 17.14 17.14.1 17.14.2 17.14.3 17.14.4 17.14.5 Title Page Number Transfer Modifier/DMA Acknowledge (TM[2:0]/DACK[1:0]) ................ Serial Module Signals ..................................................................................... Transmitter Serial Data Output (TxD)........................................................ Receiver Serial Data Input (RxD)............................................................... Clear to Send (CTS).................................................................................... Request to Send (RTS) ............................................................................... Timer Module Signals..................................................................................... Timer Inputs (TIN[1:0]).............................................................................. Timer Outputs (TOUT1, TOUT0) .............................................................. Parallel I/O Port (PP[15:0]) ............................................................................ I2C Module Signals......................................................................................... I2C Serial Clock (SCL) ............................................................................... I2C Serial Data (SDA) ................................................................................ Debug and Test Signals .................................................................................. Test Mode (MTMOD[3:0]) ........................................................................ High Impedance (HIZ)................................................................................ Processor Clock Output (PSTCLK)............................................................ Processor Status Debug Data (PSTDDATA[7:0])...................................... Debug Module/JTAG Signals......................................................................... Test Reset/Development Serial Clock (TRST/DSCLK) ............................ Test Mode Select/Breakpoint (TMS/BKPT) .............................................. Test Data Input/Development Serial Input (TDI/DSI) ............................... Test Data Output/Development Serial Output (TDO/DSO)....................... Test Clock (TCK) ....................................................................................... 17-18 17-18 17-18 17-19 17-19 17-19 17-19 17-19 17-19 17-19 17-20 17-20 17-20 17-20 17-20 17-20 17-20 17-21 17-21 17-21 17-21 17-22 17-22 17-22 Chapter 18 Bus Operation 18.1 18.2 18.3 18.4 18.4.1 18.4.2 18.4.3 18.4.4 18.4.5 18.4.6 18.4.7 18.4.7.1 18.4.7.2 18.4.7.3 Features ............................................................................................................. 18-1 Bus and Control Signals.................................................................................... 18-1 Bus Characteristics............................................................................................ 18-2 Data Transfer Operation ................................................................................... 18-2 Bus Cycle Execution..................................................................................... 18-4 Data Transfer Cycle States ........................................................................... 18-5 Read Cycle.................................................................................................... 18-7 Write Cycle ................................................................................................... 18-8 Fast-Termination Cycles............................................................................... 18-9 Back-to-Back Bus Cycles ........................................................................... 18-10 Burst Cycles................................................................................................ 18-11 Line Transfers ......................................................................................... 18-12 Line Read Bus Cycles............................................................................. 18-12 Line Write Bus Cycles............................................................................ 18-14 Contents xvii CONTENTS Paragraph Number 18.4.7.4 18.5 18.6 18.7 18.7.1 18.7.2 18.8 18.8.1 18.9 18.9.1 18.9.2 18.10 18.10.1 18.10.2 Title Page Number Transfers Using Mixed Port Sizes .......................................................... Misaligned Operands ...................................................................................... Bus Errors ....................................................................................................... Interrupt Exceptions........................................................................................ Level 7 Interrupts........................................................................................ Interrupt-Acknowledge Cycle..................................................................... Bus Arbitration................................................................................................ Bus Arbitration Signals............................................................................... General Operation of External Master Transfers............................................ Two-Device Bus Arbitration Protocol (Two-Wire Mode) ......................... Multiple External Bus Device Arbitration Protocol (Three-Wire Mode)... Reset Operation............................................................................................... Master Reset ............................................................................................... Software Watchdog Reset........................................................................... 18-15 18-16 18-17 18-17 18-18 18-19 18-20 18-21 18-21 18-25 18-29 18-33 18-34 18-35 Chapter 19 IEEE 1149.1 Test Access Port (JTAG) 19.1 19.2 19.3 19.4 19.4.1 19.4.2 19.4.3 19.4.4 19.5 19.6 19.7 Overview........................................................................................................... 19-1 JTAG Signal Descriptions ............................................................................... 19-2 TAP Controller.................................................................................................. 19-3 JTAG Register Descriptions ............................................................................. 19-4 JTAG Instruction Shift Register .................................................................. 19-5 IDCODE Register ......................................................................................... 19-6 JTAG Boundary-Scan Register .................................................................... 19-7 JTAG Bypass Register................................................................................ 19-10 Restrictions ..................................................................................................... 19-10 Disabling IEEE Standard 1149.1 Operation ................................................... 19-10 Obtaining the IEEE Standard 1149.1.............................................................. 19-11 Chapter 20 Electrical Specifications 20.1 20.1.1 20.2 20.3 20.4 20.5 20.6 20.7 20.8 xviii General Parameters ........................................................................................... 20-1 Supply Voltage Sequencing and Separation Cautions.................................. 20-3 Clock Timing Specifications............................................................................. 20-4 Input/Output AC Timing Specifications........................................................... 20-6 Reset Timing Specifications ........................................................................... 20-15 Debug AC Timing Specifications................................................................... 20-16 Timer Module AC Timing Specifications ...................................................... 20-17 I2C Input/Output Timing Specifications......................................................... 20-18 UART Module AC Timing Specifications ..................................................... 20-19 MCF5407 User's Manual CONTENTS Paragraph Number 20.9 20.10 20.11 Title Page Number Parallel Port (General-Purpose I/O) Timing Specifications ........................... 20-22 DMA Timing Specifications........................................................................... 20-23 IEEE 1149.1 (JTAG) AC Timing Specifications ........................................... 20-24 Appendix A Migrating from the ColdFire MCF5307 to the MCF5407 A.1 A.2 A.3 A.4 A.5 A.6 A.6.1 A.6.2 A.7 A.8 A.8.1 A.8.2 A.8.2.1 A.8.3 A.8.3.1 A.8.3.2 A.8.3.3 A.8.3.4 A.8.3.5 A.8.4 A.8.5 A.8.6 A.9 A.10 A.11 Overview............................................................................................................ A-1 Instruction Set Additions ................................................................................... A-2 Enhanced Memories........................................................................................... A-3 On-Chip DMA Modifications............................................................................ A-4 UART Enhancements ........................................................................................ A-5 Timing Differences ............................................................................................ A-6 Phase-Locked Loop (PLL)............................................................................. A-6 Timing Relationships..................................................................................... A-7 Reset Initialization Modifications...................................................................... A-8 Revision C Debug ............................................................................................ A-10 Debug Interrupts and Interrupt Requests in Emulator Mode .................................................................................... A-10 On-Chip Breakpoint Registers..................................................................... A-12 Write Debug Module Register (wdmreg) ................................................ A-12 Debug Programming Model ........................................................................ A-14 Address Breakpoint 1 Registers (ABLR1, ABHR1) ............................... A-14 Address Attribute Breakpoint Register 1 (AATR1) ................................ A-14 Program Counter Breakpoint Registers 1-3 (PBR1-PBR3) ................... A-14 Data Breakpoint Register 1 (DBR1, DBMR1) ........................................ A-15 Extended Trigger Definition Register (XTDR) ....................................... A-15 Debug Interrupt Exception Vectors ............................................................. A-15 Processor Status and Debug Data Output Signals ....................................... A-16 Debug C Summary....................................................................................... A-17 Voltage Input Changes..................................................................................... A-17 PLL Power Supply Filter Circuit ..................................................................... A-18 Pin-Assignment Compatibility......................................................................... A-18 Appendix B List of Memory Maps Contents xix CONTENTS Paragraph Number xx Title MCF5407 User's Manual Page Number ILLUSTRATIONS Figure Number 1-1 1-2 1-3 1-4 2-1 2-2 2-3 2-4 2-5 2-6 2-7 2-8 2-9 2-1 3-1 3-2 4-1 4-2 4-3 4-4 4-5 4-6 4-7 4-8 4-9 4-10 4-11 4-12 4-13 4-14 5-1 5-2 5-3 5-4 5-5 5-6 Title Page Number MCF5407 Block Diagram............................................................................................. 1-2 UART Module Block Diagram................................................................................... 1-10 PLL Module ................................................................................................................ 1-13 ColdFire MCF5407 Programming Model .................................................................. 1-15 ColdFire Enhanced Pipeline ......................................................................................... 2-3 ColdFire Multiply-Accumulate Functionality Diagram ............................................... 2-5 ColdFire Programming Model...................................................................................... 2-8 Condition Code Register (CCR) ................................................................................... 2-9 Status Register (SR).................................................................................................... 2-11 Vector Base Register (VBR)....................................................................................... 2-12 Organization of Integer Data Formats in Data Registers............................................ 2-13 Organization of Integer Data Formats in Address Registers ...................................... 2-14 Memory Operand Addressing..................................................................................... 2-14 Exception Stack Frame Form...................................................................................... 2-33 ColdFire MAC Multiplication and Accumulation........................................................ 3-2 MAC Programming Model ........................................................................................... 3-2 SRAM Base Address Registers (RAMBARn) ............................................................. 4-3 Data Cache Organization .............................................................................................. 4-7 Data Cache Organization and Line Format .................................................................. 4-8 Data Cache--A: at Reset, B: after Invalidation, C and D: Loading Pattern............... 4-10 Data Caching Operation.............................................................................................. 4-11 Write-Miss in Copyback Mode................................................................................... 4-16 Data Cache Locking.................................................................................................... 4-20 Cache Control Register (CACR) ................................................................................ 4-21 Access Control Register Format (ACRn) ................................................................... 4-24 An Format (Data Cache)............................................................................................. 4-25 An Format (Instruction Cache) ................................................................................... 4-25 Instruction Cache Line State Diagram........................................................................ 4-27 Data Cache Line State Diagram--Copyback Mode ................................................... 4-28 Data Cache Line State Diagram--Write-Through Mode ........................................... 4-29 Processor/Debug Module Interface............................................................................... 5-1 PSTCLK Timing........................................................................................................... 5-3 PSTDDATA: Single-Cycle Instruction Timing............................................................ 5-3 Example JMP Instruction Output on PSTDDATA....................................................... 5-6 Debug Programming Model ......................................................................................... 5-9 Address Attribute Trigger Registers (AATR, AATR1).............................................. 5-11 Illustrations xxi ILLUSTRATIONS Figure Page Title Number Number 5-7 Address Breakpoint Registers (ABLR, ABHR, ABLR1, ABHR1)............................ 5-12 5-8 BDM Address Attribute Register (BAAR)................................................................. 5-13 5-9 Configuration/Status Register (CSR).......................................................................... 5-13 5-10 Data Breakpoint/Mask Registers (DBR/DBR1 and DBMR/DBMR1)....................... 5-16 5-11 Program Counter Breakpoint Registers (PBR, PBR1, PBR2, PBR3) ........................ 5-17 5-12 Program Counter Breakpoint Mask Register (PBMR) ............................................... 5-17 5-13 Trigger Definition Register (TDR) ............................................................................. 5-18 5-14 Extended Trigger Definition Register (XTDR) .......................................................... 5-20 5-15 BDM Serial Interface Timing ..................................................................................... 5-24 5-16 Receive BDM Packet.................................................................................................. 5-25 5-17 Transmit BDM Packet ................................................................................................ 5-26 5-18 BDM Command Format ............................................................................................. 5-27 5-19 Command Sequence Diagram..................................................................................... 5-29 RAREG/RDREG Command Sequence............................................................................ 5-30 5-21 RAREG/RDREG Command Format ............................................................................... 5-30 5-20 WAREG/WDREG Command Sequence .......................................................................... 5-31 5-23 WAREG/WDREG Command Format.............................................................................. 5-31 5-22 READ Command Sequence.......................................................................................... 5-32 5-25 5-24 read Command/Result Formats................................................................................... 5-32 WRITE Command Format ............................................................................................ 5-33 5-26 WRITE Command Sequence ........................................................................................ 5-34 5-27 DUMP Command/Result Formats ................................................................................ 5-35 5-28 DUMP Command Sequence ......................................................................................... 5-36 5-29 FILL Command Format................................................................................................ 5-37 5-30 FILL Command Sequence............................................................................................ 5-38 5-31 GO Command Sequence.............................................................................................. 5-39 5-33 GO Command Format.................................................................................................. 5-39 5-32 NOP Command Sequence ............................................................................................ 5-40 5-35 NOP Command Format................................................................................................ 5-40 5-34 SYNC_PC Command Sequence .................................................................................... 5-41 5-37 SYNC_PC Command Format........................................................................................ 5-41 5-36 RCREG Command Sequence........................................................................................ 5-42 5-39 RCREG Command/Result Formats............................................................................... 5-42 5-38 WCREG Command Sequence ....................................................................................... 5-43 5-41 WCREG Command/Result Formats.............................................................................. 5-43 5-40 RDMREG Command Sequence..................................................................................... 5-44 5-43 RDMREG bdm Command/Result Formats.................................................................... 5-44 5-42 WDMREG Command Sequence .................................................................................... 5-45 5-45 WDMREG BDM Command Format.............................................................................. 5-45 5-44 5-46 Recommended BDM Connector................................................................................. 5-49 6-1 SIM Block Diagram...................................................................................................... 6-1 6-2 Module Base Address Register (MBAR) ..................................................................... 6-4 6-3 Reset Status Register (RSR) ......................................................................................... 6-5 xxii MCF5407 User's Manual ILLUSTRATIONS Figure Number 6-4 6-5 6-6 6-7 6-8 6-9 6-10 6-11 6-12 6-13 7-1 7-2 7-3 7-4 7-5 8-1 8-2 8-3 8-4 8-5 8-6 8-7 8-8 8-9 8-10 9-1 9-2 9-3 9-4 9-5 10-1 10-2 10-3 10-4 11-1 11-2 11-3 11-4 11-5 11-6 11-7 11-8 11-9 Title Page Number MCF5407 Embedded System Recovery from Unterminated Access........................... 6-7 System Protection Control Register (SYPCR) ............................................................ 6-8 Software Watchdog Interrupt Vector Register (SWIVR)............................................ 6-9 Software Watchdog Service Register (SWSR)............................................................ 6-9 Pin Assignment Register (PAR) ................................................................................. 6-10 Default Bus Master Register (MPARK) ..................................................................... 6-11 Round Robin Arbitration (PARK = 00)...................................................................... 6-12 Park on Master Core Priority (PARK = 01) ............................................................... 6-13 Park on DMA Module Priority (PARK = 10)............................................................. 6-13 Park on Current Master Priority (PARK = 01) ........................................................... 6-14 PLL Module Block Diagram ........................................................................................ 7-1 PLL Control Register (PLLCR).................................................................................... 7-3 CLKIN, PCLK, PSTCLK, and BCLKO Timing .......................................................... 7-5 Reset and Initialization Timing..................................................................................... 7-6 PLL Power Supply Filter Circuit ................................................................................. 7-6 I2C Module Block Diagram .......................................................................................... 8-2 I2C Standard Communication Protocol ........................................................................ 8-3 Repeated START .......................................................................................................... 8-4 Synchronized Clock SCL.............................................................................................. 8-5 I2C Address Register (IADR) ....................................................................................... 8-6 I2C Frequency Divider Register (IFDR)....................................................................... 8-7 I2C Control Register (I2CR) ......................................................................................... 8-8 I2CR Status Register (I2SR) ......................................................................................... 8-9 I2C Data I/O Register (I2DR) ..................................................................................... 8-10 Flow-Chart of Typical I2C Interrupt Routine............................................................. 8-14 Interrupt Controller Block Diagram.............................................................................. 9-1 Interrupt Control Registers (ICR0-ICR9) .................................................................... 9-3 Autovector Register (AVR) .......................................................................................... 9-5 Interrupt Pending Register (IPR) and Interrupt Mask Register (IMR) ......................... 9-7 Interrupt Port Assignment Register (IRQPAR) ............................................................ 9-7 Connections for External Memory Port Sizes ............................................................ 10-4 Chip Select Address Registers (CSAR0-CSAR7) ..................................................... 10-6 Chip Select Mask Registers (CSMRn) ....................................................................... 10-7 Chip-Select Control Registers (CSCR0-CSCR7) ...................................................... 10-8 Asynchronous/Synchronous DRAM Controller Block Diagram ............................... 11-2 DRAM Control Register (DCR) (Asynchronous Mode) ............................................ 11-5 DRAM Address and Control Registers (DACR0/DACR1)........................................ 11-6 DRAM Controller Mask Registers (DMR0 and DMR1)............................................ 11-7 Basic Non-Page-Mode Operation RCD = 0, RNCN = 1 (4-4-4-4) .......................... 11-11 Basic Non-Page-Mode Operation RCD = 1, RNCN = 0 (5-5-5-5) .......................... 11-12 Burst Page-Mode Read Operation (4-3-3-3)............................................................. 11-13 Burst Page-Mode Write Operation (4-3-3-3)............................................................ 11-13 Continuous Page-Mode Operation............................................................................ 11-14 Illustrations xxiii ILLUSTRATIONS Figure Page Title Number Number 11-10 Write Hit in Continuous Page Mode......................................................................... 11-15 11-11 EDO Read Operation (3-2-2-2) ................................................................................ 11-15 11-12 DRAM Access Delayed by Refresh ......................................................................... 11-16 11-13 MCF5407 SDRAM Interface.................................................................................... 11-18 11-14 Using EDGESEL to Change Signal Timing............................................................. 11-19 11-15 DRAM Control Register (DCR) (Synchronous Mode) ............................................ 11-19 11-16 DACR0 and DACR1 Registers (Synchronous Mode).............................................. 11-20 11-17 DRAM Controller Mask Registers (DMR0 and DMR1).......................................... 11-22 11-18 Burst Read SDRAM Access ..................................................................................... 11-28 11-19 Burst Write SDRAM Access .................................................................................... 11-29 11-20 Synchronous, Continuous Page-Mode Access--Consecutive Reads....................... 11-30 11-21 Synchronous, Continuous Page-Mode Access--Read after Write........................... 11-31 11-22 Auto-Refresh Operation............................................................................................ 11-32 11-23 Self-Refresh Operation ............................................................................................. 11-32 11-24 Mode Register Set (mrs) Command ......................................................................... 11-34 11-25 Initialization Values for DCR ................................................................................... 11-35 11-26 SDRAM Configuration............................................................................................. 11-36 11-27 DACR Register Configuration.................................................................................. 11-36 11-28 DMR0 Register ......................................................................................................... 11-37 11-29 Mode Register Mapping to MCF5407 A[31:0] ........................................................ 11-38 12-1 DMA Signal Diagram ................................................................................................. 12-1 12-2 MCF5307/MCF5407 TM[2:0] Pin Remapping .......................................................... 12-4 12-3 Dual-Address Transfer................................................................................................ 12-4 12-4 Single-Address Transfers............................................................................................ 12-5 12-6 Destination Address Registers (DARn) ...................................................................... 12-7 12-5 Source Address Registers (SARn) .............................................................................. 12-7 12-7 Byte Count Registers (BCRn)..................................................................................... 12-8 12-8 DMA Control Registers (DCRn) ............................................................................... 12-8 12-9 DMA Status Registers (DSRn) ................................................................................ 12-10 12-10 DMA Interrupt Vector Registers (DIVRn) ............................................................... 12-11 12-11 DREQ Timing Constraints, Dual-Address DMA Transfer....................................... 12-15 12-12 Dual-Address, Peripheral-to-SDRAM, Lower-Priority DMA Transfer ................... 12-16 12-13 Single-Address DMA Transfer ................................................................................. 12-17 13-1 Timer Block Diagram ................................................................................................. 13-1 13-2 Timer Mode Registers (TMR0/TMR1) ...................................................................... 13-3 13-3 Timer Reference Registers (TRR0/TRR1) ................................................................. 13-4 13-4 Timer Capture Register (TCR0/TCR1) ...................................................................... 13-5 13-5 Timer Counters (TCN0/TCN1)................................................................................... 13-5 13-6 Timer Event Registers (TER0/TER1)......................................................................... 13-5 14-1 Simplified Block Diagram .......................................................................................... 14-1 14-2 UART Mode Registers 1 (UMR1n)............................................................................ 14-6 14-3 UART Mode Register 2 (UMR2n) ............................................................................. 14-7 14-4 Rx FIFO Threshold Register (RXLVL)...................................................................... 14-8 xxiv MCF5407 User's Manual ILLUSTRATIONS Figure Number 14-5 14-6 14-7 14-8 14-9 14-10 14-11 14-12 14-13 14-14 14-15 14-16 14-17 14-18 14-19 14-20 14-21 14-22 14-24 14-23 14-25 14-26 14-27 14-28 14-29 14-30 14-31 14-32 14-33 14-34 14-35 14-36 14-37 14-38 14-39 15-1 15-2 15-3 16-1 16-2 16-3 17-1 17-2 Title Page Number Modem Control Register (MODCTL) ........................................................................ 14-9 Tx FIFO Threshold Register (TXLVL) .................................................................... 14-10 UART Status Register (USRn) ................................................................................. 14-10 UART Clock-Select Register (UCSRn).................................................................... 14-12 Receive Samples Available Register (RSMP).......................................................... 14-13 Tx Space Available Register (TSPC) ....................................................................... 14-13 UART Command Register (UCRn).......................................................................... 14-14 UART Receiver Buffer for UART0 (URB0)............................................................ 14-16 UART Receiver Buffer for UART1 (URB1)............................................................ 14-16 UART Transmitter Buffer for UART0 (UTB0) ....................................................... 14-16 UART Transmitter Buffer for UART1 (UTB1) ....................................................... 14-17 UART Input Port Change Register (UIPCRn).......................................................... 14-17 UART Auxiliary Control Register (UACRn) ........................................................... 14-18 UART Interrupt Status/Mask Registers (UISRn/UIMRn)........................................ 14-18 UART Divider Upper Register (UDUn)................................................................... 14-19 UART Divider Lower Register (UDLn)................................................................... 14-19 UART Interrupt Vector Register (UIVRn) ............................................................... 14-20 UART Input Port Register (UIPn) ............................................................................ 14-20 UART Block Diagram Showing External and Internal Interface Signals ................ 14-21 UART Output Port Data 1 Register (UOP1/UOP0) ................................................. 14-21 UART/RS-232 Interface ........................................................................................... 14-23 UART1/CODEC Interface........................................................................................ 14-23 UART1/AC '97 Interface ......................................................................................... 14-23 Clocking Source Diagram......................................................................................... 14-24 Transmitter and Receiver Functional Diagram......................................................... 14-25 Transmitter Timing Diagram .................................................................................... 14-27 16-Bit CODEC Interface Timing (lsb First) ............................................................. 14-27 8-Bit CODEC Interface Timing (msb First) ............................................................. 14-28 AC `97 Interface Timing........................................................................................... 14-28 Receiver Timing........................................................................................................ 14-30 Automatic Echo ........................................................................................................ 14-34 Local Loop-Back ...................................................................................................... 14-34 Remote Loop-Back ................................................................................................... 14-35 Multidrop Mode Timing Diagram ............................................................................ 14-36 UART Mode Programming Flowchart ..................................................................... 14-39 Parallel Port Pin Assignment Register (PAR) ............................................................ 15-1 Port A Data Direction Register (PADDR).................................................................. 15-2 Port A Data Register (PADAT) .................................................................................. 15-3 Mechanical Diagram................................................................................................... 16-9 MCF5407 Case Drawing (General View) ................................................................ 16-10 Case Drawing (Details)............................................................................................. 16-11 MCF5407 Block Diagram with Signal Interfaces ...................................................... 17-2 MCF5307 to MCF5407 TM[2:0] Pin Remapping .................................................... 17-18 Illustrations xxv ILLUSTRATIONS Figure Page Title Number Number 18-1 Signal Relationship to CLKIN for Non-DRAM Access............................................. 18-2 18-2 Connections for External Memory Port Sizes ............................................................ 18-4 18-3 Chip-Select Module Output Timing Diagram ............................................................ 18-4 18-4 Data Transfer State Transition Diagram ..................................................................... 18-6 18-5 Read Cycle Flowchart................................................................................................. 18-7 18-6 Basic Read Bus Cycle................................................................................................. 18-8 18-7 Write Cycle Flowchart................................................................................................ 18-9 18-8 Basic Write Bus Cycle ................................................................................................ 18-9 18-9 Read Cycle with Fast Termination ........................................................................... 18-10 18-10 Write Cycle with Fast Termination........................................................................... 18-10 18-11 Back-to-Back Bus Cycles ......................................................................................... 18-11 18-12 Line Read Burst (2-1-1-1), External Termination .................................................... 18-12 18-13 Line Read Burst (2-1-1-1), Internal Termination ..................................................... 18-13 18-14 Line Read Burst (3-2-2-2), External Termination .................................................... 18-13 18-15 Line Read Burst-Inhibited, Fast, External Termination............................................ 18-14 18-16 Line Write Burst (2-1-1-1), Internal/External Termination...................................... 18-14 18-17 Line Write Burst (3-2-2-2) with One Wait State, Internal Termination ................... 18-15 18-18 Line Write Burst-Inhibited, Internal Termination .................................................... 18-15 18-19 Longword Read from an 8-Bit Port, External Termination...................................... 18-16 18-20 Longword Read from an 8-Bit Port, Internal Termination ....................................... 18-16 18-21 Example of a Misaligned Longword Transfer (32-Bit Port) .................................... 18-17 18-22 Example of a Misaligned Word Transfer (32-Bit Port) ............................................ 18-17 18-23 Interrupt-Acknowledge Cycle Flowchart ................................................................. 18-20 18-24 Basic No-Wait-State External Master Access .......................................................... 18-22 18-25 External Master Burst Line Access to 32-Bit Port.................................................... 18-24 18-26 MCF5407 Two-Wire Mode Bus Arbitration Interface............................................. 18-25 18-27 Two-Wire Bus Arbitration with Bus Request Asserted............................................ 18-26 18-28 Two-Wire Implicit and Explicit Bus Mastership...................................................... 18-27 18-29 MCF5407 Two-Wire Bus Arbitration Protocol State Diagram................................ 18-28 18-30 Three-Wire Implicit and Explicit Bus Mastership.................................................... 18-30 18-31 Three-Wire Bus Arbitration...................................................................................... 18-31 18-32 Three-Wire Bus Arbitration Protocol State Diagram ............................................... 18-32 18-33 Master Reset Timing................................................................................................. 18-34 18-34 Software Watchdog Reset Timing ............................................................................ 18-35 19-1 JTAG Test Logic Block Diagram ............................................................................... 19-2 19-2 JTAG TAP Controller State Machine......................................................................... 19-4 19-3 IDCODE Register ....................................................................................................... 19-6 19-4 Disabling JTAG in JTAG Mode ............................................................................... 19-11 19-5 Disabling JTAG in Debug Mode .............................................................................. 19-11 20-1 Supply Voltage Sequencing and Separation Cautions................................................ 20-3 20-2 Example Circuit to Control Supply Sequencing......................................................... 20-4 20-3 CLKIN-to-Core Clock Frequency Ranges.................................................................. 20-4 20-4 Clock Timing .............................................................................................................. 20-5 xxvi MCF5407 User's Manual ILLUSTRATIONS Figure Number 20-5 20-6 20-7 20-8 20-9 20-10 20-11 20-12 20-13 20-14 20-15 20-16 20-17 20-18 20-19 20-20 20-21 20-22 20-23 20-24 A-1 A-2 A-3 A-4 A-5 A-6 A-7 Title Page Number PSTCLK Timing......................................................................................................... 20-6 AC Timings--Normal Read and Write Bus Cycles ................................................... 20-8 SDRAM Read Cycle with EDGESEL Tied to Buffered CLKIN ............................... 20-9 SDRAM Write Cycle with EDGESEL Tied to Buffered CLKIN ............................ 20-10 SDRAM Read Cycle with EDGESEL Tied High..................................................... 20-11 SDRAM Write Cycle with EDGESEL Tied High.................................................... 20-12 SDRAM Read Cycle with EDGESEL Tied Low ..................................................... 20-13 SDRAM Write Cycle with EDGESEL Tied Low .................................................... 20-14 AC Output Timing--High Impedance...................................................................... 20-14 Reset Timing............................................................................................................. 20-15 Real-Time Trace AC Timing .................................................................................... 20-16 BDM Serial Port AC Timing .................................................................................... 20-16 Timer Module AC Timing ........................................................................................ 20-17 I2C Input/Output Timings ......................................................................................... 20-19 UART0 and UART1 Module AC Timing--UART Mode ....................................... 20-20 UART1 in 8- and 16-bit CODEC Mode ................................................................... 20-21 UART1 in AC `97 Mode .......................................................................................... 20-21 General-Purpose I/O Timing..................................................................................... 20-22 DMA Timing ............................................................................................................ 20-23 IEEE 1149.1 (JTAG) AC Timing ............................................................................. 20-25 MCF5307 to MCF5407 TM[2:0] Pin Remapping ....................................................... A-5 Simplified Block Diagram ........................................................................................... A-6 PLL Module................................................................................................................. A-7 Exception Stack Frame Form .................................................................................... A-11 Write Debug Module Register Command (WDMREG)............................................... A-12 WDMREG Command Sequence................................................................................... A-13 PLL Power Supply Filter Circuit............................................................................... A-18 Illustrations xxvii ILLUSTRATIONS Figure Number xxviii Title MCF5407 User's Manual Page Number 9/1/00 TABLES Table Number 1-1 1-2 2-1 2-2 2-3 2-4 2-5 2-6 2-7 2-8 2-9 2-10 2-11 2-12 2-13 2-14 2-15 2-16 2-17 2-18 2-19 2-20 2-21 2-22 3-1 3-2 3-3 4-1 4-2 4-3 4-4 4-5 4-6 4-7 4-8 4-9 Title Page Number User-Level Registers................................................................................................... 1-15 Supervisor-Level Registers......................................................................................... 1-16 CCR Field Descriptions ............................................................................................. 2-10 MOVEC Register Map ............................................................................................... 2-11 Status Field Descriptions ............................................................................................ 2-11 Integer Data Formats................................................................................................... 2-13 ColdFire Effective Addressing Modes........................................................................ 2-15 Notational Conventions .............................................................................................. 2-16 ColdFire ISA_B Extension Summary......................................................................... 2-19 User-Level Instruction Set Summary.......................................................................... 2-19 Supervisor-Level Instruction Set Summary................................................................ 2-23 Misaligned Operand References ................................................................................. 2-24 Move Byte and Word Execution Times...................................................................... 2-25 Move Long Execution Times...................................................................................... 2-25 Miscellaneous Move Execution Times....................................................................... 2-26 One-Operand Instruction Execution Times ................................................................ 2-27 Two-Operand Instruction Execution Times................................................................ 2-27 Miscellaneous Instruction Execution Times............................................................... 2-29 Branch Instruction Execution Times .......................................................................... 2-30 Bcc Instruction Execution Times................................................................................ 2-30 Exception Vector Assignments................................................................................... 2-32 Format Field Encoding ............................................................................................... 2-33 Fault Status Encodings................................................................................................ 2-33 MCF5407 Exceptions ................................................................................................. 2-34 MAC Instruction Summary........................................................................................... 3-4 Two-Operand MAC Instruction Execution Times ....................................................... 3-5 MAC Move Instruction Execution Times..................................................................... 3-6 RAMBARn Field Description ...................................................................................... 4-3 Examples of Typical RAMBAR Settings ..................................................................... 4-6 Valid and Modified Bit Settings ................................................................................... 4-8 CACR Field Descriptions ........................................................................................... 4-21 ACRn Field Descriptions............................................................................................ 4-24 Instruction Cache Line State Transitions.................................................................... 4-27 Data Cache Line State Transitions.............................................................................. 4-29 Data Cache Line State Transitions (Current State Invalid) ........................................ 4-30 Data Cache Line State Transitions (Current State Valid)........................................... 4-31 Tables xxix TABLES Table Number 4-10 5-1 5-2 5-3 5-4 5-5 5-6 5-7 5-8 5-9 5-10 5-11 5-12 5-13 5-14 5-15 5-16 5-17 5-18 5-19 5-20 5-21 5-22 5-23 5-24 5-25 5-26 5-27 5-28 6-1 6-2 6-3 6-4 6-5 6-6 7-1 7-2 7-3 7-4 8-1 8-2 8-3 8-4 xxx Title Page Number Data Cache Line State Transitions (Current State Modified)..................................... 4-31 Debug Module Signals.................................................................................................. 5-2 PSTDDATA: Sequential Execution of Single-Cycle Instructions .............................. 5-3 PSTDDATA: Data Operand Captured.......................................................................... 5-4 Processor Status Encoding............................................................................................ 5-5 0xE Status Posting ........................................................................................................ 5-7 BDM/Breakpoint Registers........................................................................................... 5-9 AATR and AATR1 Field Descriptions....................................................................... 5-11 ABLR and ABLR1 Field Description......................................................................... 5-12 ABHR and ABHR1 Field Description........................................................................ 5-12 BAAR Field Descriptions ........................................................................................... 5-13 CSR Field Descriptions............................................................................................... 5-14 DBRn Field Descriptions............................................................................................ 5-16 DBMRn Field Descriptions ........................................................................................ 5-16 Access Size and Operand Data Location .................................................................... 5-16 PBR, PBR1, PBR2, PBR3 Field Descriptions............................................................ 5-17 PBMR Field Descriptions ........................................................................................... 5-17 TDR Field Descriptions .............................................................................................. 5-19 XTDR Field Descriptions ........................................................................................... 5-20 Receive BDM Packet Field Description ..................................................................... 5-25 Transmit BDM Packet Field Description ................................................................... 5-26 BDM Command Summary ......................................................................................... 5-26 BDM Field Descriptions ............................................................................................. 5-27 Control Register Map.................................................................................................. 5-42 Definition of DRc Encoding--Read........................................................................... 5-44 PSTDDATA Nibble/CSR[BSTAT] Breakpoint Response......................................... 5-46 Exception Vector Assignments................................................................................... 5-47 PSTDDATA Specification for User-Mode Instructions............................................. 5-50 PSTDDATA Specification for Supervisor-Mode Instructions ................................... 5-54 SIM Registers .............................................................................................................. 6-3 MBAR Field Descriptions ............................................................................................ 6-5 RSR Field Descriptions................................................................................................. 6-6 SYPCR Field Descriptions ........................................................................................... 6-8 PLLIPL Settings.......................................................................................................... 6-10 MPARK Field Descriptions........................................................................................ 6-11 Divide Ratio Encodings ............................................................................................... 7-2 PLLCR Field Descriptions............................................................................................ 7-3 PLL Module Input SIgnals............................................................................................ 7-4 PLL Module Output Signals ......................................................................................... 7-4 I2C Interface Memory Map........................................................................................... 8-6 I2C Address Register Field Descriptions ...................................................................... 8-6 IFDR Field Descriptions ............................................................................................... 8-7 I2CR Field Descriptions................................................................................................ 8-8 MCF5407 User's Manual TABLES Table Number 8-5 9-1 9-2 9-3 9-4 9-5 9-6 9-7 9-8 10-1 10-2 10-3 10-4 10-5 10-6 10-7 10-8 10-9 10-10 11-1 11-2 11-3 11-4 11-5 11-6 11-7 11-8 11-9 11-10 11-11 11-12 11-13 11-14 11-15 11-16 11-17 11-18 11-19 11-20 11-21 11-22 11-23 11-24 Title Page Number I2SR Field Descriptions................................................................................................ 8-9 Interrupt Controller Registers ....................................................................................... 9-2 Interrupt Control Registers ........................................................................................... 9-2 ICRn Field Descriptions ............................................................................................... 9-3 Interrupt Priority Scheme.............................................................................................. 9-4 AVR Field Descriptions................................................................................................ 9-6 Autovector Register Bit Assignments........................................................................... 9-6 IPR and IMR Field Descriptions................................................................................... 9-7 IRQPAR Field Descriptions ......................................................................................... 9-8 Chip-Select Module Signals ....................................................................................... 10-1 Byte Enables/Byte Write Enable Signal Settings ....................................................... 10-2 Accesses by Matches in CSCRs and DACRs ............................................................. 10-3 D7/AA, Automatic Acknowledge of Boot CS0.......................................................... 10-4 D[6:5]/PS[1:0], Port Size of Boot CS0 ....................................................................... 10-5 D3/BE_CONFIG0, BE[3:0] Boot Configuration ....................................................... 10-5 Chip-Select Registers.................................................................................................. 10-5 CSARn Field Description ........................................................................................... 10-7 CSMRn Field Descriptions ......................................................................................... 10-7 CSCRn Field Descriptions.......................................................................................... 10-8 DRAM Controller Registers ....................................................................................... 11-3 SDRAM Signal Summary .......................................................................................... 11-4 DCR Field Descriptions (Asynchronous Mode)......................................................... 11-5 DACR0/DACR1 Field Description ............................................................................ 11-6 DMR0/DMR1 Field Descriptions............................................................................... 11-7 Generic Address Multiplexing Scheme ...................................................................... 11-8 DRAM Addressing for Byte-Wide Memories.......................................................... 11-10 DRAM Addressing for 16-Bit Wide Memories........................................................ 11-10 DRAM Addressing for 32-Bit Wide Memories........................................................ 11-11 SDRAM Commands ................................................................................................. 11-17 Synchronous DRAM Signal Connections ................................................................ 11-17 DCR Field Descriptions (Synchronous Mode) ......................................................... 11-19 DACR0/DACR1 Field Descriptions (Synchronous Mode)...................................... 11-21 DMR0/DMR1 Field Descriptions............................................................................. 11-23 MCF5407 to SDRAM Interface (8-Bit Port, 9-Column Address Lines).................. 11-24 MCF5407 to SDRAM Interface (8-Bit Port,10-Column Address Lines)................. 11-24 MCF5407 to SDRAM Interface (8-Bit Port,11-Column Address Lines)................. 11-24 MCF5407 to SDRAM Interface (8-Bit Port,12-Column Address Lines)................. 11-24 MCF5407 to SDRAM Interface (8-Bit Port,13-Column Address Lines)................. 11-25 MCF5407 to SDRAM Interface (16-Bit Port, 8-Column Address Lines)................ 11-25 MCF5407 to SDRAM Interface (16-Bit Port, 9-Column Address Lines)................ 11-25 MCF5407 to SDRAM Interface (16-Bit Port, 10-Column Address Lines).............. 11-25 MCF5407 to SDRAM Interface (16-Bit Port, 11-Column Address Lines).............. 11-25 MCF5407 to SDRAM Interface (16-Bit Port, 12-Column Address Lines).............. 11-26 Tables xxxi TABLES Table Number 11-25 11-26 11-27 11-28 11-29 11-30 11-31 11-32 11-33 11-34 11-35 11-36 11-37 12-1 12-2 12-3 12-4 12-5 13-1 13-2 13-3 13-4 14-1 14-2 14-3 14-4 14-5 14-6 14-7 14-8 14-9 14-10 14-11 14-12 14-13 14-14 14-15 14-16 14-17 14-18 14-19 15-1 15-2 xxxii Title Page Number MCF5407 to SDRAM Interface (16-Bit Port, 13-Column-Address Lines) ............. 11-26 MCF5407 to SDRAM Interface (32-Bit Port, 8-Column Address Lines)................ 11-26 MCF5407 to SDRAM Interface (32-Bit Port, 9-Column Address Lines)................ 11-26 MCF5407 to SDRAM Interface (32-Bit Port, 10-Column Address Lines).............. 11-26 MCF5407 to SDRAM Interface (32-Bit Port, 11-Column Address Lines).............. 11-27 MCF5407 to SDRAM Interface (32-Bit Port, 12-Column Address Lines).............. 11-27 SDRAM Hardware Connections............................................................................... 11-27 SDRAM Example Specifications ............................................................................. 11-34 SDRAM Hardware Connections............................................................................... 11-35 DCR Initialization Values......................................................................................... 11-35 DACR Initialization Values...................................................................................... 11-36 DMR0 Initialization Values...................................................................................... 11-37 Mode Register Initialization ..................................................................................... 11-38 DMA Signals .............................................................................................................. 12-2 MCF5407 Signal Configurations for PP[4:2]/TM[2:0]/DACK[1:0] .......................... 12-3 Memory Map for DMA Controller Module Registers................................................ 12-6 DCRn Field Descriptions............................................................................................ 12-8 DSRn Field Descriptions .......................................................................................... 12-10 General-Purpose Timer Module Memory Map .......................................................... 13-3 TMRn Field Descriptions ........................................................................................... 13-4 TERn Field Descriptions............................................................................................. 13-6 Time-Out Values (in Seconds)--TRR[REF] = 0xFFFF(162-MHz Processor Clock) 13-7 UART Module Programming Model.......................................................................... 14-4 UMR1n Field Descriptions ......................................................................................... 14-6 UMR2n Field Descriptions ......................................................................................... 14-7 RXLVL Field Descriptions......................................................................................... 14-8 Modem Control Register (MODCTL) Field Descriptions.......................................... 14-9 TXLVL Field Descriptions ....................................................................................... 14-10 USRn Field Descriptions .......................................................................................... 14-11 UCSRn Field Descriptions........................................................................................ 14-12 RSMP Field Descriptions ......................................................................................... 14-13 TSPC Field Descriptions........................................................................................... 14-13 UCRn Field Descriptions.......................................................................................... 14-14 UIPCRn Field Descriptions ...................................................................................... 14-17 UACRn Field Descriptions ....................................................................................... 14-18 UISRn/UIMRn Field Descriptions ........................................................................... 14-19 UIVRn Field Descriptions ........................................................................................ 14-20 UIPn Field Descriptions............................................................................................ 14-20 UOP1/UOP0 Field Descriptions ............................................................................... 14-21 UART Module Signals ............................................................................................. 14-22 UART Module Initialization Sequence .................................................................... 14-38 Parallel Port Pin Descriptions ..................................................................................... 15-2 PADDR Field Description .......................................................................................... 15-2 MCF5407 User's Manual TABLES Table Number 15-3 16-1 16-2 16-3 16-4 16-5 17-1 17-2 17-3 17-4 17-5 17-6 17-7 17-8 17-9 17-10 17-11 17-12 17-13 17-14 17-15 18-1 18-2 18-3 18-4 18-5 18-6 18-7 18-8 18-9 18-10 18-11 18-12 19-1 19-2 19-3 19-4 20-1 20-2 20-3 20-4 20-5 20-6 Title Page Number Relationship between PADAT Register and Parallel Port Pin (PP) ........................... 15-3 Pins 1-52 (Left, Top-to-Bottom) ................................................................................ 16-1 Pins 53-104 (Bottom, Left-to-Right).......................................................................... 16-3 Pins 105-156 (Right, Bottom-to-Top)........................................................................ 16-5 Pins 157-208 (Top, Right-to-Left) ............................................................................. 16-6 Dimensions ............................................................................................................... 16-11 MCF5407 Signal Index............................................................................................... 17-3 MCF5407 Alphabetical Signal Index ......................................................................... 17-5 Data Pin Configuration ............................................................................................... 17-8 Bus Cycle Size Encoding............................................................................................ 17-9 Bus Cycle Transfer Type Encoding.......................................................................... 17-10 TM[2:0] Encodings for TT = 00 (Normal Access)................................................... 17-10 TM2 Encoding for DMA as Master (TT = 01) ......................................................... 17-11 TM[1:0] Encoding for DMA as Master (TT = 01) ................................................... 17-11 TM[2:0] Encodings for TT = 10 (Emulator Access) ................................................ 17-11 TM[2:0] Encodings for TT = 11 (Interrupt Level) ................................................... 17-12 Data Pin Configuration ............................................................................................. 17-14 D7 Selection of CS0 Automatic Acknowledge ........................................................ 17-14 D6 and D5 Selection of CS0 Port Size ..................................................................... 17-14 D3/BE_CONFIG, BE[3:0] Boot Configuration ....................................................... 17-15 D4/ADDR_CONFIG, Address Pin Assignment....................................................... 17-15 ColdFire Bus Signal Summary ................................................................................... 18-1 Bus Cycle Size Encoding............................................................................................ 18-3 Accesses by Matches in CSCRs and DACRs ............................................................. 18-5 Bus Cycle States ......................................................................................................... 18-6 Allowable Line Access Patterns ............................................................................... 18-12 MCF5407 Arbitration Protocol States ...................................................................... 18-20 ColdFire Bus Arbitration Signal Summary............................................................... 18-21 Cycles for Basic No-Wait-State External Master Access......................................... 18-23 Cycles for External Master Burst Line Access to 32-Bit Port .................................. 18-24 MCF5407 Two-Wire Bus Arbitration Protocol Transition Conditions.................... 18-28 Three-Wire Bus Arbitration Protocol Transition Conditions ................................... 18-32 Data Pin Configuration ............................................................................................. 18-35 JTAG Pin Descriptions ............................................................................................... 19-3 JTAG Instructions....................................................................................................... 19-5 IDCODE Bit Assignments.......................................................................................... 19-6 Boundary-Scan Bit Definitions................................................................................... 19-7 Absolute Maximum Ratings ....................................................................................... 20-1 Operating Temperatures.............................................................................................. 20-1 DC Electrical Specifications ....................................................................................... 20-2 Divide Ratio Encodings .............................................................................................. 20-4 Clock Timing Specification ........................................................................................ 20-5 Input AC Timing Specification................................................................................... 20-6 Tables xxxiii TABLES Table Number 20-7 20-8 20-9 20-10 20-11 20-12 20-13 20-14 20-15 20-16 A-1 A-2 A-3 A-4 A-5 A-6 A-7 A-8 A-9 A-10 A-11 A-12 A-13 B-1 B-2 B-3 B-4 B-5 B-6 B-7 B-8 B-9 B-10 xxxiv Title Page Number Output AC Timing Specification ................................................................................ 20-6 Reset Timing Specification....................................................................................... 20-15 Debug AC Timing Specification .............................................................................. 20-16 Timer Module AC Timing Specification.................................................................. 20-17 I2C Input Timing Specifications between SCL and SDA......................................... 20-18 I2C Output Timing Specifications between SCL and SDA ...................................... 20-18 UART Module AC Timing Specifications ............................................................... 20-19 General-Purpose I/O Port AC Timing Specifications............................................... 20-22 DMA AC Timing Specifications .............................................................................. 20-23 IEEE 1149.1 (JTAG) AC Timing Specifications ..................................................... 20-24 Differences between MCF5307 and MCF5407........................................................... A-1 MOVEC CPU Space Register Map ............................................................................. A-4 TM[2:1] Encoding for MCF5307 Internal DMA as Master (TT = 01) ....................... A-4 TM0 Encoding for MCF5307 Internal DMA as Master (TT = 01) ............................. A-5 Divide Ratio Encodings ............................................................................................... A-7 D[7:0] Multiplexing ..................................................................................................... A-8 D7/AA, Automatic Acknowledge of Boot CS0........................................................... A-9 D[6:5]/PS[1:0], Port Size of Boot CS0 ........................................................................ A-9 D4/ADDR_CONFIG, Address Pin Assignment.......................................................... A-9 D3/BE_CONFIG, BE[3:0] Boot Configuration .......................................................... A-9 Definition of DRc Encoding--Write ......................................................................... A-13 Debug C Exception Vector Assignments .................................................................. A-16 Version 4 Debug C Processor Status Encodings ....................................................... A-17 SIM Registers................................................................................................................B-1 Interrupt Controller Registers .......................................................................................B-1 Chip-Select Registers....................................................................................................B-2 DRAM Controller Registers .........................................................................................B-3 General-Purpose Timer Registers .................................................................................B-4 UART0 Control Registers.............................................................................................B-4 UART1 Control Registers.............................................................................................B-6 Parallel Port Memory Map............................................................................................B-7 I2C Interface Memory Map...........................................................................................B-8 DMA Controller Registers............................................................................................B-8 MCF5407 User's Manual About This Book The primary objective of this user's manual is to define the functionality of the MCF5407 processors for use by software and hardware developers. The information in this book is subject to change without notice, as described in the disclaimers on the title page of this book. As with any technical documentation, it is the readers' responsibility to be sure they are using the most recent version of the documentation. To locate any published errata or updates for this document, refer to the world-wide web at http://www.motorola.com/coldfire. Audience This manual is intended for system software and hardware developers and applications programmers who want to develop products for the MCF5407. It is assumed that the reader understands operating systems, microprocessor system design, basic principles of software and hardware, and basic details of the ColdFire architecture. Organization Following is a summary and a brief description of the major sections of this manual: * Chapter 1, "Overview," includes general descriptions of the modules and features incorporated in the MCF5407, focussing in particular on new features defined by the Version 4 (V4) programming model, such as the Harvard memory architecture implementation, new instructions, and new registers. * Part I is intended for system designers who need to understand the operation of the MCF5407 ColdFire core and its multiply/accumulate (MAC) execution unit. It describes the programming and exception models, Harvard memory implementation, and debug module. -- Chapter 2, "ColdFire Core," provides an overview of the microprocessor core of the MCF5407. The chapter begins with a description of enhancements from the V3 ColdFire core, and then fully describes the V4 programming model as it is implemented on the MCF5407. It also includes a full description of exception handling, data formats, an instruction set summary, and a table of instruction timings. About This Book xxxv Organization -- Chapter 3, "Hardware Multiply/Accumulate (MAC) Unit," describes the MCF5407 multiply/accumulate unit, which executes integer multiply, multiply-accumulate, and miscellaneous register instructions. The MAC is integrated into the operand execution pipeline (OEP). * -- Chapter 4, "Local Memory." This chapter describes the MCF5407 implementation of the ColdFire V4 local memory specification. It consists of the two following major sections. - Section 4.2, "SRAM Overview," describes the MCF5407 on-chip static RAM (SRAM) implementation. It covers general operations, configuration, and initialization. It also provides information and examples showing how to minimize power consumption when using the SRAM. - Section 4.7, "Cache Overview," describes the MCF5407 cache implementation, including organization, configuration, and coherency. It describes cache operations and how the cache interacts with other memory structures. -- Chapter 5, "Debug Support," describes the Revision C enhanced hardware debug support in the MCF5407. This revision of the ColdFire debug architecture encompasses earlier revisions. Part II, "System Integration Module (SIM)," describes the system integration module, which provides overall control of the bus and serves as the interface between the ColdFire core processor complex and internal peripheral devices. It includes a general description of the SIM and individual chapters that describe components of the SIM, such as the phase-lock loop (PLL) timing source, interrupt controller for peripherals, configuration and operation of chip selects, and the SDRAM controller. -- Chapter 6, "SIM Overview," describes the SIM programming model, bus arbitration, and system-protection functions for the MCF5407. -- Chapter 7, "Phase-Locked Loop (PLL)," describes configuration and operation of the PLL module. It describes in detail the registers and signals that support the PLL implementation. -- Chapter 8, "I2C Module," describes the MCF5407 I2C module, including I2C protocol, clock synchronization, and the registers in the I2C programing model. It also provides extensive programming examples. -- Chapter 9, "Interrupt Controller," describes operation of the interrupt controller portion of the SIM. Includes descriptions of the registers in the interrupt controller memory map and the interrupt priority scheme. -- Chapter 10, "Chip-Select Module," describes the MCF5407 chip-select implementation, including the operation and programming model, which includes the chip-select address, mask, and control registers. -- Chapter 11, "Synchronous/Asynchronous DRAM Controller Module," describes configuration and operation of the synchronous/asynchronous DRAM xxxvi MCF5407 User's Manual Organization controller component of the SIM. It begins with a general description and brief glossary, and includes a description of signals involved in DRAM operations. The remainder of the chapter is divided between descriptions of asynchronous and synchronous operations. * * Part III, "Peripheral Module," describes the operation and configuration of the MCF5407 DMA, timer, UART, and parallel port modules, and describes how they interface with the system integration unit, described in Part II. -- Chapter 12, "DMA Controller Module," provides an overview of the DMA controller module and describes in detail its signals and registers. The latter sections of this chapter describe operations, features, and supported data transfer modes in detail, showing timing diagrams for various operations. -- Chapter 13, "Timer Module," describes configuration and operation of the two general-purpose timer modules, timer 0 and timer 1. It includes programming examples. -- Chapter 14, "UART Modules," describes the use of the universal asynchronous/synchronous receiver/transmitters (UARTs) implemented on the MCF5407 and includes programming examples. Particular attention is given to the UART1 implementation of a synchronous interface that provides a controller for an 8- or 16-bit CODEC interface and an audio CODEC `97 (AC '97) digital interface. -- Chapter 15, "Parallel Port (General-Purpose I/O)," describes the operation and programming model of the parallel port pin assignment, direction-control, and data registers. It includes a code example for setting up the parallel port. Part IV, "Hardware Interface," provides a pinout and both electrical and functional descriptions of the MCF5407 signals. It also describes how these signals interact to support the variety of bus operations shown in timing diagrams. -- Chapter 16, "Mechanical Data," provides a functional pin listing and package diagram for the MCF5407. -- Chapter 17, "Signal Descriptions," provides an alphabetical listing of MCF5407 signals. This chapter describes the MCF5407 signals. In particular, it shows which are inputs or outputs, how they are multiplexed, which signals require pull-up resistors, and the state of each signal at reset. -- Chapter 18, "Bus Operation," describes data transfers, error conditions, bus arbitration, and reset operations. It describes transfers initiated by the MCF5407 and by an external bus master, and includes detailed timing diagrams showing the interaction of signals in supported bus operations. Note that Chapter 11, "Synchronous/Asynchronous DRAM Controller Module," describes DRAM cycles. -- Chapter 19, "IEEE 1149.1 Test Access Port (JTAG)," describes configuration and operation of the MCF5407 JTAG test implementation. It describes the use of JTAG instructions and how to disable JTAG functionality. About This Book xxxvii Suggested Reading -- Chapter 20, "Electrical Specifications," describes AC and DC electrical specifications and thermal characteristics for the MCF5407. Because additional speeds may have become available since the publication of this book, consult Motorola's ColdFire web page, http://www.motorola.com/coldfire, to confirm that this is the latest information. This manual includes the following two appendixes: * Appendix A, "Migrating from the ColdFire MCF5307 to the MCF5407," highlights the differences between the MCF5307B and MCF5407. Users of the MCF5307 and MCF5307A should use this document in conjunction with the MCF5307 User's Manual Mask Set Addendum. For additional information, see the MCF5407 Integrated ColdFire Microprocessor Product Brief. * Appendix B, "List of Memory Maps," lists the entire address-map for MCF5407 memory-mapped registers. This manual also includes a glossary and an index. Suggested Reading This section lists additional reading that provides background for the information in this manual as well as general information about the ColdFire architecture. General Information The following documentation provides useful information about the ColdFire architecture and computer architecture in general: ColdFire Documentation The ColdFire documentation is available from the sources listed on the back cover of this manual. Document order numbers are included in parentheses for ease in ordering. * ColdFire Programmers Reference Manual, R1.0 (MCF5200PRM/AD) * User's manuals--These books provide details about individual ColdFire implementations and are intended to be used in conjunction with The ColdFire Programmers Reference Manual. These include the following: -- ColdFire MCF5102 User's Manual (MCF5102UM/AD) -- ColdFire MCF5202 User's Manual (MCF5202UM/AD) * xxxviii -- ColdFire MCF5204 User's Manual (MCF5204UM/AD) -- ColdFire MCF5206 User's Manual (MCF5206EUM/AD) -- ColdFire MCF5206E User's Manual (MCF5206EUM/AD) -- ColdFire MCF5307 User's Manual (MCF5307UM/AD) ColdFire Programmers Reference Manual, R1.0 (MCF5200PRM/AD) MCF5407 User's Manual Conventions * Using Microprocessors and Microcomputers: The Motorola Family, William C. Wray, Ross Bannatyne, Joseph D. Greenfield Additional literature on ColdFire implementations is being released as new processors become available. For a current list of ColdFire documentation, refer to the World Wide Web at http://www.motorola.com/ColdFire/. Conventions This document uses the following notational conventions: MNEMONICS In text, instruction mnemonics are shown in uppercase. mnemonics In code and tables, instruction mnemonics are shown in lowercase. italics 0x0 Italics indicate variable command parameters. Book titles in text are set in italics. Prefix to denote hexadecimal number 0b0 Prefix to denote binary number REG[FIELD] Abbreviations for registers are shown in uppercase. Specific bits, fields, or ranges appear in brackets. For example, RAMBAR[BA] identifies the base address field in the RAM base address register. nibble A 4-bit data unit byte An 8-bit data unit word A 16-bit data unit longword A 32-bit data unit x In some contexts, such as signal encodings, x indicates a don't care. n Used to express an undefined numerical value NOT logical operator & AND logical operator | OR logical operator Acronyms and Abbreviations Table i lists acronyms and abbreviations used in this document. Table i. Acronyms and Abbreviated Terms Term Meaning ADC Analog-to-digital conversion ALU Arithmetic logic unit AVEC Autovector About This Book xxxix Acronyms and Abbreviations Table i. Acronyms and Abbreviated Terms (Continued) Term xl Meaning BDM Background debug mode BIST Built-in self test BSDL Boundary-scan description language CODEC Code/decode DAC Digital-to-analog conversion DMA Direct memory access DSP Digital signal processing EA Effective address EDO Extended data output (DRAM) FIFO First-in, first-out GPIO General-purpose I/O I2C Inter-integrated circuit IEEE Institute for Electrical and Electronics Engineers IFP Instruction fetch pipeline IPL Interrupt priority level JEDEC Joint Electron Device Engineering Council JTAG Joint Test Action Group LIFO Last-in, first-out LRU Least recently used LSB Least-significant byte lsb Least-significant bit MAC Multiple accumulate unit MBAR Memory base address register MSB Most-significant byte msb Most-significant bit Mux Multiplex NOP No operation OEP Operand execution pipeline PC Program counter PCLK Processor clock PLL Phase-locked loop PLRU Pseudo least recently used MCF5407 User's Manual Terminology and Notational Conventions Table i. Acronyms and Abbreviated Terms (Continued) Term Meaning POR Power-on reset PQFP Plastic quad flat pack RISC Reduced instruction set computing Rx Receive SIM System integration module SOF Start of frame TAP Test access port TTL Transistor-to-transistor logic Tx Transmit UART Universal asynchronous/synchronous receiver transmitter Terminology and Notational Conventions Table ii shows notational conventions used throughout this document. Table ii Notational Conventions Instruction Operand Syntax Opcode Wildcard cc Logical condition (example: NE for not equal) Register Specifications An Ay,Ax Any address register n (example: A3 is address register 3) Source and destination address registers, respectively Dn Any data register n (example: D5 is data register 5) Dy,Dx Source and destination data registers, respectively Rc Any control register (example VBR is the vector base register) Rm MAC registers (ACC, MAC, MASK) Rn Any address or data register Rw Destination register w (used for MAC instructions only) Ry,Rx Xi Any source and destination registers, respectively index register i (can be an address or data register: Ai, Di) About This Book xli Terminology and Notational Conventions Table ii Notational Conventions (Continued) Instruction Operand Syntax Register Names ACC MAC accumulator register CCR Condition code register (lower byte of SR) MACSR MAC status register MASK MAC mask register PC Program counter SR Status register Port Name PSTDDATA Processor status/debug data port Miscellaneous Operands # y,x